-
Notifications
You must be signed in to change notification settings - Fork 76
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
ghcr.io: List packages based on whether owner is an org or a user #180
Open
ribbybibby
wants to merge
5
commits into
jetstack:main
Choose a base branch
from
ribbybibby:github-packages
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
We were previously using releases to figure out tags for a Github package. I think this was wrong. Not all release tags will be pushed as package versions, and vice versa. Someone may choose to use GHCR without taking advantage of releases at all. I've modified it so that the client will check if the owner is a user or an org and then make the appropriate PackageGetAllVersions function call to retrieve the tags. I've also fixed a few other things I ran into while testing this: 1. Create the github client in `New` so that rate limiting and other goodness is reused across calls. 2. Fix `RepoImageFromPath`, so it will split the repository path into the 'owner' and 'repo' segments that `Tags` expects. Previously we would have got errors for subrepositories. 3. Update `TestRepoImage` to ensure it doesn't panic on unexpected inputs. 4. We don't need to use regex to match `ghcr.io` to `ghcr.io`. 5. If we're excluding `.att` tags then we should probably exclude `.sig` and `.sbom` too.
davidcollom
reviewed
Apr 23, 2024
davidcollom
reviewed
Apr 23, 2024
davidcollom
reviewed
Apr 23, 2024
Appreciate the contextual description at the top of the PR @ribbybibby. I've added issue / thoughts on the existing comments. I think it'd be good to merge and fix for users of ghcr.io. @davidcollom I'll defer to you for approval. My Go isn't good enough to properly review. But from a "this is what the PR tackles" perspective I give it 👍 |
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.
We were previously using releases to figure out tags for a Github package. I think this was wrong. Not all release tags will be pushed as package versions, and vice versa. Someone may choose to use GHCR without taking advantage of releases at all.
I've modified it so that the client will check if the owner is a user or an org and then make the appropriate
PackageGetAllVersions
function call to retrieve the tags.I've also fixed a few other things I ran into while testing this:
New
so that rate limiting and other goodness is reused across calls.RepoImageFromPath
, so it will split the repository path into the 'owner' and 'repo' segments thatTags
expects. Previously we would have got errors for subrepositories.TestRepoImage
to ensure it doesn't panic on unexpected inputs.ghcr.io
toghcr.io
..att
tags then we should probably exclude.sig
and.sbom
too.Fixes #179, #175