Repository navigation
feat[auto-upgrade]: Ship trust deployment assets as versioned artifacts instead of a git checkout - #1752
Open
garciadias wants to merge 1 commit into
Open
feat[auto-upgrade]: Ship trust deployment assets as versioned artifacts instead of a git checkout#1752garciadias wants to merge 1 commit into
garciadias wants to merge 1 commit into
Conversation
A Kubernetes trust has no versioned deployment artifact. `Chart.yaml` has sat at version 0.1.0 / appVersion "1.0" since it was written, and the chart is only ever installed from a working checkout — so "upgrade this trust to v0.13.0" has no artifact to name. #1644's in-cluster upgrade CronJob needs one: it cannot clone the repo, it can only pull a chart. Every release now publishes the chart to GHCR as an OCI artifact, versioned with the release. scripts/package_chart.py stamps three fields from the release tag -- Chart.yaml version, Chart.yaml appVersion, and values.yaml global.image.tag, which is already the single pin for every FLIP-built image (FLIP#1204) -- then packages and pushes. So flip-trust:0.13.0 deploys v0.13.0's images and nothing else. The stamping lives in a script rather than inline workflow YAML, following deploy_verdict.py and cstore_verdict.py, so it is unit-testable without a cluster or a registry, and runnable by hand with --no-push for a dry run. In-tree the chart is now explicitly un-versioned (0.0.0-dev, floating image tag): a development checkout should deploy what you built, not the last release. Shipping the old 0.1.0/"1.0" defaults would have been the bug, so a test asserts neither survives stamping. The publish step sits after the image builds go green and before the production apply, so a published chart never references images that do not exist. It needs packages: write, which the release job did not previously hold. Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
This was referenced Nov 4, 2026
This branch has not been deployed
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.
What
Publishes the trust Helm chart to GHCR as a versioned OCI artifact on every release.
Closes #1646 (OCI half — see "Deliberately not here" below).
Why
A Kubernetes trust currently has no versioned deployment artifact.
Chart.yamlhas sat atversion: 0.1.0/appVersion: "1.0"since it was written, and the chart is only ever installed from a working checkout. So "upgrade this trust to v0.13.0" has nothing to name.#1644's in-cluster upgrade CronJob is the forcing function: it runs as a namespace-scoped service account inside the cluster. It cannot clone the repo and run
make. It can only pull a chart.How
trust/deploy/helm/scripts/package_chart.pystamps three fields from the release tag, then packages and pushes:Chart.yamlversion0.13.0Chart.yamlappVersionv0.13.0values.yamlglobal.image.tagv0.13.0That third one is why this stays small:
global.image.tagis already the single pin for every FLIP-built image (FLIP#1204), soflip-trust:0.13.0deploys v0.13.0's images and nothing else. No per-service stamping.The stamping lives in a script rather than inline workflow YAML, following
deploy_verdict.pyandcstore_verdict.py, so it is unit-testable without a cluster or a registry — and runnable by hand:In-tree the chart becomes explicitly un-versioned (
0.0.0-dev, floating image tag), because a development checkout should deploy what you built, not the last release.The publish step sits after the image builds go green and before the production apply, so a published chart never references images that do not exist. A workflow test pins that ordering; it needs
packages: write, which the release job did not hold.Verification
Packaged the chart for real and rendered it — not just unit tests:
Rendering the packaged tarball shows every FLIP image pinned and upstream images untouched:
develop+ 26 new).ReleasePublishesTheTrustChart, plus the existing permissions and step-order guards, pass.Mutation-tested the new suite — four mutations, all caught:
values.yaml(images float onstag)test_publish_stamps_values_on_disktest_a_malformed_version_is_refused--no-pushtest_no_push_does_not_push0.1.0defaulttest_the_unpublished_defaults_never_shipThe first one is the bug this whole slice exists to prevent — a chart that claims to be 0.13.0 while deploying whatever
stagpoints at today. The unit tests calledstamp_valuesdirectly and would not have caught it, so I added disk-level assertions onpublish().Deliberately not here
#1646 as filed also covers a compose/make deployment bundle for non-Kubernetes trusts. That half lives in
scripts/site_upgrade.py(669 lines, hard-codes_REPO_ROOT) and is load-bearing for the existing upgrade path. Splitting it out keeps this PR reviewable; follow-up issue to come.Worth a careful look
appVersion: "v0.13.0"carries thev,version: 0.13.0does not. Helm requires SemVer forversion;appVersionis free-form and matching the git tag seemed more useful. Easy to make consistent if you disagree.