fix(release): bump Helm Chart.yaml version during release branch setup - #4003
fix(release): bump Helm Chart.yaml version during release branch setup#4003pujitha24 wants to merge 1 commit into
Conversation
Motivation: charts/tekton-operator/Chart.yaml has shipped as "version: \"devel\"" / "appVersion: \"devel\"" in the git tree for every release since v0.80.0 (confirmed by fetching the raw Chart.yaml at the v0.80.0, v0.81.0 and v0.81.1 tags), and as a stale "v0.79.1" for v0.79.2. Helm rejects "devel" as an invalid chart version, so consumers that read the chart straight from a git tag or branch (e.g. ArgoCD via the helm-git plugin, or a plain git clone) fail to deploy. This was reported once before and the .github/workflows/helm-release.yaml CI job was patched to sed the version into place at tag-push time, but that sed only edits the ephemeral CI runner's checkout to produce the packaged .tgz/OCI artifact - it is never committed back to git, so the tag itself keeps "devel" forever. tekton/release-cheat-sheet.md separately documented a manual sed-and-commit step to fix Chart.yaml in git, but it is easy to forget: it was only ever run once, for v0.79.1. Approach: hack/release.sh's set_version_label() (invoked by hack/release-setup-branch.sh, the script the release cheat sheet has maintainers run to prepare every release branch) already rewrites version labels across config/ and cmd/ and gets committed into the release branch by commit_changes(). Extend the same function to also bump charts/tekton-operator/Chart.yaml's version/appVersion fields using the old_version/operator_version variables it already computes, and include charts/ in the commit. charts/tekton-operator/templates/ already renders every version label from .Chart.AppVersion (see 683e447), so Chart.yaml is the only file that needs updating. Removed the now-redundant manual "Update Helm charts" step from tekton/release-cheat-sheet.md since this makes it automatic. Note: .github/workflows/helm-release.yaml's own "Update Chart version with release tag" sed step becomes a silent no-op once Chart.yaml no longer contains the literal string "devel" at tag time - harmless, since the values it packages (VERSION/TAG) are derived from the git ref rather than from the sed match, but worth a follow-up cleanup. Validation: hack/release.sh is a manual maintainer script with no unit tests, no shellcheck CI, and no GitHub Actions coverage; hack/release-setup-branch.sh requires a real upstream git remote to push branches, so I could not run it end to end. This sandbox only has BSD sed (no -i-compatible GNU sed), a pre-existing limitation shared by every other "sed -i -E" call already in this file, not something introduced here. I instead extracted the new sed expressions and ran them (via "sed -E", writing to stdout instead of -i) against a copy of the real Chart.yaml: - old_version=devel, operator_version=v0.80.0 correctly produced "version: 0.80.0" / "appVersion: v0.80.0", matching the format already committed for v0.79.1. - chaining old_version=v0.80.0, operator_version=v0.80.1 against that output correctly produced "version: 0.80.1" / "appVersion: v0.80.1", proving the transform also works for ordinary patch-to-patch transitions, not just the initial "devel" case. Also ran `shellcheck hack/release.sh hack/release-setup-branch.sh`: only pre-existing info-level SC2086 (unquoted variable in echo) findings in the same style as surrounding code, nothing new. Report: tektoncd#4002 ```release-note Fix Helm chart `Chart.yaml` shipping `version: "devel"` / `appVersion: "devel"` in release tags, which made `helm-git`/git-based chart consumers (e.g. ArgoCD) fail to deploy. ``` Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> Assisted-by: claude-sonnet-5 (via Claude Code)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4003 +/- ##
=======================================
Coverage 26.44% 26.44%
=======================================
Files 465 465
Lines 24992 24992
=======================================
Hits 6610 6610
Misses 17661 17661
Partials 721 721
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:
|
|
/lgtm |
|
@pujitha24 Can you explain how did you raise this PR ? |
|
I used Claude Code to help investigate and draft this, as noted in the PR description. Starting from issue #4002, I traced the "devel" version through the release scripts and found that |
|
/hold |
|
Saw the hold. If there's a specific concern — about the AI-assisted process or anything in the change itself — let me know and I'll address it. |
|
@pujitha24 thanks for the contributions on operator, I have noticed you've opened several PRs recently and I appreciate that they're solving real issues. |
|
Appreciate that, and totally understand wanting a human in the loop here. On disclosure: it's called out in the PR description ("AI assistance: this change was drafted with Claude Code") and the commit carries an I'd be glad to join a community call — could you point me to where the schedule/link is posted? Happy to introduce myself and talk through this PR and the others directly. |
| sed -i "s/^version: \"devel\"/version: ${TEKTON_RELEASE_VERSION#v}/" charts/tekton-operator/Chart.yaml | ||
| sed -i "s/^appVersion: \"devel\"/appVersion: ${TEKTON_RELEASE_VERSION}/" charts/tekton-operator/Chart.yaml | ||
| ``` | ||
|
|
There was a problem hiding this comment.
@pujitha24 cheatsheet steps are maintained for manual references. Any specific reason why this is removed?
|
[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 |
Changes
charts/tekton-operator/Chart.yamlhas shipped withversion: "devel"/appVersion: "devel"committed in the git tree for every release sincev0.80.0 (confirmed by fetching the raw
Chart.yamlat thev0.80.0,v0.81.0andv0.81.1tags), and with a stalev0.79.1forv0.79.2.Helm rejects
"devel"as an invalid chart version, so consumers that readthe chart straight from a git tag/branch (e.g. ArgoCD via the
helm-gitplugin, or a plain git clone) fail to deploy.
Root cause: the actual release-branch preparation script,
hack/release-setup-branch.sh(invoked pertekton/release-cheat-sheet.mdfor every minor and patch release), never touched
charts/tekton-operator/Chart.yaml.The only place this file got bumped was:
run once, for
v0.79.1), and.github/workflows/helm-release.yaml, which seds the file in the CIrunner's ephemeral checkout to build the packaged chart, but never commits
that change back to git - so the git tag itself keeps
"devel"forever.This PR extends
set_version_label()inhack/release.sh(called byhack/release-setup-branch.sh) to also bumpChart.yaml'sversion/appVersionfields using the same
old_version/operator_versionvariables it alreadycomputes for every other manifest, and includes
charts/in the releasecommit.
charts/tekton-operator/templates/*.yamlalready renders everyversion label from
.Chart.AppVersion(added in 683e447), soChart.yamlis the only file that needed updating. The now-redundant manual step is
removed from
tekton/release-cheat-sheet.md.Note:
.github/workflows/helm-release.yaml's own "Update Chart version withrelease tag" sed step becomes a silent no-op once
Chart.yamlno longercontains the literal string
"devel"at tag time - harmless, since thevalues it packages are derived from the git ref rather than from the sed
match, but worth a follow-up cleanup.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lintbefore submitting a PR (n/a: onlyhack/release.sh(bash) and a.mddoc changed - no.go/.yamlfiles touched; ranshellcheckon the shell script instead, see Validation disclosure below)See the contribution guide for more details.
Validation disclosure:
hack/release.shis a manual maintainer scriptwith no unit tests, no shellcheck CI, and no GitHub Actions coverage;
hack/release-setup-branch.shrequires a realupstreamgit remote to pushbranches, so I could not run it end to end. This sandbox only has BSD
sed(no
-i-compatible GNU sed) - a pre-existing limitation shared by everyother
sed -i -Ecall already in this file, not something introduced here.I instead extracted the new sed expressions and ran them (via
sed -E,writing to stdout instead of
-i) against a copy of the realChart.yaml:old_version=devel, operator_version=v0.80.0correctly producedversion: 0.80.0/appVersion: v0.80.0(matching the format alreadycommitted for
v0.79.1), and chainingold_version=v0.80.0, operator_version=v0.80.1against that output correctly producedversion: 0.80.1/appVersion: v0.80.1, proving the transform works forordinary patch-to-patch transitions too, not just the initial
develcase.Also ran
shellcheckon both scripts: only pre-existing info-level SC2086findings in the same style as surrounding code.
Release Notes
AI assistance: this change was drafted with Claude Code.
Fixes #4002