Repository navigation
Treat Docker Hub's library namespace as implicit in ComparisonForm - #72
Open
charlie-morrison wants to merge 1 commit into
Open
charlie-morrison wants to merge 1 commit into
charlie-morrison wants to merge 1 commit into
Conversation
Docker Hub official images live under an implicit "library" namespace, so pkg:docker/python and pkg:docker/library/python name one image but had different comparison forms. ComparisonForm now drops a "library" namespace for docker purls with no repository_url qualifier. With a repository_url the image is on another registry, where the rule does not apply, so the namespace stays. Fixes git-pkgs#70 Co-authored-by: Claude <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #70.
ComparisonFormnow has a docker rule. Alibrarynamespace is dropped when the purl has norepository_urlqualifier, sopkg:docker/python@3.12andpkg:docker/library/python@3.12both compare aspkg:docker/python@3.12. With arepository_urlthe image is on another registry, where Docker Hub's implicit namespace doesn't apply, so the namespace stays.ParseandStringare unchanged, and the doc comment lists the new rule next to the others.What I left alone: other namespaces (
bitnami/python), a nestedlibrary/library/python, and arepository_urlthat points at Docker Hub itself (docker.io). That last one compares differently from a bare purl anyway, because the qualifier is part of the form.Tests:
TestComparisonFormhas six docker rows: with and withoutlibrary, a digest version with a qualifier, arepository_url, another namespace, and the nested case. The two rows that should loselibraryfail on main.TestComparisonFormEquivalentSpellingshas the issue's pair, andTestComparisonFormLeavesParseAlonechecks thatString()still keepslibrary/.library, and ignoringrepository_url.go test ./...(withtestdata/purl-specat the pinned commit),go vet,gofmtandgolangci-lint(0 issues) are clean.