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

Use GitHub API to list images #75

Merged
merged 1 commit into from
Feb 9, 2024
Merged

Conversation

twz123
Copy link
Member

@twz123 twz123 commented Dec 20, 2023

The previous solution required a full checkout of the repo in order to determine which images had changed. There was a subtle bug in there, as the checkout was not done with full depth. Only the most recent commit was fetched. This led to situations where the image list generation failed with "bad object" errors.

There's a more straightforward approach using the GitHub API and the gh CLI. It allows for easy fetching of diffs and massaging them via jq queries. The same can be done to get the file list of a repository, eliminating the need for a checkout in both cases.

The previous solution required a full checkout of the repo in order to
determine which images had changed. There was a subtle bug in there, as
the checkout was not done with full depth. Only the most recent commit
was fetched. This led to situations where the image list generation
failed with "bad object" errors.

There's a more straightforward approach using the GitHub API and the
gh CLI. It allows for easy fetching of diffs and massaging them via
jq queries. The same can be done to get the file list of a repository,
eliminating the need for a checkout in both cases.

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
@kke kke merged commit 781d1c2 into k0sproject:main Feb 9, 2024
1 check passed
@twz123 twz123 deleted the gh-api-image-list branch February 9, 2024 07:50
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.

2 participants