Skip to content

[Feature/extensions] Handle named wildcards (REST path parameters)#4415

Merged
owaiskazi19 merged 1 commit intoopensearch-project:feature/extensionsfrom
dbwiddis:namedWildcard
Sep 9, 2022
Merged

[Feature/extensions] Handle named wildcards (REST path parameters)#4415
owaiskazi19 merged 1 commit intoopensearch-project:feature/extensionsfrom
dbwiddis:namedWildcard

Conversation

@dbwiddis
Copy link
Copy Markdown
Member

@dbwiddis dbwiddis commented Sep 6, 2022

Companion PR: opensearch-project/opensearch-sdk-java#123

Description

Adds the ability to handle REST path parameters (named wildcards). Most changes are on the SDK repo. However, it is necessary (see Javadoc) for the prepareRequest() method to indicate which parameters were consumed. If the user provides too many parameters, they receive an error.

In local/plugin operation, simply fetching the parameter via param(key) consumes it. Since the parameters are being consumed remotely, this requires communicating the list of consumed parameters, which is done in the response header (normally unused and provided for purposes such as this!)

Issues Resolved

Fixes SDK #122

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

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 6, 2022

Gradle Check (Jenkins) Run Completed with:

Copy link
Copy Markdown
Member

@saratvemulapalli saratvemulapalli left a comment

Choose a reason for hiding this comment

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

Thanks @dbwiddis for the change.
Is there a way to unit test this?

@dbwiddis
Copy link
Copy Markdown
Member Author

dbwiddis commented Sep 7, 2022

Is there a way to unit test this?

@saratvemulapalli Not really as it relies on communications from the extension. I hope to cover it as part of my integration test issue #120.

Also, I think while this works for the "happy path" I think (but am not sure) that we need special handling for the timeout case and the exception case. I'll handle that as part of the IT work as well. Also full completion of this work is somewhat dependent on #111 being complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 7, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 8, 2022

Gradle Check (Jenkins) Run Completed with:

  • RESULT: null ❌
  • URL: null
  • CommitID: 79c8676

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 8, 2022

Gradle Check (Jenkins) Run Completed with:

  • RESULT: null ❌
  • URL: null
  • CommitID: 79c8676

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 9, 2022

Gradle Check (Jenkins) Run Completed with:

@owaiskazi19
Copy link
Copy Markdown
Member

@dbwiddis looks like we have to rebase feature/extensions with main first and then rebase your branch with the latest feature/extensions

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':distribution:bwc:bugfix:buildBwcLinuxTar'.
> Building 2.2.1 didn't generate expected file /var/jenkins/workspace/gradle-check/search/distribution/bwc/bugfix/build/bwc/checkout-2.2/distribution/archives/linux-tar/build/distributions/opensearch-min-2.2.1-SNAPSHOT-linux-x64.tar.gz

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':distribution:bwc:minor:buildBwcLinuxTar'.
> Building 2.3.0 didn't generate expected file /var/jenkins/workspace/gradle-check/search/distribution/bwc/minor/build/bwc/checkout-2.x/distribution/archives/linux-tar/build/distributions/opensearch-min-2.3.0-SNAPSHOT-linux-x64.tar.gz

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
==============================================================================

Signed-off-by: Daniel Widdis <widdis@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 9, 2022

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 9, 2022

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.51%. Comparing base (14b899b) to head (2a49d5a).
⚠️ Report is 296 commits behind head on feature/extensions.

Files with missing lines Patch % Lines
...rch/extensions/rest/RestSendToExtensionAction.java 0.00% 9 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##             feature/extensions    #4415      +/-   ##
========================================================
- Coverage                 70.61%   70.51%   -0.11%     
+ Complexity                57436    57361      -75     
========================================================
  Files                      4641     4641              
  Lines                    276249   276257       +8     
  Branches                  40384    40386       +2     
========================================================
- Hits                     195083   194796     -287     
- Misses                    64847    65117     +270     
- Partials                  16319    16344      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants