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

Added extension Points, initial REST implementation and registering Transport Actions for extensions #5518

Conversation

ryanbogan
Copy link
Member

@ryanbogan ryanbogan commented Dec 12, 2022

Signed-off-by: Ryan Bogan rbogan@amazon.com

Description

This PR merges the second batch of feature/extensions into main and will then be backported to 2.x. It adds extension points, initial REST implementation, and registering Transport Actions for extensions.

Issues Resolved

Issue with links to PR's included in this merge: #5271
Meta issue for entire feature/extensions merge: #5263

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.

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@ryanbogan
Copy link
Member Author

@dblock @reta Can you take a look at this when you get a chance?

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Explain in the PR what it actually brings in in much more level of detail, please. "Second batch" is not very clear :)

Are we going to backport this to 2.x? Should we be adding the CHANGELOG in the 2.x section?

CHANGELOG.md Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@ryanbogan
Copy link
Member Author

Are we going to backport this to 2.x? Should we be adding the CHANGELOG in the 2.x section?

@dblock What is the difference between the Unreleased 2.x section on main branch and the Added section on the CHANGELOG file for 2.x branch?

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@saratvemulapalli
Copy link
Member

@reta would love your thoughts as well on this PR.

@dblock
Copy link
Member

dblock commented Dec 15, 2022

Are we going to backport this to 2.x? Should we be adding the CHANGELOG in the 2.x section?

@dblock What is the difference between the Unreleased 2.x section on main branch and the Added section on the CHANGELOG file for 2.x branch?

There shouldn't be AFAIK, but now I am confused too @kotwanikunal?

…O comments

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@ryanbogan ryanbogan requested a review from reta December 15, 2022 22:00
@ryanbogan
Copy link
Member Author

@reta I addressed your requested changes by removing the NamedWriteableRegistry extension implementation, which we will design differently in the future, but do not need right now. The PR is now ready for your review again.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@saratvemulapalli
Copy link
Member

@reta I addressed your requested changes by removing the NamedWriteableRegistry extension implementation, which we will design differently in the future, but do not need right now. The PR is now ready for your review again.

@ryanbogan if we think its not the right implementation, lets go open up an issue and also help us understand why this is not right?

*
* @opensearch.internal
*/
public class ExtensionBooleanResponse extends TransportResponse {
Copy link
Collaborator

@reta reta Dec 16, 2022

Choose a reason for hiding this comment

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

It is yet another variation if .opensearch.index.AcknowledgedResponse (I see it is removed), org.opensearch.action.support.master.AcknowledgedResponse ? May be we could (re)use the same pattern? Because ExtensionBooleanResponse is not saying anything about what its usage is. At least with acknowledged it reads as "request was accepted".

@ryanbogan
Copy link
Member Author

@reta I addressed your requested changes by removing the NamedWriteableRegistry extension implementation, which we will design differently in the future, but do not need right now. The PR is now ready for your review again.

@ryanbogan if we think its not the right implementation, lets go open up an issue and also help us understand why this is not right?

opensearch-project/opensearch-sdk-java#291

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@ryanbogan ryanbogan requested a review from reta December 16, 2022 17:55
@ryanbogan
Copy link
Member Author

@reta ready for your review again. Thanks for all the feedback!

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #5518 (563f760) into main (cb26035) will decrease coverage by 0.07%.
The diff coverage is 53.35%.

@@             Coverage Diff              @@
##               main    opensearch-project/OpenSearch#5518      +/-   ##
============================================
- Coverage     70.95%   70.88%   -0.08%     
- Complexity    58304    58316      +12     
============================================
  Files          4733     4741       +8     
  Lines        278256   278492     +236     
  Branches      40249    40262      +13     
============================================
- Hits         197441   197407      -34     
- Misses        64628    64973     +345     
+ Partials      16187    16112      -75     
Impacted Files Coverage Δ
...ensearch/discovery/InitializeExtensionRequest.java 0.00% <0.00%> (ø)
...nsearch/discovery/InitializeExtensionResponse.java 0.00% <0.00%> (ø)
...rg/opensearch/extensions/AcknowledgedResponse.java 0.00% <0.00%> (ø)
...a/org/opensearch/extensions/OpenSearchRequest.java 0.00% <0.00%> (ø)
...rch/extensions/rest/RestSendToExtensionAction.java 27.77% <27.77%> (ø)
...a/org/opensearch/extensions/ExtensionsManager.java 60.75% <56.89%> (-2.28%) ⬇️
...extensions/rest/RestExecuteOnExtensionRequest.java 65.21% <65.21%> (ø)
...ch/extensions/rest/RegisterRestActionsRequest.java 70.00% <70.00%> (ø)
...ch/extensions/RegisterTransportActionsRequest.java 86.20% <86.20%> (ø)
...h/extensions/rest/RegisterRestActionsResponse.java 100.00% <100.00%> (ø)
... and 488 more

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

*
* @opensearch.internal
*/
public class AcknowledgedResponse extends TransportResponse {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 thanks @ryanbogan !

);
// TODO: make asynchronous
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I remember we discussed that before, this TODO: make asynchronous for this pull request or there is issue / pull request to follow up?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@reta reta left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @ryanbogan

@owaiskazi19 owaiskazi19 merged commit 0f520f6 into opensearch-project:main Dec 16, 2022
@ryanbogan ryanbogan added the backport 2.x Backport to 2.x branch label Dec 16, 2022
@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-5518-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0f520f6ffe356f51584b8ed9dcec0f0ec24ef989
# Push it to GitHub
git push --set-upstream origin backport/backport-5518-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-5518-to-2.x.

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