Skip to content

fix(ci): the dev deploy had become unreachable — give it its own workflow - #444

Merged
athvin merged 1 commit into
mainfrom
bm/ci-deploy-unstarve
Nov 3, 2026
Merged

athvin merged 1 commit into
mainfrom
bm/ci-deploy-unstarve

Conversation

@athvin

@athvin athvin commented Nov 3, 2026

Copy link
Copy Markdown
Owner

images.yml sets cancel-in-progress: true, and deploy-dev was needs: [detect, er-api, er-web] behind the ~58-minute er-api build. So any merge to main within an hour of the previous one cancelled the earlier run before its deploy job started.

Measured 2026-11-03: four merges inside one hour produced three consecutive cancelled deploys, and scripts/obs_up.sh — the only installer for the span store, the collector and Fluent Bit — had therefore never run, despite the PR that added it having merged. Nothing reported it, because a cancelled run is not a failure.

"Merged" did not mean "deployed", and five defects in those never-executed values survived review as a direct result (#441).

Why it has to be a separate workflow

A job-level concurrency cannot fix this — the workflow-level cancel kills the job before it ever starts. So the deploy becomes its own workflow on workflow_run, with cancel-in-progress: false: deploys queue instead of cancelling, and a merge landing mid-deploy waits its turn rather than aborting it half-applied.

The property the old comment claimed is not given up

images.yml said the deploy lived there "so ordering is structural — a deploy cannot start before the images it deploys are pushed." That still holds: workflow_run fires only on completed, and the job additionally requires conclusion == 'success'. Only the waiting moved outside the concurrency group that was cancelling it.

A cancelled images run still produces no deploy — correct rather than a remnant of the old bug. A superseded build should not roll out, and the newest run, the one that was not cancelled, completes and deploys. The difference is that its deploy can no longer be killed by whatever merges next.

Two things the split improves rather than merely preserves

  • The old "Refuse to deploy a failed build" step inspected needs.er-api.result to distinguish skipped (that tree did not change — fine, reuse the existing digest) from failed (do not deploy). The workflow conclusion already encodes exactly that distinction: a rust-only commit skips er-web and the run is still success, while a failed build is failure. cancelled and skipped fall through to no deploy, which is what they should mean.
  • DEPLOY_SHA is workflow_run.head_sha, not github.sha. In a workflow_run workflow github.sha is the default branch tip, not the commit that was built — using it would deploy whatever main happens to be now. That is the subtle way this kind of split goes wrong, so it is named in the file.

Checked rather than assumed

  • deploy dev (ci namespace) is not a required status check — verified against branch protection, so moving it cannot block a PR.
  • The OIDC subject is pinned to ref:refs/heads/main (infra/terraform/modules/github-oidc). A workflow_run workflow runs in the default-branch context, so the claim still matches; and if it ever stops matching, configure-aws-credentials fails closed before anything is applied.
  • .claude/skills/ci-and-supply-chain/references/required-checks.md is generated and tracked the move; regenerated and committed, and make skills-check passes (it diffs against HEAD, so the regen has to be committed to pass).
  • Both uses: are SHA-pinned with trailing tag comments, per S9.

One thing found on the way, deliberately not fixed here

scripts/ci/actionlint.sh is orphaned. It shells out to scripts/actionlint.py, which the Python cutover (7cc444fd) deleted, so it cannot lint anything — and no workflow calls it. The S9 SHA-pin rule it was written to enforce has therefore been unenforced since that commit. Flagged rather than resurrected, because fixing it means choosing a replacement toolchain and that is not this change.

🤖 Generated with Claude Code

…flow

`images.yml` sets `cancel-in-progress: true`, and `deploy-dev` was
`needs: [detect, er-api, er-web]` behind the ~58-minute er-api build. So any
merge to main within an hour of the previous one cancelled the earlier run
BEFORE its deploy job started.

Measured 2026-11-03: four merges inside one hour produced three consecutive
cancelled deploys, and `scripts/obs_up.sh` — the only installer for the span
store, the collector and Fluent Bit — had therefore never run, despite the PR
that added it having merged. Nothing reported it, because a cancelled run is
not a failure. "Merged" did not mean "deployed", and five defects in those
never-executed values survived review as a direct result.

A job-level `concurrency` cannot fix this: the workflow-level cancel kills the
job before it starts. So the deploy becomes its own workflow on `workflow_run`,
with `cancel-in-progress: false` — deploys QUEUE instead of cancelling, and a
merge landing mid-deploy waits its turn rather than aborting it half-applied.

The property images.yml's comment claimed is NOT given up. It said the deploy
lived there "so ordering is structural — a deploy cannot start before the
images it deploys are pushed". `workflow_run` fires only on `completed` and the
job additionally requires `conclusion == 'success'`, so that still holds; only
the waiting moved outside the group that was cancelling it.

Two things the split improves rather than merely preserves:

- The old "Refuse to deploy a failed build" step inspected
  `needs.er-api.result` to tell "skipped" (that tree did not change — fine)
  from "failed" (do not deploy). The workflow conclusion already encodes
  exactly that distinction, and `cancelled` falls through to no deploy.
- `DEPLOY_SHA` is `workflow_run.head_sha`, not `github.sha`. In a
  `workflow_run` workflow `github.sha` is the DEFAULT BRANCH TIP, not the
  commit that was built — using it would deploy whatever main happens to be
  now. That is the subtle way this kind of split goes wrong, so it is named.

A cancelled `images` run still produces no deploy, which is correct rather than
a remnant: a superseded build should not roll out, and the newest run — the one
that was not cancelled — completes and deploys.

`deploy dev (ci namespace)` is not a required status check (verified against
branch protection), so moving it cannot block a PR.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin force-pushed the bm/ci-deploy-unstarve branch from 9bdcf8d to cf0e606 Compare November 3, 2026 07:12
@athvin
athvin merged commit 6e45312 into main Nov 3, 2026
27 of 34 checks passed
@athvin
athvin deleted the bm/ci-deploy-unstarve branch November 3, 2026 07:13
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.

2 participants