Skip to content

fix(ci): serialise publishes and give the aether chart a commit-pinned tag (#692) - #713

Merged
bpalermo merged 4 commits into
mainfrom
fix/692-publish-race
Sep 5, 2026
Merged

bpalermo merged 4 commits into
mainfrom
fix/692-publish-race

Conversation

@bpalermo

@bpalermo bpalermo commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Fixes #692.

On 2026-09-05 two publish runs for consecutive merges raced on the same chart
tag and the older build won: charts/aether:0.92.1 was pushed by the newer
commit (95b158e, #689) at 13:15:59Z and overwritten by the older one
(77a7d45) four seconds later. The 13:16:27Z deploy therefore shipped a release
that was believed to contain #689 and did not. Both of the issue's fixes are
here, plus the deploy-side guard.

1. Serialise the workflows that write shared mutable state

workflow concurrency group why
publish.yaml publish-main, cancel-in-progress: false Every run pushes the same mutable chart tags; a publish takes ~4 min and merges can be closer than that. cancel-in-progress: false because a publish is not a redundant check to be superseded — cancelling one mid-push leaves the images pushed and the chart not.
proxy-release.yml proxy-release-main, cancel-in-progress: false Same class of bug: bump-chart rewrites charts/aether/values.yaml on top of whatever main is at checkout time and force-pushes the single rolling chore/proxy-image-bump branch, so two overlapping runs drop one run's image pin. Cancelling would strand per-arch blobs with no manifest referencing them.
main.yaml (main-post-merge) none, deliberately — now documented in the file It writes nothing shared: each run validates its own commit against its own first parent. Serialising it would delay the detection it exists to provide, and queued-run eviction would silently skip a commit's validation.

2. Publish the aether chart under a commit-pinned tag too

helm push derives the OCI tag from the packaged chart's version:, and the
aether chart carried a bare X.Y.Z that does not change per commit — unlike
crds/prober/udsecho, which already suffix -{GIT_COMMIT}.

The chart is now published twice, from two packagings of the same sources:

  • ghcr.io/bpalermo/aether/charts/aether:0.92.4 — unchanged, kept because Flux
    and the deploy procedure consume it, and now safe thanks to (1).
  • ghcr.io/bpalermo/aether/charts/aether:0.92.4-<full 40-char git sha> — new,
    via //charts/aether:aether_commit.push_registry (chart only; the images went
    up by digest with the bare push).

The second packaging's Chart.yaml is derived from the first by a genrule that
appends -{GIT_COMMIT} to the version line, so the two tags can never disagree
about X.Y.Z, and the genrule fails the build if that line ever stops matching
the expected shape. Chart version bumped 0.92.3 → 0.92.4 (CI-enforced for any
charts/ change).

3. Post-upgrade guard in the deploy procedure

There is no deploy script, so this went into the two documented procedures
(docs/runbook.md §7, docs/getting-started.md). Both now pin the commit tag and
end with:

got="$(helm get metadata -n aether-system aether -o json | jq -r .appVersion)"
case "$got" in
  *"$COMMIT"*) echo "deployed $got — OK" ;;
  *) echo "DEPLOY MISMATCH: appVersion=$got, expected $COMMIT" >&2; exit 1 ;;
esac

Substring rather than equality: appVersion is {STABLE_GIT_VERSION} =
git describe --tags --always --long --dirty --abbrev=40, so the sha may carry a
v1.2.3-N-g prefix or a -dirty suffix. charts/README.md documents the new
tag and push target.

Validation

  • bazel build --stamp //charts/aether:aether //charts/aether:aether_commit →
    the packaged charts carry version: 0.92.4 and
    version: 0.92.4-82ac16c4b3c2ffa61603a12ec596e91ebc13159a respectively, with
    the same appVersion. Non-stamped builds degrade to 0.92.4-GIT-COMMIT and
    still lint, exactly like the sibling charts.
  • bazel test //charts/... → 9/9 pass, including the new
    //charts/aether:aether_commit_lint_test.
  • bazel build --config=lint //charts/... clean; bazel run //:format clean.
  • scripts/check-chart-version-bump.sh origin/main → 0.92.3 -> 0.92.4 OK.
  • All three edited workflows parse (yaml.safe_load); actionlint is not
    installed on this machine.

Note on behaviour: with cancel-in-progress: false, a run queued behind another
is evicted if a third arrives — so a middle commit's chart may never be
published. That is the intended trade (the issue accepts it), and it now fails
loudly: the deploy guard rejects a tag whose appVersion is not the commit
asked for, instead of silently deploying the wrong build.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 4 commits September 5, 2026 17:35
…d tag (#692)

Two `publish` runs for consecutive merges to `main` raced on the same chart
version tag and the older build won: 0.92.1 was pushed by the newer commit
(95b158e) at 13:15:59Z and overwritten by the older one (77a7d45) four seconds
later, so the 13:16:27Z deploy silently shipped without #689.

Two independent causes, both fixed:

* `publish.yaml` had no `concurrency` group, so runs for `main` overlapped.
  Added `group: publish-main, cancel-in-progress: false` — a publish is not a
  redundant check to supersede; cancelling one mid-push would leave images
  pushed and the chart not.

  `proxy-release.yml` gets the same treatment for the same class of bug: its
  `bump-chart` job rewrites `charts/aether/values.yaml` on top of whatever
  `main` is at checkout and force-pushes the single rolling
  `chore/proxy-image-bump` branch, so overlapping runs drop one run's image pin.

  `main.yaml` (main-post-merge) deliberately gets none, and now says so: it
  writes no shared state, and serialising it would delay — or, via queued-run
  eviction, skip — the detection it exists to provide.

* The `aether` chart was published only under its bare `Chart.yaml` version, a
  tag that does not change per commit. It is now also published as
  `charts/aether:<X.Y.Z>-<full git sha>`, the scheme crds/prober/udsecho
  already use, via a second packaging of the same chart whose `Chart.yaml` is
  *derived* from the first (a genrule appends `-{GIT_COMMIT}`), so the two tags
  can never disagree about X.Y.Z. Only the chart is pushed for the commit tag —
  the images went up by digest with the bare push. The bare tag stays, for Flux
  and the documented deploy procedure, and is now safe because of the
  serialisation.

The documented deploy procedure (docs/runbook.md, docs/getting-started.md) now
pins the commit tag and, after `helm upgrade`, asserts that
`helm get metadata -n aether-system aether -o json | jq -r .appVersion`
contains the intended commit, failing otherwise — the only check that catches a
chart tag serving a different build than the one asked for. Substring, not
equality: appVersion is `git describe --tags --always --long --dirty
--abbrev=40`, so the sha can carry a `v1.2.3-N-g` prefix or a `-dirty` suffix.

Validated: `bazel build --stamp //charts/aether:aether //charts/aether:aether_commit`
produces `version: 0.92.4` and `version: 0.92.4-<40-char sha>` with the same
appVersion; `bazel test //charts/...` (9/9, including the new
`aether_commit_lint_test`) and `--config=lint //charts/...` pass;
`scripts/check-chart-version-bump.sh` passes on the 0.92.3 -> 0.92.4 bump; all
three edited workflows parse as YAML (actionlint not installed locally).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
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.

publish: concurrent runs race on the same chart version tag — older build overwrote newer (77a7d45 over 95b158e), deploy silently lacked #689

1 participant