Skip to content

Make deprecation plugin project-aware #130364

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

Merged
merged 3 commits into from
Jul 1, 2025

Conversation

nielsbauman
Copy link
Contributor

Updates the majority of the plugin to be aware of multiple projects.

The deprecation plugin is excluded in serverless, so in DeprecationIndexingComponent we hard-code the default project ID to avoid an unworthy investment of namespacing effort.

Updates the majority of the plugin to be aware of multiple projects.

The deprecation plugin is excluded in serverless, so in
`DeprecationIndexingComponent` we hard-code the default project ID to
avoid an unworthy investment of namespacing effort.
@nielsbauman nielsbauman added >non-issue :Data Management/Indices APIs APIs to create and manage indices and templates labels Jun 30, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added Team:Data Management Meta label for data/management team v9.2.0 labels Jun 30, 2025
Copy link
Member

@PeteGillinElastic PeteGillinElastic left a comment

Choose a reason for hiding this comment

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

Just one optional comment.

List<DeprecationIssue> allIssues = new ArrayList<>();
CHECKS.forEach(check -> check.apply(clusterState, transformConfigs, allIssues));
CHECKS.forEach(check -> check.accept(transformConfigs, allIssues));
Copy link
Member

Choose a reason for hiding this comment

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

Do we feel like the CHECKS abstraction is still pulling its weight here? There's one check hard-coded, we could just call checkTransformSettings directly, and it'd be more readable. If we needed to add more checks in the future, it's not clear to me that adding a method to the list would be better than adding another method call here. Plus, it's not clear to me that the BiConsumer would have the correct signature for a theoretical future check, either. (Presumably, at some point in the past there was a check which consumed ClusterState, hence the redundant parameter. A future check might need that, or might need the ProjectMetadata, but we can't really guess. now.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hear what you're saying. My intuition was that this CHECKS field makes this class more consistent with the other deprecation checkers. But I don't have strong feelings, so I'm fine with calling that method directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On second thought, I think I agree with you that the CHECKS abstraction isn't super valuable, and that goes for the other classes too. I don't think it's worth opening a PR for those other classes, but perhaps I'll remember it if I ever need to touch this code again.

@nielsbauman nielsbauman enabled auto-merge (squash) July 1, 2025 12:43
@nielsbauman nielsbauman disabled auto-merge July 1, 2025 15:08
@nielsbauman nielsbauman merged commit 2404dac into elastic:main Jul 1, 2025
31 of 32 checks passed
@nielsbauman nielsbauman deleted the deprecation-mp branch July 2, 2025 13:20
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 3, 2025
Updates the majority of the plugin to be aware of multiple projects.

The deprecation plugin is excluded in serverless, so in
`DeprecationIndexingComponent` we hard-code the default project ID to
avoid an unworthy investment of namespacing effort.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >non-issue Team:Data Management Meta label for data/management team v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants