ci: verify container image exists before publishing helm chart#2513
Closed
fseldow wants to merge 2 commits into
Closed
ci: verify container image exists before publishing helm chart#2513fseldow wants to merge 2 commits into
fseldow wants to merge 2 commits into
Conversation
Add image existence check to publish-charts.yml and publish-dev-assets.yml workflows. Since publish-charts and publish-package are triggered independently by the same v* tag, the chart could be published before the container image is available. This adds a retry loop (up to 30 minutes) to wait for the image before proceeding with chart publication. Signed-off-by: Xinhe Li <xinhl@microsoft.com>
There was a problem hiding this comment.
Pull request overview
Adds safeguards to prevent Helm charts from being published before their referenced container images are available in GHCR, addressing a release-time race between independent workflows triggered by v* tags.
Changes:
- Added a retrying GHCR image-existence check to
publish-charts.ymlbefore chart publication. - Added a GHCR image-existence verification step to
publish-dev-assets.ymlbefore chart packaging/push.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/publish-charts.yml | Waits (with retry/backoff) for the release image to exist in GHCR before publishing charts. |
| .github/workflows/publish-dev-assets.yml | Verifies dev images are accessible in GHCR before packaging and pushing the dev Helm chart. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+21
to
+25
| - name: Verify container image exists | ||
| run: | | ||
| VERSION=${GITHUB_REF#refs/tags/} | ||
| ORG_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f1) | ||
| IMAGE="ghcr.io/${ORG_NAME}/ratify-gatekeeper-provider:${VERSION}" |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2513 +/- ##
==========================================
- Coverage 77.15% 77.10% -0.05%
==========================================
Files 105 105
Lines 4657 4657
==========================================
- Hits 3593 3591 -2
- Misses 916 917 +1
- Partials 148 149 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xinhe Li <xinhl@microsoft.com>
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.
Description
publish-charts.ymlandpublish-package.ymlare both triggered byv*tags but run as independent workflows. This creates a race condition where the helm chart could be published before the container image is available on GHCR.This PR adds an image existence check:
publish-charts.yml: Adds a retry loop (up to 30 min) that waits forghcr.io/<org>/ratify-gatekeeper-provider:<version>to be available before publishing the chart.publish-dev-assets.yml: Adds a verification step between the image build andhelm pushto confirm all images (crds,base,plugins) are accessible before packaging and pushing the chart.Why
If a user installs the chart immediately after a release, they could hit
ImagePullBackOffbecause the image hasn't finished building/pushing yet. This ensures the chart is only published after the image is confirmed available.Changes
.github/workflows/publish-charts.yml: AddedVerify container image existsstep with retry logic.github/workflows/publish-dev-assets.yml: AddedVerify container images existstep beforehelm package