Skip to content

Commit

Permalink
Ensure that artifact url is valid for Windows dist manifest (#4508)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon authored Mar 6, 2024
1 parent 56d45a3 commit a531030
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
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"
)

0 comments on commit a531030

Please sign in to comment.