ci: use valid chart version for latest releases#416
Conversation
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR updates the release publishing GitHub Actions workflow so it only runs on version tag pushes, preventing main branch merges from attempting to publish release artifacts and failing Helm packaging due to non-SemVer chart versions.
Changes:
- Restricts the
Build and Push Release Imagesworkflow trigger to tag pushes only (removesmainbranch push trigger). - Separates Docker image tagging (
TAG=vX.Y.Z...) from Helm chart packaging version (CHART_VERSION=X.Y.Z...) by stripping the leadingv. - Updates Helm chart packaging/push steps to use
CHART_VERSIONfor chartversionand.tgzname, while keepingTAGforappVersionand image tags.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #416 +/- ##
===========================================
+ Coverage 47.57% 58.47% +10.90%
===========================================
Files 30 36 +6
Lines 2819 3463 +644
===========================================
+ Hits 1341 2025 +684
+ Misses 1338 1230 -108
- Partials 140 208 +68
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bfbcab9 to
a6c4a82
Compare
| branches: | ||
| - main |
There was a problem hiding this comment.
We should not remove this trigger condition, because the latest image still needs to be uploaded.
There was a problem hiding this comment.
Thanks, agreed. I updated the approach to keep the main push trigger and continue publishing latest images.
The fix now separates the Docker image tag from the Helm chart metadata. On main pushes, images still use TAG=latest, while the chart uses CHART_VERSION=0.0.0 and APP_VERSION=latest. On release tags, the workflow keeps the existing vX.Y.Z values for image tags, chart version, appVersion, package filename, and OCI chart tag.
I also validated the updated workflow with a fork main push: latest images were published, agentcube-0.0.0.tgz was packaged successfully, and ghcr.io/ranxi2001/charts/agentcube:0.0.0 was pushed successfully.
Signed-off-by: ranxi2001 <ranxi169@163.com>
a6c4a82 to
427e618
Compare
| echo "TAG=latest" >> "$GITHUB_ENV" | ||
| echo "CHART_VERSION=0.0.0" >> "$GITHUB_ENV" | ||
| echo "APP_VERSION=latest" >> "$GITHUB_ENV" |
There was a problem hiding this comment.
Thanks for pointing this out. The fixed 0.0.0 version is intentional here: the main branch chart is meant to behave as a stable latest/development chart entry rather than a unique snapshot chart for every run. This avoids accumulating temporary chart versions such as 0.0.0-main.<run_number> in GHCR.
I validated that GHCR accepted the fork main push with agentcube-0.0.0.tgz and ghcr.io/ranxi2001/charts/agentcube:0.0.0. If maintainers prefer immutable per-run snapshot charts for main, I can switch the branch path to a valid prerelease version such as 0.0.0-main.${{ github.run_number }}, while keeping Docker images tagged as latest.
What type of PR is this?
/kind bug
What this PR does / why we need it
This PR fixes the release workflow failure on
mainpushes while keeping latest image publishing enabled.The release workflow uses
TAG=latestformainbranch pushes. That value is valid for Docker image tags, but the workflow also reused it as the Helm chartversion. Helm chart versions must be valid SemVer values, sohelm package --version latestfails withchart.metadata.version "latest" is invalid.This PR separates Docker image tags from Helm chart metadata:
mainpushes, Docker images still useTAG=latest, while the Helm chart usesCHART_VERSION=0.0.0andAPP_VERSION=latest.version, Helm chartappVersion, the chart package filename, and the Helm OCI tag continue to use the existing Git tag value such asv1.2.3.Which issue(s) this PR fixes
Fixes #417
Special notes for your reviewer
This intentionally keeps latest image publishing on
mainpushes and only fixes the invalid Helm chart version used for latest chart publishing.Validation data:
mainpush metadata:TAG=latest,CHART_VERSION=0.0.0,APP_VERSION=latestmainpush validation run: https://github.com/ranxi2001/agentcube/actions/runs/28633043101agentcube-0.0.0.tgzwas packaged successfully, andghcr.io/ranxi2001/charts/agentcube:0.0.0was pushed successfully.AI assistance was used to inspect the workflow behavior, validate the fork run result, and prepare this PR text. I reviewed and validated the final change.
Does this PR introduce a user-facing change?
Additional documentation e.g., usage docs, etc.
None.
What test reports have been run
git diff upstream/main --checkactionlint -ignore 'too old to run on GitHub Actions' .github/workflows/build-push-release.ymlhelm lint manifests/charts/basemainpush:agentcube-0.0.0.tgzv1.2.3:agentcube-v1.2.3.tgzv1.2.3-alpha:agentcube-v1.2.3-alpha.tgzmainpush validation run: https://github.com/ranxi2001/agentcube/actions/runs/28633043101