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

Correct RHLC searchTemplate & mtermVectors endpoints to have leading slash #14465

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

Xtansia
Copy link
Contributor

@Xtansia Xtansia commented Jun 19, 2024

Description

These non-absolute paths (ie. no leading /) are being passed verbatim to the HTTP request which results in a technically invalid request start-line of GET _render/template HTTP/1.1 which should be GET /_render/template HTTP/1.1. OpenSearch itself is lenient and happily serves this request, however in cases of stricter intermediaries such as proxies or load-balances as in Amazon OpenSearch Service, this request ends up denied with a 400 Bad Request.

Ideally this would be solved globally in RestClient (#14423) however this in the minimal easily backportable fix for now.

Related Issues

Relates to #14423

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@Xtansia Xtansia force-pushed the fix/rhlc-render-template-path branch from a85a318 to 1b710de Compare June 19, 2024 23:26
@Xtansia Xtansia added the backport 2.x Backport to 2.x branch label Jun 19, 2024
Copy link
Contributor

❌ Gradle check result for a85a318: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 1b710de: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

…slash

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
@Xtansia Xtansia force-pushed the fix/rhlc-render-template-path branch from 1b710de to 319b5ed Compare June 20, 2024 00:38
Copy link
Contributor

✅ Gradle check result for 319b5ed: SUCCESS

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.75%. Comparing base (b15cb0c) to head (319b5ed).
Report is 463 commits behind head on main.

Current head 319b5ed differs from pull request most recent head a9ae678

Please upload reports for the commit a9ae678 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14465      +/-   ##
============================================
+ Coverage     71.42%   71.75%   +0.33%     
- Complexity    59978    62060    +2082     
============================================
  Files          4985     5118     +133     
  Lines        282275   291976    +9701     
  Branches      40946    42211    +1265     
============================================
+ Hits         201603   209498    +7895     
- Misses        63999    65164    +1165     
- Partials      16673    17314     +641     

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

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
Copy link
Contributor

❕ Gradle check result for a9ae678: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@msfroh msfroh merged commit 9675c4f into opensearch-project:main Jun 20, 2024
50 checks passed
@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:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-14465-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9675c4f6ec0d412993ef361bce44a8b789bff27b
# Push it to GitHub
git push --set-upstream origin backport/backport-14465-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

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

Xtansia added a commit to Xtansia/OpenSearch that referenced this pull request Jun 20, 2024
…slash (opensearch-project#14465)

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
(cherry picked from commit 9675c4f)
reta pushed a commit that referenced this pull request Jun 21, 2024
…slash (#14465) (#14480)

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
(cherry picked from commit 9675c4f)

Signed-off-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
Xtansia added a commit to Xtansia/OpenSearch that referenced this pull request Jun 21, 2024
…slash (opensearch-project#14465) (opensearch-project#14480)

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
(cherry picked from commit 9675c4f)

Signed-off-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
(cherry picked from commit a9d806a)
dblock pushed a commit that referenced this pull request Jun 21, 2024
…slash (#14465) (#14480) (#14487)

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
(cherry picked from commit 9675c4f)

Signed-off-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
(cherry picked from commit a9d806a)
harshavamsi pushed a commit to harshavamsi/OpenSearch that referenced this pull request Jul 12, 2024
kkewwei pushed a commit to kkewwei/OpenSearch that referenced this pull request Jul 24, 2024
…slash (opensearch-project#14465) (opensearch-project#14480)

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
(cherry picked from commit 9675c4f)

Signed-off-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
Signed-off-by: kkewwei <kkewwei@163.com>
wdongyu pushed a commit to wdongyu/OpenSearch that referenced this pull request Aug 22, 2024
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 backport-failed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants