Skip to content

proxy-release bump-chart rewrites tag: but the chart prefers digest: — automated proxy releases never change the deployed image #703

Closed

Description

@bpalermo

Summary

proxy-release.yml's bump-chart job pins the chart to a new proxy image by rewriting only the tag: line under aether-proxy in charts/aether/values.yaml:

sed -i -E '\|repository: ghcr\.io/bpalermo/aether/aether-proxy|{n;s|^(\s*tag: ).*|\1'"${{ github.sha }}"'|}'

But the chart's aether.image helper (charts/aether/templates/_helpers.tpl) prefers digest: over tag: whenever a digest is set — and the proxy image has been digest-pinned since #534/#655 (sha256:a749fcce…, the v1.39.0 multi-arch index). So the rolling chore/proxy-image-bump PR the workflow opens changes a field the template ignores. An automated proxy release does not change what talos deploys. The only proxy pin that ever took effect after the digest pin was the manual one in #655 ("pin aether-proxy to 4212e13 (tag + digest)").

Found while planning #697; it sits on the migration's critical path (§9 of the plan) because the bzlmod build's first image would otherwise be published and never deployed. Same family as #648 (digest-pin bug) and #692 (publish race) — three ways the deploy can silently not be what was intended.

Fix

In bump-chart, update both fields. The robust way: have the manifest job capture the index digest it just created (docker buildx imagetools create output, or imagetools inspect --raw ${IMAGE}:${sha} | sha256sum) and hand it to bump-chart as an artifact, then sed the digest: line in the same block as tag:. Add a CI assertion that renders the chart (helm template) and greps the rendered proxy image for the new sha's digest, so a regression fails the workflow instead of the deploy. Also bump charts/aether/Chart.yaml in that PR (the chart-version gate requires it — check whether the current auto-PR even passes chart-version-bump; if it doesn't, that is a second reason the rolling PR never merged).

Also note: with the default GITHUB_TOKEN the auto-opened PR does not trigger CI (GitHub's recursion guard) unless CHART_BUMP_PAT is set — verify which token is in use.

Being fixed as part of #697's PR 1; filing so the class is on record independently of the migration.

Activity

  1. bpalermo commented on Sep 5, 2026

    @bpalermo
    OwnerAuthor

    Second reason the auto chart-bump has never landed, found on PR #704's release run (33984258922): the build-push ×2 and manifest jobs succeeded (image aether-proxy:dc85823 published, multi-arch index created), then bump-chart failed at PR creation:

    ##[error]GitHub Actions is not permitted to create or approve pull requests.
    

    The job had already force-pushed chore/proxy-image-bump (tag-only bump, per this issue). So there are two independent breaks in the chain: (1) the tag:-only rewrite (this issue's original point, fixed in #705), and (2) the repository Actions setting "Allow GitHub Actions to create and approve pull requests" is off (actions/permissions/workflow.can_approve_pull_request_reviews=false), so peter-evans/create-pull-request with GITHUB_TOKEN cannot open the PR at all. Either enable that setting, or set CHART_BUMP_PAT (which the workflow already supports and which also makes the auto-PR trigger CI). Until one of those happens every proxy release ends red at bump-chart and the chart pin must be done by hand.

  2. bpalermo commented on Sep 5, 2026

    @bpalermo
    OwnerAuthor

    Plan (2026-09-05) — no PAT, no bypass, no repo-setting change

    Where it stands

    • (1) the tag:-only rewrite is fixed (proxy: migrate to bzlmod on the Envoy main dev snapshot (#697) #705): bump-chart now moves tag: + digest: (index digest read back from the registry) and bumps Chart.yaml.
    • (2) is the live break: peter-evans/create-pull-request with GITHUB_TOKEN fails at GitHub Actions is not permitted to create or approve pull requests. Every proxy-release run is red at bump-chart (dc85823, 51ba129, dff1677 on 09-05; d22cf05 on 09-01), and a stale chore/proxy-image-bump branch (c4e878d, pin to dff1677) is left behind.
    • Enabling the repo setting would NOT fix it. A PR opened with GITHUB_TOKEN gets no pull_request workflow runs (GitHub's recursion guard), so the required ci + proxy checks never appear and, with the main ruleset having no bypass actors, the PR is permanently unmergeable. Same for pushing straight to main.
    • Rejected token sources: classic PAT (out), fine-grained PAT (repo-scoped, but still a user credential with a ≤1y expiry that gets reaped), ruleset bypass for a bot (breaks the no-bypass invariant we just established).

    Decision: the workflow pushes the branch, a human opens the PR

    The pull_request: opened event is generated by whoever opens the PR, not by whoever pushed the branch. So a branch pushed by GITHUB_TOKEN and then opened as a PR by a human runs ci + proxy normally and merges under the existing ruleset. Zero credentials, zero settings changes, one command per proxy release (a step that is manual anyway: the talos deploy).

    1. proxy-release.yml / bump-chart — replace the peter-evans/create-pull-request step with a plain push: commit the two-file bump on a per-release branch chore/proxy-image-bump-<short-sha> (not a rolling branch; see 3) and git push --force-with-lease it with GITHUB_TOKEN (contents: write is already granted). Drop pull-requests: write.
    2. Hand-off — the same job writes $GITHUB_STEP_SUMMARY with the index digest, the chart version, and the exact one-liner:
      gh pr create --base main --head chore/proxy-image-bump-<sha> --title "chore(proxy): pin aether chart to aether-proxy:<sha>" --body-file -
      Optionally also gh issue create/gh issue comment (issues: write is allowed for GITHUB_TOKEN) on a single rolling "proxy releases pending chart pin" issue so there is a notification and a record; bot-authored comments do notify the owner.
    3. Why per-release branches — a later GITHUB_TOKEN push onto a branch that already has an open PR does not trigger pull_request: synchronize, so the new head would have no checks and be unmergeable (recoverable only by close/reopen). Per-release branches make every PR a fresh opened event. The job also closes superseded chore/proxy-image-bump-* PRs' branches? No: it leaves them; a human closes any it supersedes (gh pr close). Delete the stale chore/proxy-image-bump (c4e878d) now.
    4. CI assertion (the issue's original "so a regression fails the workflow instead of the deploy") — new proxy-pin job in ci.yaml, path-filtered on charts/aether/values.yaml: read repository/tag/digest for aether-proxy, docker buildx imagetools inspect $repo:$tag --format '{{.Manifest.Digest}}' (GHCR read via GITHUB_TOKEN, packages: read) must equal digest:, and helm template charts/aether must render $repo@$digest for the proxy container. Fold it into the ci fan-in so it is a required check. This catches the proxy-release auto-bump updates tag but not the digest pin the chart actually deploys #648 class (hand-pin typo, tag/digest from different builds) on any PR, not just the automated one.
    5. Exercise it — the fix PR touches .github/workflows/proxy-release.yml, which is itself a proxy-release trigger, so its merge runs the new path end to end (publishes an image for that sha, pushes the branch, writes the summary). Open the resulting PR by hand, watch ci + proxy run on it, merge, assert helm get metadata appVersion after the upgrade as usual.
    6. Not here — publish: concurrent runs race on the same chart version tag — older build overwrote newer (77a7d45 over 95b158e), deploy silently lacked #689 #692 (two publishes racing on the tag) is a concurrency: group on the publish workflows; separate PR. If auto-merge of the pin PR is ever wanted, that lands only after publish: concurrent runs race on the same chart version tag — older build overwrote newer (77a7d45 over 95b158e), deploy silently lacked #689 #692, and via gh pr merge --auto --squash (respects required checks), never via a bypass.

    Upgrade path if one manual command per release is too much

    A GitHub App (private, installed on this repo, contents: write + pull-requests: write; two secrets APP_ID + APP_PRIVATE_KEY; actions/create-github-app-token mints a 1h installation token per run). App-token PRs DO trigger pull_request workflows, tokens do not expire like a PAT, and the ruleset still needs no bypass. Steps 3–5 stay the same; step 1 goes back to create-pull-request with the app token. Creating the app is a one-time owner action; not doing it now.

  3. bpalermo commented on Sep 6, 2026

    @bpalermo
    OwnerAuthor

    Landed and exercised end to end (2026-09-06)

    #723 merged (ffe3c5b) → its own proxy-release run was the first ever to finish green (build-push ×2, manifest, bump-chart all success): it pushed chore/proxy-image-bump-ffe3c5b (tag + index digest sha256:32ac264f… + chart 0.92.5→0.92.6), wrote the step summary, and created the rolling tracking issue #724 with the one-liner. A human ran that one-liner → PR #725, which — because a person opened it — got ci, proxy and the new required proxy-pin check (registry index digest == digest:, helm renders repo@digest), all green; squash-merged as f17c2d9. No PAT, no App, no bypass, no repo setting changed.

    Per release from now on: one command from the summary or #724, then merge when green. The dead rolling branch is deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions