Remove usages of Metadata.Builder#putDefaultProjectCustom#128810
Merged
nielsbauman merged 4 commits intoelastic:mainfrom Jun 4, 2025
Merged
Remove usages of Metadata.Builder#putDefaultProjectCustom#128810nielsbauman merged 4 commits intoelastic:mainfrom
Metadata.Builder#putDefaultProjectCustom#128810nielsbauman merged 4 commits intoelastic:mainfrom
Conversation
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.
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
ywangd
reviewed
Jun 3, 2025
Member
ywangd
left a comment
There was a problem hiding this comment.
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(); |
Member
There was a problem hiding this comment.
I think this should be getDefaultProject() similar to the above usage?
server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java
Outdated
Show resolved
Hide resolved
ywangd
reviewed
Jun 4, 2025
server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java
Outdated
Show resolved
Hide resolved
ywangd
approved these changes
Jun 4, 2025
Member
ywangd
left a comment
There was a problem hiding this comment.
LGTM
I have similar comments of "keeping it as is" for 3 more places. I'd appreciate if you could address them.
server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@ywangd done, let me know what you think. |
Member
|
LGTM thanks 🙏 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.