-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Core][Deprecations] omit deprecationDetails if needed it in the reques #114399
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c7a1415
omit deprecationDetails if needed it
XavierM e80d967
review I
XavierM 8169153
doc update
XavierM 1218ab3
Merge branch 'master' of github.com:elastic/kibana into omit_deprecat…
XavierM 0d09309
Merge branch 'master' into omit_deprecation_details
kibanamachine e729918
Merge branch 'master' into omit_deprecation_details
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@Bamieh do you know why we're adding this in the first place? I suspect more endpoints may fail to validate because of this added parameter.
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.
The resolve API endpoint has no way of telling which deprecation domain ID the user is attempting to resolve (via UA or a direct endpoint call) unless each deprecation explicitly passed the
domainId
in thecorrectiveAction.api.body
.The field is shown in the example route in the functional tests
the
domainId
is the id of the plugin and it is automatically passed to each deprecation. I am passing it to the api body as well to avoid plugins requirinig to manually pass theirdomainId
to the api if they need it.Looking at the current depreaction routes across kibana I don't see this used yet so we can remove it completely. I am curious why not just add this object to the schema of your routes @XavierM rather than omitting it by adding extra logic.
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.
Unless I understand
kibana/src/core/public/deprecations/deprecations_client.ts
Lines 48 to 50 in 249c5fb
wrong, we're performing a call against the endpoint registered via
DomainDeprecationDetails.correctiveActions.api
. as all these info are registered by the deprecation owners, I would expect them to be self-sufficient to resolve the deprecation?Sorry, to which API? do automatic resolution endpoints need to call a deprecation API somehow after the resolution?
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.
Here is an example how a deprecation is registered:
kibana/x-pack/plugins/reporting/server/deprecations/migrate_existing_indices_ilm_policy.ts
Lines 32 to 60 in 249c5fb
The
domainId
is not passed by the plugins. It is automatically attached to the registered deprecation based on which plugin is doing this registration.The plugins register their own routes to correct the deprecation, and since i'm providing the
domainId
during deprecation registration, i thought i'd also pass it to the route as well.The correctiveAction.api is called by the deprecations service DeprecationsClient which is used by the UA
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.
I had a zoom call with @XavierM and this approach of adding a flag LGTM for now. They are not creating their own route for resolving the deprecation so it is not possible to just pass this provided
context
object and allowing it in the route schema.I think it is fine to have this flag inside
correctiveActions.api.omitContextFromBody
. We can revisit this in8.x
(if needed) since we can change it on a more comfortable schedule and we'll have less custom routes to resolve deprecations.