Skip to content
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

[2.x] Restore using the class ClusterInfoRequest and ClusterInfoRequestBuilder from package 'org.opensearch.action.support.master.info' for subclasses (#4307) #4324

Merged
merged 2 commits into from
Aug 30, 2022

Conversation

tlfeng
Copy link
Collaborator

@tlfeng tlfeng commented Aug 29, 2022

Description

Backport PR #4307 / commit 65f966e into 2.x branch

  • Restore the inheritance relationship of the class GetIndexRequest and GetMappingsRequest, to extend org.opensearch.action.support.master.info.ClusterInfoRequest. The 2 classes are the only subclasses of ClusterInfoRequest in other packages.
  • Add a unit test to validate the return type for the method GetIndexRequest#indices(java.lang.String[]) is an instance of org.opensearch.action.support.master.info.ClusterInfoRequest.

Issues Resolved

#4203

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Tianli Feng and others added 2 commits August 29, 2022 10:09
…der from package 'org.opensearch.action.support.master.info' for subclasses (opensearch-project#4307)

* Restore using the class ClusterInfoRequest and ClusterInfoRequestBuilder from package 'org.opensearch.action.support.master.info' for subclasses

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Add changelog

Signed-off-by: Tianli Feng <ftianli@amazon.com>

Signed-off-by: Tianli Feng <ftianli@amazon.com>
Co-authored-by: Andrew Ross <andrross@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
@tlfeng tlfeng requested review from a team and reta as code owners August 29, 2022 17:20
@tlfeng tlfeng changed the title Restore using the class ClusterInfoRequest and ClusterInfoRequestBuilder from package 'org.opensearch.action.support.master.info' for subclasses (#4307) [2.x] Restore using the class ClusterInfoRequest and ClusterInfoRequestBuilder from package 'org.opensearch.action.support.master.info' for subclasses (#4307) Aug 29, 2022
@tlfeng tlfeng added bug Something isn't working backport PRs or issues specific to backporting features or enhancments backwards-compatibility backport 2.2 Backport to 2.2 branch labels Aug 29, 2022
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #4324 (78d9051) into 2.x (38372e1) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                2.x    #4324      +/-   ##
============================================
- Coverage     70.61%   70.58%   -0.03%     
+ Complexity    56935    56919      -16     
============================================
  Files          4571     4571              
  Lines        273530   273530              
  Branches      40111    40111              
============================================
- Hits         193147   193078      -69     
- Misses        64195    64302     +107     
+ Partials      16188    16150      -38     
Impacted Files Coverage Δ
...arch/action/admin/indices/get/GetIndexRequest.java 55.31% <ø> (ø)
...tion/admin/indices/get/GetIndexRequestBuilder.java 66.66% <ø> (ø)
.../admin/indices/mapping/get/GetMappingsRequest.java 50.00% <ø> (ø)
...indices/mapping/get/GetMappingsRequestBuilder.java 100.00% <ø> (ø)
...opensearch/index/mapper/MockFieldFilterPlugin.java 0.00% <0.00%> (-100.00%) ⬇️
...adcast/BroadcastShardOperationFailedException.java 33.33% <0.00%> (-66.67%) ⬇️
.../java/org/opensearch/node/NodeClosedException.java 50.00% <0.00%> (-50.00%) ⬇️
...cluster/coordination/PendingClusterStateStats.java 20.00% <0.00%> (-48.00%) ⬇️
...h/action/ingest/SimulateDocumentVerboseResult.java 60.71% <0.00%> (-39.29%) ⬇️
...cluster/coordination/PublishClusterStateStats.java 33.33% <0.00%> (-37.51%) ⬇️
... and 487 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dblock
Copy link
Member

dblock commented Aug 29, 2022

How does this work for deprecation? I mean can I write code that takes a dependency on the cluster manager types without ever hitting this?

@tlfeng
Copy link
Collaborator Author

tlfeng commented Aug 30, 2022

@dblock That’s a good question. 😄 I think developers can totally use the classes with name cluster manager to replace the classes with master, for the classes related to this PR.

Class ClusterInfoRequest in master package is a subclass of the same-name class in clustermanager package. If an object type is o.o.action.support.master.info.ClusterInfoRequest, it’s also belongs to o.o.action.support.clustermanager.info.ClusterInfoRequest.

@dblock dblock merged commit 7a0ee08 into opensearch-project:2.x Aug 30, 2022
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.2 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.2 2.2
# Navigate to the new working tree
cd .worktrees/backport-2.2
# Create a new branch
git switch --create backport/backport-4324-to-2.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 7a0ee0859f802b7eaf4352ca53124a7a465367b9
# Push it to GitHub
git push --set-upstream origin backport/backport-4324-to-2.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.2

Then, create a pull request where the base branch is 2.2 and the compare/head branch is backport/backport-4324-to-2.2.

@tlfeng tlfeng removed the backport 2.2 Backport to 2.2 branch label Aug 30, 2022
@tlfeng
Copy link
Collaborator Author

tlfeng commented Aug 30, 2022

@dblock Thanks for your review! 👏

@tlfeng tlfeng deleted the 2.x-fix-ClusterInfoRequest-bwc branch August 30, 2022 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport PRs or issues specific to backporting features or enhancments backwards-compatibility bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants