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

Ensure that artifact url is valid for Windows dist manifest #4508

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/assemble_workflow/bundle_url_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ def __init__(self, path: str, filename: str, distribution: str) -> None:

def join(self, *args: str) -> str:
sub_path = "/".join(args)
return urljoin(self.path + "/", sub_path)

# Make sure \ is replaced with / for valid url
# We will only make change here as the location can be either local or url
# Thus keep \ if it is a local path
return urljoin(self.path + "/", sub_path.replace("\\", "/"))
13 changes: 13 additions & 0 deletions tests/tests_assemble_workflow/test_bundle_url_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,16 @@ def test_opensearch_dashboards(self) -> None:
location.get_build_location("sql"),
"https://ci.opensearch.org/ci/dbc/bundle-build/1.3.0/1318/linux/x64/tar/builds/opensearch-dashboards/sql"
)

def test_opensearch_windows(self) -> None:
location = BundleUrlLocation("https://ci.opensearch.org/ci/dbc/bundle-build/1.3.0/1318/windows/x64", "opensearch", "plugins\\zip")

self.assertEqual(
location.get_bundle_location("sql"),
"https://ci.opensearch.org/ci/dbc/bundle-build/1.3.0/1318/windows/x64/plugins/zip/dist/opensearch/sql"
)

self.assertEqual(
location.get_build_location("sql"),
"https://ci.opensearch.org/ci/dbc/bundle-build/1.3.0/1318/windows/x64/plugins/zip/builds/opensearch/sql"
)
Loading