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

[Backport 2.x] [Extensions] Add DynamicActionRegistry to ActionModule #6829

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 9febe10 from #6734.

* Add dynamic action registry to ActionModule

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Update registration of transport actions

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Generate transport actions dynamically

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Refactor to combine registry internals

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Finally figured out the generics (or lack thereof)

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* ExtensionProxyAction is dead! Long live ExtensionAction!

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Simplify ExtensionTransportActionHandler, fix compile issues

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Maybe tests will pass with this commit

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* I guess you can't use null as a key in a map

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Lazy test setup, but this should finally work

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add Tests

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Fix TransportActionRequestFromExtension inheritance

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Fix return type for transport actions from extensions

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Fix ParametersInWrongOrderError and add some preemptive null handling

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* NPE is not expected result if params are in correct order

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Remove redundant class and string parsing, add success boolean

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Last fix of params out of order. Working test case!

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Code worked, tests didn't. This is finally done (I think)

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add more detail to comments on immutable vs. dynamic maps

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add StreamInput getter to ExtensionActionResponse

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Generalize dynamic action registration

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Comment and naming fixes

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Register method renaming

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add generic type parameters

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Improve/simplify which parameter types get passed

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Revert removal of ProxyAction and changes to transport and requests

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Wrap ExtensionTransportResponse in a class denoting success

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Remove generic types as they are incompatible with Guice injection

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Fix response handling, it works (again)

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Fix up comments and remove debug logging

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
(cherry picked from commit 9febe10)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT.test {p0=pit/10_basic/Delete all}

@codecov-commenter
Copy link

Codecov Report

Merging #6829 (72585c2) into 2.x (b33f735) will decrease coverage by 0.02%.
The diff coverage is 51.35%.

📣 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              @@
##                2.x    #6829      +/-   ##
============================================
- Coverage     70.50%   70.48%   -0.02%     
- Complexity    59453    59477      +24     
============================================
  Files          4806     4808       +2     
  Lines        285299   285404     +105     
  Branches      41478    41489      +11     
============================================
+ Hits         201141   201163      +22     
- Misses        67346    67454     +108     
+ Partials      16812    16787      -25     
Impacted Files Coverage Δ
...tensions/action/ExtensionProxyTransportAction.java 0.00% <0.00%> (ø)
...nsions/action/RegisterTransportActionsRequest.java 85.00% <ø> (ø)
...ns/action/TransportActionRequestFromExtension.java 66.66% <0.00%> (-2.57%) ⬇️
...ava/org/opensearch/test/client/NoOpNodeClient.java 27.77% <ø> (ø)
...sions/action/ExtensionTransportActionsHandler.java 36.29% <31.25%> (-19.96%) ⬇️
...ch/extensions/action/ExtensionTransportAction.java 37.50% <50.00%> (+37.50%) ⬆️
.../opensearch/extensions/action/ExtensionAction.java 53.84% <53.84%> (ø)
...in/java/org/opensearch/client/node/NodeClient.java 71.42% <66.66%> (ø)
...a/org/opensearch/extensions/ExtensionsManager.java 45.28% <66.66%> (-0.17%) ⬇️
...tensions/action/RemoteExtensionActionResponse.java 71.42% <71.42%> (ø)
... and 2 more

... and 471 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.

@saratvemulapalli saratvemulapalli merged commit ac79a63 into 2.x Mar 28, 2023
@github-actions github-actions bot deleted the backport/backport-6734-to-2.x branch March 28, 2023 23:14
Rishikesh1159 added a commit to Rishikesh1159/OpenSearch that referenced this pull request Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants