Skip to content

fix(ci): hand off the proxy chart pin on a pushed branch, and gate the pin in CI (#703) - #723

Merged
bpalermo merged 1 commit into
mainfrom
fix/703-proxy-release-handoff
Sep 6, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/703-proxy-release-handoff

Conversation

@bpalermo

@bpalermo bpalermo commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Closes #703.

The mechanism (and why the repo setting would not help)

Every proxy-release run has ended red at bump-chart since
"Allow GitHub Actions to create and approve pull requests" was turned off:
peter-evans/create-pull-request with GITHUB_TOKEN dies at
GitHub Actions is not permitted to create or approve pull requests. The image
is published, the chart stays unpinned, the deploy has to be hand-pinned.

Turning that setting back on would not fix it. A PR opened by GITHUB_TOKEN
fires no pull_request events (GitHub's recursion guard), so the ci + proxy
checks the main ruleset requires would never report — and the ruleset has no
bypass actors, so the PR would be permanently unmergeable. Pushing straight to
main is blocked by the same ruleset. There is no PAT and there will not be one;
a ruleset bypass for a bot would break the no-bypass invariant.

A PR opened by a human on a branch a bot pushed does fire pull_request
normally — the event is attributed to whoever opens the PR, not to whoever pushed
the branch. So:

  • bump-chart keeps the existing seds (values.yaml tag: + digest: +
    the provenance comment) and the Chart.yaml patch bump, then commits as
    github-actions[bot] onto a per-release branch
    chore/proxy-image-bump-<short sha> and
    git push --force-with-lease es it with GITHUB_TOKEN
    (contents: write, already granted). pull-requests: write is dropped;
    issues: write is added.
  • Per-release, not the old rolling chore/proxy-image-bump, because a later
    GITHUB_TOKEN push onto a branch that already has an open PR fires no
    pull_request: synchronize either — the new head would carry no checks and the
    PR would be stuck. A fresh branch makes every PR a fresh opened event.
  • If the chart is already pinned to this sha there is no diff: no chart bump, no
    branch, no hand-off — the summary says so.
  • The lease is passed explicitly (--force-with-lease=<branch>:<sha-or-empty>).
    A bare --force-with-lease resolves the expected head through the remote's
    configured fetch refspec, and actions/checkout clones single-branch, so any
    other branch is rejected as stale info even right after fetching it. Verified
    locally against a scratch remote for all three cases (new branch, existing
    branch, genuinely stale lease → rejected).

Hand-off

The job writes the same block to $GITHUB_STEP_SUMMARY and as a comment on a
single rolling tracking issue titled proxy releases pending chart pin
(searched by exact title, created on first use) — that issue comment is the
notification channel. The block is:

## Chart pin ready for `aether-proxy:<full sha>`

| | |
|---|---|
| image | `ghcr.io/bpalermo/aether/aether-proxy:<full sha>` |
| index digest | `sha256:…` |
| chart version | `0.92.3` -> `0.92.4` |
| branch | `chore/proxy-image-bump-<short sha>` |
| release run | <run url> |

`proxy-release` pushed the branch but cannot open the PR (#703).
Run this from a checkout (bash — it uses process substitution):

```sh
gh pr create --base main --head chore/proxy-image-bump-<short sha> --title "chore(proxy): pin aether chart to aether-proxy:<full sha>" --body-file <(cat <<'PRBODY'
…body, ending with the generated-with trailer…
PRBODY
)

## The new `proxy-pin` CI job

Unconditional (no `if`, no path filter) and folded into the `ci` fan-in `needs`,
so it is a required check on every PR. It catches the #648 / #705 class — a pin
whose parts came from different builds — on a PR instead of on a deploy. Three
assertions:

1. **values.yaml is well-formed.** `repository:` / `tag:` / `digest:` for
   `aether-proxy` are parsed with *exactly* the contract
   `bazel/proxy_pin/extensions.bzl` uses (first `repository:` whose last path
   segment is `aether-proxy`; then `tag:` / `digest:` inside that mapping,
   indentation >= the key's, blank and comment-only lines not ending the block;
   `digest:` must be `sha256:<64 hex>`), so the CI gate and the
   `//test/envoy_validate` binary selection can never disagree about what the pin
   is.
2. **The registry agrees.**
   `docker buildx imagetools inspect <repo>:<tag> --format '{{.Manifest.Digest}}'`
   must equal `digest:`. `aether-proxy` is a public GHCR package so this needs no
   login (`packages: read` is declared for the day it is not).
3. **The chart deploys the digest.** `helm template charts/aether` must render the
   proxy container as `<repo>@<digest>`, and must *not* render it as
   `<repo>:<tag>` — `aether.image` prefers `digest:`, which is precisely why the
   tag-only bump in #705 was invisible.

Every failure emits an `::error file=charts/aether/values.yaml::` naming which of
the three disagrees and what each side says.

## How this was validated

Both workflow files parse (`python3 -c 'import yaml…'`) and `actionlint 1.7.7`
reports nothing new (the one `github.head_ref` warning it prints on `ci.yaml` is
present on `main` too). `make format-check` is clean.

The `bump-chart` steps were extracted from the YAML and dry-run locally with a
stubbed `gh`: the pin step reports `changed=true` on a fresh file and
`changed=false` on an already-pinned one, and the hand-off step produces the
summary and one-liner shown above (the `<(cat <<'PRBODY' … )` construct was
checked to actually run in bash).

The `proxy-pin` step was extracted and run under `bash -e` against the real
`charts/aether/values.yaml`:

* **PASSES** on the current pin — tag `51ba12979d545bcde021d81ef9151355db7c6a07`,
  digest `sha256:9e401334408d8f87d59d0c409d957553d56938fb373b258eab002d3e655bd8a3`;
  the registry returns that same digest and `helm template` renders
  `…/aether-proxy@sha256:9e4013…`. Exit 0.
* **FAILS** when the digest is corrupted to `sha256:0e401334…`:
  `::error … tag: and digest: disagree with the registry — …:51ba129… resolves to
  sha256:9e4013…, but digest: pins sha256:0e4013…`. Exit 1.
* Also fails, with its own message, when `digest:` is deleted (tag-only pin, the
  #705 shape) and when the tag does not exist in the registry.

`charts/` is untouched, so no chart version bump is needed here.

## Note on merging this PR

`.github/workflows/proxy-release.yml` is itself a `proxy-release` trigger path, so
**merging this PR runs the new path end to end**: it publishes an `aether-proxy`
image for the merge commit, pushes `chore/proxy-image-bump-<short sha>`, writes
the summary and creates + comments on the tracking issue. The first real hand-off
therefore happens on merge — open that PR by hand, watch `ci` + `proxy` run on it,
merge, then deploy and assert `appVersion` as usual (`docs/runbook.md` §7, which
this PR updates).

The stale rolling branch `chore/proxy-image-bump` (c4e878d, pinning dff1677) is
now dead and can be deleted; left alone here.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…e pin in CI (#703)

Every `proxy-release` run has ended red at `bump-chart` since the repository
setting "Allow GitHub Actions to create and approve pull requests" was turned
off: `peter-evans/create-pull-request` with `GITHUB_TOKEN` dies at `GitHub
Actions is not permitted to create or approve pull requests`, leaving the image
published and the chart unpinned.

Turning that setting back on would not fix it. A PR opened by `GITHUB_TOKEN`
fires no `pull_request` events (GitHub's recursion guard), so the `ci` + `proxy`
checks the `main` ruleset requires would never report — and the ruleset has no
bypass actors, so such a PR is permanently unmergeable. Pushing straight to
`main` is blocked by the same ruleset, and there is no PAT.

A PR *opened by a human* on a branch a bot pushed does fire `pull_request`
normally. So `bump-chart` now commits the two-file bump (values.yaml tag +
digest + provenance comment, Chart.yaml patch) onto a per-release branch
`chore/proxy-image-bump-<short sha>`, force-with-lease-pushes it with
`GITHUB_TOKEN`, and hands off: `$GITHUB_STEP_SUMMARY` and a comment on the
rolling "proxy releases pending chart pin" issue, both carrying the exact
`gh pr create --base main --head … --body-file <(…)` one-liner. If the chart is
already pinned to the sha there is no diff, no branch and no hand-off. The
branch is per-release because a later `GITHUB_TOKEN` push onto a branch that
already has an open PR fires no `synchronize` either. `pull-requests: write` is
dropped; `issues: write` is added.

Also adds the `proxy-pin` CI job (unconditional, in the `ci` fan-in) so a broken
pin fails a PR instead of a deploy — the #648 / #705 class. It parses
`repository`/`tag`/`digest` for `aether-proxy` out of `charts/aether/values.yaml`
with the same contract `bazel/proxy_pin/extensions.bzl` uses, then asserts that
`docker buildx imagetools inspect <repo>:<tag>` returns exactly `digest:` (public
package, no login) and that `helm template charts/aether` renders the proxy
container as `<repo>@<digest>` and never as `<repo>:<tag>`. Each failure names
which of the three disagrees.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit ffe3c5b into main Sep 6, 2026
18 checks passed
@bpalermo
bpalermo deleted the fix/703-proxy-release-handoff branch September 6, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant