[Extensions] Adding versioning support for registering Rest actions#7302
Conversation
Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
|
Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
|
Looks good, but I expected some tests to have to change as well. |
dbwiddis
left a comment
There was a problem hiding this comment.
LGTM but left a comment about future-proofing for a known feature request that we should consider doing.
| .setIdentity(identity) | ||
| .addAllRestActions(restActions) | ||
| .addAllDeprecatedRestActions(deprecatedRestActions) | ||
| .build(); |
There was a problem hiding this comment.
I haven't had time to follow up with a thorough design, but I think there may need to be one more bit of information passed from the extension here, and it would be nice to do it with this PR rather than a separate one.
It relates to SDK #355 and replaced/deprecated routes. Basically:
- we want the deprecated routes coming from the extensions to be verbatim (with
/_pluginprefix) without making any changes on OpenSearch side (but with possible exception handling if the plugin is installed and the prefix is already taken, per the linked issue) - we want active/new routes coming from the extension to use the uniqueId and
/_extensionprefix but also possibly register with a/_pluginprefix, per the linked issue.
So we may want to actually include some sort of "prefix" string.
This may be exactly what you are doing with ExtensionIdentity but I'm thinking perhaps that may need a second string argument.
Sorry this isn't fully thought out, but perhaps something we should all agree on (and possibly implement SDK #355 shortly after this).
There was a problem hiding this comment.
(To be clear, my suggestion is to add a second string field to Identity, so it would have a uniqueID and a prefix.)
There was a problem hiding this comment.
Had a chat with @dbwiddis, we'll add a new bool in a different PR to solve it.
Will try to get this PR merged as the framework.
Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
📣 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 #7302 +/- ##
============================================
+ Coverage 70.56% 70.69% +0.13%
- Complexity 59547 59594 +47
============================================
Files 4876 4876
Lines 285813 285816 +3
Branches 41162 41162
============================================
+ Hits 201686 202065 +379
+ Misses 67519 67122 -397
- Partials 16608 16629 +21
|
Thanks for the review. Added few tests. Could you take a look again @dblock |
Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
|
The backport to 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-7302-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 7c3c411becfea1933f93bfce4e411c189757a06e
# Push it to GitHub
git push --set-upstream origin backport/backport-7302-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.xThen, create a pull request where the |
…pensearch-project#7302) Add cross version support for register Rest Actions for extensions Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
|
@saratvemulapalli I just pulled this commit into my local workspace and I faced a compile error for missing classes. |
My bad, absolutely. I'll send out a PR. |
Strange. I was trying to run a test directly on IntelliJ and it did not auto compile. |
…pensearch-project#7302) Add cross version support for register Rest Actions for extensions Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
Moving RestActions request to Protobuf to support cross version compatibility.
Also this PR adds
ExtensionIdentityas an abstract data container for Identity of extension.In the follow up PR's I'll move over all places where
uniqueIdto useExtensionIdentity.Issues Resolved
Part of #7402
Also moves the needle for opensearch-project/opensearch-sdk-java#702
Check List
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.