Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌊 Refactor APIs to follow Elasticsearch conventions #204671

Merged
merged 20 commits into from
Dec 23, 2024

Conversation

simianhacker
Copy link
Member

@simianhacker simianhacker commented Dec 17, 2024

Summary

This PR refactors the API by creating a new packaged called @kbn/streams-schema where you can find all the Zod types along with some type guards. I've also updated all the API's and calls to use the new schemas.

@simianhacker simianhacker marked this pull request as ready for review December 18, 2024 16:24
@simianhacker simianhacker requested review from a team as code owners December 18, 2024 16:24
@simianhacker simianhacker added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.18.0 v9.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Streams This is the label for the Streams Project labels Dec 18, 2024
@simianhacker simianhacker changed the title [Streams] Refactor APIs to follow Elasticsearch conventions 🌊 Refactor APIs to follow Elasticsearch conventions Dec 18, 2024
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner December 18, 2024 16:58
Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x-pack/test/tsconfig.json changes LGTM

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks mostly good. Left some general questions.

There were a couple smaller issues left from the conflicts - not sure if you still need it but I pushed some fixes here: 473067e

The fields page still has an issue I didn't tackle

@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner December 19, 2024 17:31
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on latest changes

@flash1293 flash1293 removed the request for review from a team December 20, 2024 15:43
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
streamsApp 169 201 +32

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/streams-schema - 84 +84
streams 13 9 -4
total +80

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
@kbn/streams-schema - 12 +12

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
streamsApp 115.1KB 185.0KB +69.9KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
streams 3 2 -1
Unknown metric groups

API count

id before after diff
@kbn/streams-schema - 84 +84
streams 13 9 -4
total +80

History

@flash1293 flash1293 merged commit 5ae53d4 into elastic:main Dec 23, 2024
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12470601684

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 204671

Questions ?

Please refer to the Backport tool documentation

flash1293 added a commit that referenced this pull request Dec 25, 2024
…205121)

# Backport

This will backport the following commits from `main` to `8.x`:
- [🌊 Refactor APIs to follow Elasticsearch conventions
(#204671)](#204671)

Co-authored-by: Chris Cowan <[email protected]>
Kerry350 added a commit that referenced this pull request Dec 30, 2024
## Summary

Small fix to the Schema Editor page after the changes in
#204671.

(Without this mapped fields won't be displayed as we use a read stream
definition).
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 30, 2024
…5251)

## Summary

Small fix to the Schema Editor page after the changes in
elastic#204671.

(Without this mapped fields won't be displayed as we use a read stream
definition).

(cherry picked from commit 8cc2f2b)
kibanamachine added a commit that referenced this pull request Dec 30, 2024
…205251) (#205266)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Streams] Schema Editor isWiredStream &gt; isWiredReadStream
(#205251)](#205251)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kerry
Gallagher","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-30T14:24:19Z","message":"[Streams]
Schema Editor isWiredStream > isWiredReadStream (#205251)\n\n##
Summary\r\n\r\nSmall fix to the Schema Editor page after the changes
in\r\nhttps://github.com//pull/204671.\r\n\r\n(Without
this mapped fields won't be displayed as we use a read
stream\r\ndefinition).","sha":"8cc2f2b9c8c463feaa87f77a05e46a3f75f10fb7","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","v8.18.0","Feature:Streams"],"title":"[Streams]
Schema Editor isWiredStream >
isWiredReadStream","number":205251,"url":"https://github.com/elastic/kibana/pull/205251","mergeCommit":{"message":"[Streams]
Schema Editor isWiredStream > isWiredReadStream (#205251)\n\n##
Summary\r\n\r\nSmall fix to the Schema Editor page after the changes
in\r\nhttps://github.com//pull/204671.\r\n\r\n(Without
this mapped fields won't be displayed as we use a read
stream\r\ndefinition).","sha":"8cc2f2b9c8c463feaa87f77a05e46a3f75f10fb7"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205251","number":205251,"mergeCommit":{"message":"[Streams]
Schema Editor isWiredStream > isWiredReadStream (#205251)\n\n##
Summary\r\n\r\nSmall fix to the Schema Editor page after the changes
in\r\nhttps://github.com//pull/204671.\r\n\r\n(Without
this mapped fields won't be displayed as we use a read
stream\r\ndefinition).","sha":"8cc2f2b9c8c463feaa87f77a05e46a3f75f10fb7"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Kerry Gallagher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Streams This is the label for the Streams Project release_note:skip Skip the PR/issue when compiling release notes v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants