Skip to content

Remove usages of Metadata.Builder#putDefaultProjectCustom#128810

Merged
nielsbauman merged 4 commits intoelastic:mainfrom
nielsbauman:metadata-builder/put-default-custom
Jun 4, 2025
Merged

Remove usages of Metadata.Builder#putDefaultProjectCustom#128810
nielsbauman merged 4 commits intoelastic:mainfrom
nielsbauman:metadata-builder/put-default-custom

Conversation

@nielsbauman
Copy link
Copy Markdown
Contributor

And replace it with appropriate calls to the equivalent method on ProjectMetadata.Builder.
In most cases this does not make the code project aware, but does reduce the number of deprecated methods in use.

And replace it with appropriate calls to the equivalent method on
`ProjectMetadata.Builder`.
In most cases this _does not_ make the code project aware, but does
reduce the number of deprecated methods in use.
@nielsbauman nielsbauman requested a review from a team June 3, 2025 08:56
@nielsbauman nielsbauman added :Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team v9.1.0 labels Jun 3, 2025
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Copy Markdown
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

I have a few comments.

For context, the putDefaultProjectCustom method was added with this reason. I agree it can be replaced with the proposed changes. The getDefaultProject method is also deprecated. But overall it's one less deprecation and the layout is more suitable for making them project aware which is coming up soon.

@Override
public ClusterState execute(ClusterState currentState) {
final RepositoriesMetadata currentReposMetadata = RepositoriesMetadata.get(currentState);
final var project = currentState.metadata().getProject();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should be getDefaultProject() similar to the above usage?

@nielsbauman nielsbauman requested a review from ywangd June 4, 2025 06:58
Copy link
Copy Markdown
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

LGTM

I have similar comments of "keeping it as is" for 3 more places. I'd appreciate if you could address them.

@nielsbauman
Copy link
Copy Markdown
Contributor Author

@ywangd done, let me know what you think.

@ywangd
Copy link
Copy Markdown
Member

ywangd commented Jun 4, 2025

LGTM thanks 🙏

@nielsbauman nielsbauman enabled auto-merge (squash) June 4, 2025 07:13
@nielsbauman nielsbauman merged commit 28959c2 into elastic:main Jun 4, 2025
16 of 18 checks passed
@nielsbauman nielsbauman deleted the metadata-builder/put-default-custom branch June 4, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants