Skip to content

ci(deploy): let a manual deploy target dev or prod alone - #1545

Merged
athvin merged 2 commits into
mainfrom
ci/deploy-environment-input
Dec 3, 2026
Merged

athvin merged 2 commits into
mainfrom
ci/deploy-environment-input

Conversation

@athvin

@athvin athvin commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Refs #1429

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

deploy.yml's manual dispatch gains an environment input: both (the default), dev or prod. Each job skips when the input targets only the other environment. Merges still deploy both, through images.

Why

The owner limited the #1429 resolver candidate (#1518) to er-dev until it is measured there. No CI path deployed one environment alone: a merge and a manual dispatch both ran the dev and prod jobs. Labelled no-ticket because this is enabling plumbing for #1429. A separate issue would be auto-added to the DuckFleet board, which the owner asked to keep free of ER issues.

Proof

  • actionlint .github/workflows/deploy.yml passes, and scripts/ci/workflow-shell-check.sh reports ok.
  • er-schema/tests/deploy_reachability.rs asserts the trigger set (no push:, plus workflow_run and workflow_dispatch), which is unchanged.
  • Neither job has needs:, so prod alone and dev alone are both reachable.

Risk & rollback

A merge-triggered deploy is unaffected: the new condition applies only to workflow_dispatch. Rollback: git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session Claude Code:cf299f4a-bafd-4f62-a459-2f495e05c5f2 on Mac · 2026-12-03T01:25:00Z

  • main is green with this change on it — the merge SHA, and the run
    that proves it. A later head SHA with this commit as an ancestor counts;
    a cancelled run with zero jobs does not: 08d3314d. rust 47005442960, frontend 47005443031, infra 47005443092, devcontainer 47005442979 and images 47005442899 all success.
  • images built, or correctly never ran because nothing that goes into
    an image changed: images 47005442899 success. deploy.yml is in its paths; both build jobs correctly skipped (no rust/frontend change).
  • deploy converged — proved by a line the running process emitted, not
    by the image digest and not by the workflow conclusion: n/a — the merge-triggered deploy for 08d3314d (47005482556) was cancelled while pending. The dev-only dispatch 47005705531 joined the deploy concurrency group, and GitHub keeps one pending run per group. Nothing was lost: the merge changed only deploy.yml, with no image, and the next merge's deploy (f4c401d3, perf(resolve): serve candidates from an in-memory corpus copy, reuse key auth's connection (#1429) #1518) runs from this workflow.
  • the push-only surface no pull request can pre-test (deploy, drift,
    kind's nightly leg) is green, or knowingly red for a reason that is not
    this change: drift is knowingly red on schedule since at least Nov 29, predating this change. The kind nightly covers no workflow file; n/a for a dispatch-input change.
  • the board card reached Done through the automation rather than by
    hand, and the issue closed: n/a — no-ticket enabling change for Resolve latency: ~2.1 s p50 at 520k records because the corpus is materialised per request #1429, which closed through perf(resolve): serve candidates from an in-memory corpus copy, reuse key auth's connection (#1429) #1518 after the dev-only measurement this unlocked.
  • follow-ups are open for everything deferred here — numbers: none deferred.
  • what was learned is written down where the next session will find it
    (a skill, a reference, memory) — or nothing new was learned: a manual deploy dispatch cancels a merge-triggered deploy that is still pending in the same concurrency group. Recorded in session memory. Dispatch only when no merge deploy is queued, or re-dispatch the cancelled SHA afterwards.

Specific to this change

Context — plan, discoveries, measurements, files

Files

  • .github/workflows/deploy.yml

🤖 Generated with Claude Code

@athvin athvin added the no-ticket deliberately not tied to a board ticket; exempts the pull request contract label Dec 3, 2026
bmoore813 and others added 2 commits December 2, 2026 19:37
A resolver candidate (#1518, for #1429) has to be measured on er-dev
before it reaches production. Only a merge or a manual dispatch could
deploy it, and both ran the dev and prod jobs, so a dev-only release
needed a by-hand blue/green outside CI.

workflow_dispatch gains an `environment` input (both | dev | prod,
default both). Each job skips when the input targets only the other
environment. Merges are unchanged: they arrive through `images` and
deploy both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…conditions

The skills gate generates the deploy jobs' conditions into the
ci-and-supply-chain reference. The dispatch `environment` input changed
both, so the committed table was stale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@athvin
athvin force-pushed the ci/deploy-environment-input branch from 45cf668 to 8d7497a Compare December 3, 2026 00:37
@athvin
athvin merged commit 08d3314 into main Dec 3, 2026
38 checks passed
athvin pushed a commit that referenced this pull request Dec 3, 2026
…history

A dev-only release (#1545's `environment: dev`) pushes an er-api image
tagged with an unmerged commit. That image was then the newest in ECR,
so the next two frontend-only merges reused it for er-api, and the
staleness guard correctly refused because rust/** differs. Dev and prod
deploys failed for c7e8bc3 (run 47007375189) and f7ed273
(47009130317).

When a tree has no image for DEPLOY_SHA, take the newest tagged digest
whose tag is an ancestor of DEPLOY_SHA. If none qualifies, fall back to
the plain newest with a warning; the staleness guard still decides.

Replayed read-only against ECR: DEPLOY_SHA=c7e8bc3c now resolves er-api
to c26a1ae's digest and the guard verifies it (exit 0), where the old
script refused (exit 1). The candidate 93e43da still resolves its own
er-api tag directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin added a commit that referenced this pull request Dec 3, 2026
…history (#1552)

A dev-only release (#1545's `environment: dev`) pushes an er-api image
tagged with an unmerged commit. That image was then the newest in ECR,
so the next two frontend-only merges reused it for er-api, and the
staleness guard correctly refused because rust/** differs. Dev and prod
deploys failed for c7e8bc3 (run 47007375189) and f7ed273
(47009130317).

When a tree has no image for DEPLOY_SHA, take the newest tagged digest
whose tag is an ancestor of DEPLOY_SHA. If none qualifies, fall back to
the plain newest with a warning; the staleness guard still decides.

Replayed read-only against ECR: DEPLOY_SHA=c7e8bc3c now resolves er-api
to c26a1ae's digest and the guard verifies it (exit 0), where the old
script refused (exit 1). The candidate 93e43da still resolves its own
er-api tag directly.

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-ticket deliberately not tied to a board ticket; exempts the pull request contract

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants