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

Don't escape colons in qualifier values #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

melotic
Copy link

@melotic melotic commented Jun 2, 2023

When adding a URL as a qualifier value, I was noticing that the URL's colons would be escaped. They should not be escaped.

@am11
Copy link
Collaborator

am11 commented Jun 5, 2023

Looks good. BTW, python implementation (https://github.com/package-url/packageurl-python) is most up-to-date and it also fails this test: valid go purl with slash in name, namespace, version and qualifier

self = <test_packageurl.PurlTest testMethod=test_purl_pkg_valid_go_purl_with_slash_in_name_namespace_version_and_qualifier>

    def test_purl(self):
        # parsing the test canonical `purl` then re-building a `purl` from these
        # parsed components should return the test canonical `purl`
        cano = PackageURL.from_string(purl)
>       assert canonical_purl == cano.to_string()
E       AssertionError: assert 'pkg:golang/g...source.com/go' == 'pkg:golang/g...source.com/go'
E         - pkg:golang/google.golang.org/repo/gen/proto@abc/dedf?repository_url=go.googlesource.com/go
E         ?                                      ^         ^
E         + pkg:golang/google.golang.org/repo/gen%2Fproto@abc%2Fdedf?repository_url=go.googlesource.com/go
E         ?                                      ^^^         ^^^

tests/test_packageurl.py:82: AssertionError

Do you want to take a crack it?

Testing both ways (placing packageurl-dotnet test file in python repo and vice-versa) would be good for conformance purposes. (note to self: we can set it up in the CI to keep the implementations synchronized)

@melotic
Copy link
Author

melotic commented Jun 21, 2023

@am11 I've raised a PR here to sync and fix the tests: package-url/packageurl-python#123

@melotic
Copy link
Author

melotic commented Jul 18, 2023

Hi @am11, any updates?

@JamieMagee
Copy link

@ThomasPiskol is it possible to review this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants