-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[OAS] Update x-state
behaviour to include availability.since
#221137
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
[OAS] Update x-state
behaviour to include availability.since
#221137
Conversation
Pinging @elastic/kibana-core (Team:Core) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the behavior of setXState to incorporate the availability.since property, enhancing the x-state description for operations based on their stability and version introduction.
- Updated setXState logic to support a new "stable" state and attach release version details.
- Added comprehensive test cases in util.test.ts for different availability scenarios.
- Adjusted the CustomOperationObject type in type.ts to allow a broader x-state string value.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/platform/packages/shared/kbn-router-to-openapispec/src/util.ts | Updated setXState to include a stable state and version information from availability.since |
src/platform/packages/shared/kbn-router-to-openapispec/src/util.test.ts | Added tests covering various availability configurations, including cases with only "since" provided |
src/platform/packages/shared/kbn-router-to-openapispec/src/type.ts | Modified the x-state property type to accept any string value |
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/dashboards --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/alerting/maintenance_window --update'
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
cc @jloleysens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left a question 😄
if (availability.stability === 'stable') { | ||
state = 'Generally available'; | ||
} else if (availability.stability === 'experimental') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading the issue it says
if availability.stability = stable, since should be mandatory and x-state should be "Generally available; added in xxx" where xxxx is the since value.
How strict should we be with the mandatory
? Do we need to throw an error or log a warning if it doesn't exist? Or maybe it's not that important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good q. I avoided making these required for now in favour of getting the functionality merged in. My reasoning was that I'd keep things a bit more flexible for now rather than incur any refactoring outside of this code. It could be that as a next step we should follow up on this.
…stic#221137) ## Summary Updated the behaviour of `setXState` per elastic#221056. Partially addresses that issue. In future we need to migrate existing routes to add that information, this covers the Core provided capability. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <[email protected]>
Summary
Updated the behaviour of
setXState
per #221056.Partially addresses that issue. In future we need to migrate existing routes to add that information, this covers the Core provided capability.
Checklist