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

Fix manifest file escaping in URLs #4660

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

Swiddis
Copy link
Contributor

@Swiddis Swiddis commented Apr 25, 2024

Description

Adds a reproducer test for #4656 based on my best understanding of the inputs that led to the bug, and updates the code to fix it with more robust join logic. Some other whitespace updates got mangled in due to autoformatting, can filter them back out if necessary.

A cleaner alternative may be to go back to using os.path.join and replacing \\ with /, but could still run into issues if the input strings already have backslashes. urllib.parse.urljoin frustratingly does not actually join URLs (it cuts away path components), so as far as I can tell using .strip('/') everywhere is the best way to merge URLs.

Issues Resolved

Resolves #4656

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: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.03%. Comparing base (46f773e) to head (6ca1963).
Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4660      +/-   ##
==========================================
- Coverage   92.40%   92.03%   -0.37%     
==========================================
  Files         193      193              
  Lines        6317     6350      +33     
==========================================
+ Hits         5837     5844       +7     
- Misses        480      506      +26     

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

Copy link
Member

@zelinh zelinh left a comment

Choose a reason for hiding this comment

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

LGTM.

@zelinh zelinh merged commit 4aa051e into opensearch-project:main Apr 30, 2024
12 checks passed
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.

[Bug]: Test result files are over-escaped in manifests now
2 participants