Repository navigation
Publish the Helm chart to the OCI registry from the publish pipeline - #377
Conversation
|
Skipping CI for Draft Pull Request. |
There was a problem hiding this comment.
🟡 Changes recommended
The publishing flow skips the compatibility tag when signing is disabled and can expose the OCI chart before its images are available, leaving releases incomplete or temporarily unusable.
2 open issues
What changed in this PR
This PR moves Helm chart publication into cmrel’s publish pipeline, replacing chart-repository pull requests with OCI uploads, signing, verification, and compatibility tags.
Changes:
- Adds
helmchartociand removes the obsoletehelmchartprimplementation and integration fixtures. - Pins Helm and crane installations and upgrades cosign with flags preserving existing signing behavior.
- Adds command-runner tests and prevents panics on invalid release versions.
| File | Description |
|---|---|
pkg/sign/cosign/cosign.go |
Adds configurable signing and verification with legacy-compatible defaults. |
pkg/sign/cosign/cosign_test.go |
Tests arguments, runner invocation, and error propagation. |
pkg/shell/shell.go |
Adds an injectable command runner. |
pkg/release/validation/validate.go |
Rejects empty versions without panicking. |
pkg/release/platforms.go |
Handles malformed versions safely. |
pkg/release/platforms_test.go |
Covers invalid version inputs. |
pkg/release/manifests/chart.go |
Exposes chart names for OCI references. |
pkg/release/helm/testdata/README.md |
Removes obsolete fixture instructions. |
pkg/release/helm/testdata/cert-manager/values.yaml |
Removes obsolete chart values. |
pkg/release/helm/testdata/cert-manager/templates/tests/test-connection.yaml |
Removes the connection-test fixture. |
pkg/release/helm/testdata/cert-manager/templates/serviceaccount.yaml |
Removes the service-account fixture. |
pkg/release/helm/testdata/cert-manager/templates/service.yaml |
Removes the service fixture. |
pkg/release/helm/testdata/cert-manager/templates/NOTES.txt |
Removes fixture installation notes. |
pkg/release/helm/testdata/cert-manager/templates/ingress.yaml |
Removes the ingress fixture. |
pkg/release/helm/testdata/cert-manager/templates/hpa.yaml |
Removes the autoscaling fixture. |
pkg/release/helm/testdata/cert-manager/templates/deployment.yaml |
Removes the deployment fixture. |
pkg/release/helm/testdata/cert-manager/templates/_helpers.tpl |
Removes fixture template helpers. |
pkg/release/helm/testdata/cert-manager/Chart.yaml |
Removes obsolete chart metadata. |
pkg/release/helm/testdata/cert-manager/.helmignore |
Removes fixture packaging exclusions. |
pkg/release/helm/oci.go |
Adds Helm push and crane tag-copy helpers. |
pkg/release/helm/oci_test.go |
Tests OCI helper invocations and errors. |
pkg/release/helm/helm.go |
Removes GitHub chart-repository management. |
pkg/release/helm/helm_test.go |
Removes the chart-PR integration test. |
pkg/release/helm/github_client.go |
Removes chart-specific GitHub interfaces. |
pkg/release/consts.go |
Removes chart-repository defaults. |
go.mod |
Removes the direct testify dependency. |
gcb/test/helm/README.md |
Removes obsolete integration-job documentation. |
gcb/test/helm/cloudbuild.yaml |
Removes the chart-PR integration job. |
gcb/publish/cloudbuild.yaml |
Installs pinned tools and passes OCI settings. |
cmd/cmrel/cmd/publish.go |
Replaces chart GitHub settings with the OCI registry option. |
cmd/cmrel/cmd/gcb_publish.go |
Implements OCI chart publishing and updates image signing. |
cmd/cmrel/cmd/gcb_publish_oci_test.go |
Tests chart publishing sequences and failure handling. |
cmd/cmrel/cmd/const.go |
Defines the default chart OCI registry. |
Review effort: Balanced
|
|
||
| var publishActionMap map[string]publishAction = map[string]publishAction{ | ||
| "helmchartpr": pushHelmChartPR, | ||
| "helmchartoci": pushHelmChartOCI, |
There was a problem hiding this comment.
Agreed. Actions now run in a fixed order: githubrelease, pushcontainerimages, helmchartoci. The chart is published after the images it references. Subset selection and -action removal still work, and TestPublishActionListOrder covers it. Fixed in ffb2ae9.
[Claude Fable 5.1]
| if o.SkipSigning { | ||
| log.Printf("Skipping signing for chart %q as skip-signing is set", chart.Name()) | ||
| continue |
There was a problem hiding this comment.
Agreed. The push and the crane copy now always run. Only the cosign sign and verify calls are gated on --skip-signing. TestPushHelmChartOCI_SkipSigning now expects the crane copy. Fixed in ffb2ae9.
[Claude Fable 5.1]
Add a helmchartoci publish action. It pushes the chart and its .prov file to quay.io/jetstack/charts, signs and verifies the tag with cosign, then copies the chart to the tag without the "v" prefix and signs that too. We do this by hand today with hack/push_and_sign_chart.sh. Remove the helmchartpr action. The publish token can no longer reach jetstack/jetstack-charts, and charts.jetstack.io now syncs from the OCI registry. Run the publish actions in a fixed order, with the chart last, because the chart references the container images. Move cosign from v1.13.6 to v3.1.3. Pass flags that keep the v1 behaviour, where nothing is uploaded to the transparency log. Install helm v4.3.1 and crane v0.22.1 with go install from pinned tags, as we already do for cmrel and cosign. Run go test ./... in make test. This needed a fix for a panic in CmctlIsShipped when the version is not valid. This is based on cert-manager#290 by Ashley Davis. Co-authored-by: Ashley Davis <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: Richard Wall <[email protected]>
411482d to
e91d35f
Compare
|
We tested this stacked with #376 and #431, so this shows the three work together. Evidence: the chart in quay.io
The chart installs on kind from OCI. Evidence: the publish logThe dry run also showed the cosign What this release did not test
[with Claude] |
- cosign v3.1.3 fails to sign images with our SHA-512 KMS key: "unexpected length of digest for hash function specified". It gets a SHA-256 KMS signer (pkg/signature/keys.go) but signs through sigstore-go's bundle code, which hashes with the key's own algorithm. --new-bundle-format=false does not avoid that path in v3. - cosign v2.6.5 still uses the legacy path, where the GCP KMS signer hashes with the key's algorithm, and it accepts every flag cmrel passes. Co-Authored-By: Claude <[email protected]> Signed-off-by: Richard Wall <[email protected]>
|
The cosign pin is now v2.6.5. I cherry-picked d17b897 from
[Claude Fable 5.2] |
|
The hourly charts.jetstack.io sync picked up the chart from quay.io. At 17:02 it opened jetstack/jetstack-charts#579 with [with Claude] |
SgtCoDFish
left a comment
There was a problem hiding this comment.
/lgtm
/approve
The nature of cmrel is that it proves itself by being used. I don't see much value in a forensic review here, and I haven't done one - I checked for anything obviously hugely wrong, didn't find anything and so I'm happy to merge / look into followups!
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SgtCoDFish The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |

This revives #290 by @SgtCoDFish.
cmrel publishnow pushes and signs the Helm chart inquay.io/jetstack/charts, which we do by hand today withhack/push_and_sign_chart.sh.What changes
helmchartocipublish action. It pushes the chart and its.provfile, signs and verifies the tag with cosign, then copies the chart to the tag without thevprefix and signs that too.helmchartpraction is removed. We wanted to stop opening chart PRs from cmrel, and the publish token can no longer reachjetstack/jetstack-charts.charts.jetstack.iowill sync from the OCI registry instead.go installfrom pinned tags, as cmrel and cosign already are.make testrunsgo test ./.... This needed a fix for a panic inCmctlIsShippedon an invalid version.What I checked
helmchartocipushed and signed the chart on both tags. The release report has the logs and the checks made from outside the pipeline. The release ran this PR together with Embed cloudbuild.yaml in cmrel so releases need no checkout #376 and fix(sign): sign Helm charts with the KMS key again #431.go test ./...andmake presubmitpass.charts.jetstack.iodoes not listv1.22.0-alpha.0yet. That depends on jetstack/jetstack-charts#560, not on this PR.Why each change is needed
helmchartpr: we rotated the publish GitHub token to thecert-manager-botaccount during Release cert-manager v1.21.2 cert-manager#9237. That token cannot reachjetstack/jetstack-charts, so the action cannot run. We had planned to remove it anyway, so thatcharts.jetstack.iofollows the OCI registry and a release needs no PR in a private repository. The GitHub repository manager, its flags, the Cloud Build substitutions and thegcb/test/helmjob are removed with it.cosign signcall passes--tlog-upload=false --new-bundle-format=false --use-signing-config=false.cosign verify-blobpasses--insecure-ignore-tlog=true. On v2.6.5 only--tlog-upload=falseand--insecure-ignore-tlog=truechange the defaults. The other two are already the v2 defaults. We pass them so that a later move to v3 keeps the same behaviour.unexpected length of digest for hash function specifiedwhen it signs with our SHA-512 KMS key. v2.6.5 still has the older signing code, which hashes with the key's own algorithm.mainbranch intosh. The publish job has KMS signing access, so its tools must come from pinned sources.modules/tools/00_mod.mkin makefile-modules. helm is v4.3.1, the version the alpha was published with. makefile-modules has since moved to v4.3.2.go.sum.Evidence
COSIGN_EXPERIMENTALis set: https://github.com/sigstore/cosign/blob/v1.13.6/cmd/cosign/cli/sign/sign.go#L69-L73--tlog-uploadto true, and--new-bundle-formatand--use-signing-configto false: https://github.com/sigstore/cosign/blob/v2.6.5/cmd/cosign/cli/options/sign.go#L114-L150metadata.jsonwith--tlog-upload=false, so there is no log entry forverify-blobto find: https://github.com/cert-manager/cert-manager/blob/650eb5fbf50a7fbcf959f78079964196d0c80a62/make/release.mk#L90DOCKER_CONFIGsecret covershelm pushto quay.io: https://github.com/helm/helm/blob/v4.3.1/pkg/registry/client.go#L112-L119charts.jetstack.iosync from OCI is jetstack/jetstack-charts#560, in a private repository. It adds cert-manager to the existing hourlyoci-syncjob.Follow-ups, not in this PR
_COSIGN_REPO_REF,_CRANE_REPO_REFand_HELM_REPO_REFpins. They need a custom manager in cert-manager/renovate-config.gcb/publish/cloudbuild.yaml. Whichever merges last needs a rebase.hack/push_and_sign_chart.sh, the warning that points to it incmd/cmrel/cmd/const.go, and the matching steps in the website release process.--signing-configfile. chore(deps): update module github.com/sigstore/cosign/v2 to v3 makefile-modules#492 proposes v3 for the other projects.helmchartocifor a published version moves both chart tags to a new digest.Closes #290.
[Claude Fable 5.2]