-
Notifications
You must be signed in to change notification settings - Fork 382
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 channel
and base_url
in list
cmd
#3488
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1231,9 +1231,8 @@ def test_create_from_oci_mirrored_channels(tmp_home, tmp_root_prefix, tmp_path, | |
assert pkg["name"] == "pandoc" | ||
if spec == "pandoc=3.1.13": | ||
assert pkg["version"] == "3.1.13" | ||
assert pkg["base_url"].startswith( | ||
"https://pkg-containers.githubusercontent.com/ghcr1/blobs/pandoc" | ||
) | ||
assert pkg["base_url"] == "https://pkg-containers.githubusercontent.com/ghcr1/blobs" | ||
assert pkg["channel"] == "https://pkg-containers.githubusercontent.com/ghcr1/blobs" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could set this to something else like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah let's fix the bugs for now;, and figure out what to do for OCI in a dedicated PR. |
||
|
||
|
||
@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True) | ||
|
@@ -1261,16 +1260,14 @@ def test_create_from_oci_mirrored_channels_with_deps(tmp_home, tmp_root_prefix, | |
assert len(packages) > 2 | ||
assert any( | ||
package["name"] == "xtensor" | ||
and package["base_url"].startswith( | ||
"https://pkg-containers.githubusercontent.com/ghcr1/blobs/xtensor" | ||
) | ||
and package["base_url"] == "https://pkg-containers.githubusercontent.com/ghcr1/blobs" | ||
and package["channel"] == "https://pkg-containers.githubusercontent.com/ghcr1/blobs" | ||
for package in packages | ||
) | ||
assert any( | ||
package["name"] == "xtl" | ||
and package["base_url"].startswith( | ||
"https://pkg-containers.githubusercontent.com/ghcr1/blobs/xtl" | ||
) | ||
and package["base_url"] == "https://pkg-containers.githubusercontent.com/ghcr1/blobs" | ||
and package["channel"] == "https://pkg-containers.githubusercontent.com/ghcr1/blobs" | ||
for package in packages | ||
) | ||
|
||
|
@@ -1304,9 +1301,8 @@ def test_create_from_oci_mirrored_channels_pkg_name_mapping( | |
assert len(packages) == 1 | ||
pkg = packages[0] | ||
assert pkg["name"] == "_go_select" | ||
assert pkg["base_url"].startswith( | ||
"https://pkg-containers.githubusercontent.com/ghcr1/blobs/_go_select" | ||
) | ||
assert pkg["base_url"] == "https://pkg-containers.githubusercontent.com/ghcr1/blobs" | ||
assert pkg["channel"] == "https://pkg-containers.githubusercontent.com/ghcr1/blobs" | ||
|
||
|
||
@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure to understand why
util::rstrip
leads to UB. Is it still the case if you assign its result to astd::string
?Anyway, if we keep this implementation, we should open an issue to try to fix the UB and use a single implementation of rstrip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, since we use it recursively, it will imply doing a lot
std::string
conversions?Not sure if doing this is cleaner than just having a string version for
rstrip
?Anyway, I agree that we should definitely reevaluate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant using the funciton degined in
util::string
and assign the final result of the recursive call to a string. The function returns temporary string_view passed by copies, so there hsould not be any dangling temporary issues.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well doing:
instead of using the reimplemented
rstrip
instrip_from_filename_and_platform
definitely leads to UB, if that's what you meant.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep that's what I meant :( OK let's merge as is and open an issue to fix that UB later