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

[Extensions] Increased visibility of BaseRestHandler’s unrecognized method using a new public unrecognizedStrings method #7125

Merged
merged 5 commits into from
Apr 12, 2023

Conversation

vibrantvarun
Copy link
Member

@vibrantvarun vibrantvarun commented Apr 12, 2023

Description

BaseRestExtensionHandler in opensearch-sdk needs to use unrecognized method of BaseRestHandler. Therefore to follow DRY principle I have added a new method unrecognizedStrings in BaseRestHandler and then copied the definition of current unrecognized method in it. Then I called unrecognizedString method from unrecognized method.

From BaseRestExtensionHandler I will just call the unrecognizedMethod. This change is done so that if in future there is some change in unrecognized method then it reflects for extensions also.

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.

@owaiskazi19 owaiskazi19 changed the title Modifying the unrecognized method definition in BaseRestHandler [Extensions] Modifying the unrecognized method definition in BaseRestHandler Apr 12, 2023
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

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

Code LGTM. The existing tests for unrecognized() adequately test the new functionality.

I do think this might belong in the change log, though, (BaseRestHandler is @opensearch.api and we are adding functionality), and the PR title should be more clear on just how it modifies the method, e.g., "Makes the BaseRestHandler unrecognized util method public."

@owaiskazi19
Copy link
Member

I do think this might belong in the change log, though, (BaseRestHandler is @opensearch.api and we are adding functionality), and the PR title should be more clear on just how it modifies the method, e.g., "Makes the BaseRestHandler unrecognized util method public."

Makes sense! @vibrantvarun can you make the changes and add it in the CHANGELOG.md?

Signed-off-by: Varun Jain <varunudr@amazon.com>
Signed-off-by: Varun Jain <varunudr@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      2 org.opensearch.remotestore.CreateRemoteIndexTranslogDisabledIT.classMethod
      1 org.opensearch.remotestore.CreateRemoteIndexClusterDefaultDocRep.classMethod

@codecov-commenter
Copy link

codecov-commenter commented Apr 12, 2023

Codecov Report

Merging #7125 (bc6eaa3) into main (169e237) will increase coverage by 0.04%.
The diff coverage is 100.00%.

❗ Current head bc6eaa3 differs from pull request most recent head b63eaec. Consider uploading reports for the commit b63eaec to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #7125      +/-   ##
============================================
+ Coverage     70.58%   70.62%   +0.04%     
+ Complexity    59410    59393      -17     
============================================
  Files          4852     4852              
  Lines        285167   285168       +1     
  Branches      41116    41116              
============================================
+ Hits         201277   201401     +124     
+ Misses        67353    67178     -175     
- Partials      16537    16589      +52     
Impacted Files Coverage Δ
...main/java/org/opensearch/rest/BaseRestHandler.java 73.41% <100.00%> (+0.34%) ⬆️

... and 486 files with indirect coverage changes

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

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.remotestore.CreateRemoteIndexIT.testDefaultRemoteStoreNoUserOverride
      1 org.opensearch.remotestore.CreateRemoteIndexIT.classMethod

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      2 org.opensearch.cluster.service.MasterServiceTests.classMethod
      1 org.opensearch.indices.replication.SegmentReplicationIT.testScrollCreatedOnReplica
      1 org.opensearch.cluster.service.MasterServiceTests.testThrottlingForMultipleTaskTypes
      1 org.opensearch.action.admin.cluster.node.tasks.ResourceAwareTasksTests.testTaskResourceTrackingDuringTaskCancellation

Signed-off-by: Varun Jain <varunudr@amazon.com>
Signed-off-by: Varun Jain <varunudr@amazon.com>
Signed-off-by: Varun Jain <varunudr@amazon.com>
@owaiskazi19 owaiskazi19 changed the title [Extensions] Modifying the unrecognized method definition in BaseRestHandler [Extensions] Increased visibility of BaseRestHandler’s unrecognized method using a new public unrecognizedStrings method Apr 12, 2023
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.remotestore.CreateRemoteIndexIT.classMethod
      1 org.opensearch.remotestore.CreateRemoteIndexClusterDefaultDocRep.classMethod
      1 org.opensearch.indices.replication.SegmentReplicationIT.testScrollCreatedOnReplica
      1 org.opensearch.indices.replication.SegmentReplicationIT.testPitCreatedOnReplica

@ryanbogan
Copy link
Member

Typically we don't have changelog entries for extensions work, since we haven't released it yet. Is there a reason that this is different?

@andrross
Copy link
Member

Typically we don't have changelog entries for extensions work, since we haven't released it yet. Is there a reason that this is different?

This is a change to an existing (public) API. There's nothing extensions-specific here.

@vibrantvarun
Copy link
Member Author

vibrantvarun commented Apr 12, 2023

This work is just not related to extensions only. It covers the common change for plugins and extensions.
cc: @ryanbogan

@owaiskazi19
Copy link
Member

Typically we don't have changelog entries for extensions work, since we haven't released it yet. Is there a reason that this is different?

We do have changelog entries for extensions too. For ex: (6033 and 6275) here. Entries signifies the changes going in the release.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.remotestore.CreateRemoteIndexTranslogDisabledIT.classMethod
      1 org.opensearch.cluster.allocation.AwarenessAllocationIT.testThreeZoneOneReplicaWithForceZoneValueAndLoadAwareness

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.cluster.routing.allocation.decider.DiskThresholdDeciderIT.testIndexCreateBlockIsRemovedWhenAnyNodesNotExceedHighWatermarkWithAutoReleaseEnabled

@owaiskazi19 owaiskazi19 added the backport 2.x Backport to 2.x branch label Apr 12, 2023
@owaiskazi19 owaiskazi19 merged commit 9453ca3 into opensearch-project:main Apr 12, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

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

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.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-7125-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9453ca3906e6a2163051208b6dd011e0e0ddfc9e
# Push it to GitHub
git push --set-upstream origin backport/backport-7125-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-7125-to-2.x.

owaiskazi19 pushed a commit that referenced this pull request Apr 12, 2023
…d` method using a new public `unrecognizedStrings` method. (#7133)

* [Extensions] Increased visibility of BaseRestHandler’s `unrecognized` method using a new public `unrecognizedStrings` method (#7125)

* Adding Changelog

Signed-off-by: Varun Jain <varunudr@amazon.com>

* Adding Javadoc

Signed-off-by: Varun Jain <varunudr@amazon.com>

* Modifying the Changelog

Signed-off-by: Varun Jain <varunudr@amazon.com>

* Modifying the Changelog

Signed-off-by: Varun Jain <varunudr@amazon.com>

* Modifying the Changelog

Signed-off-by: Varun Jain <varunudr@amazon.com>

---------

Signed-off-by: Varun Jain <varunudr@amazon.com>
(cherry picked from commit 9453ca3)

* Update CHANGELOG.md

Signed-off-by: Varun Jain <varunudr@amazon.com>

---------

Signed-off-by: Varun Jain <varunudr@amazon.com>
austintlee pushed a commit to austintlee/OpenSearch that referenced this pull request Apr 28, 2023
… method using a new public `unrecognizedStrings` method (opensearch-project#7125)

* Adding Changelog

Signed-off-by: Varun Jain <varunudr@amazon.com>

* Adding Javadoc

Signed-off-by: Varun Jain <varunudr@amazon.com>

* Modifying the Changelog

Signed-off-by: Varun Jain <varunudr@amazon.com>

* Modifying the Changelog

Signed-off-by: Varun Jain <varunudr@amazon.com>

* Modifying the Changelog

Signed-off-by: Varun Jain <varunudr@amazon.com>

---------

Signed-off-by: Varun Jain <varunudr@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants