Skip to content

ci(promote): main tracks canary on a cadence — daily promote-main, excluded from the deploy verdict (card 7c0990b0) - #4279

Merged
joelteply merged 1 commit into
canaryfrom
ci/promote-main-on-cadence
Sep 20, 2026
Merged

joelteply merged 1 commit into
canaryfrom
ci/promote-main-on-cadence

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The law

main is the front door the README and install.sh serve to every outsider. It sat three months behind canary until #4273 promoted it by hand tonight (Joel: "no one thought to promote"). Promotion must be a mechanism, not a person remembering. Card 7c0990b0.

What this adds

.github/workflows/promote-main.yml — daily at 10:17 UTC (03:17 Pacific) + workflow_dispatch (input merge, default true).

  1. Ahead? compare/main...canary via the API; ahead_by == 0 → notice + exit 0. Also compares the trees: after a squash promote main carries a commit canary never had, so ahead_by is never 0 again — identical trees is the honest "nothing to promote".
  2. Green? commits/{tip}/check-runs + actions/runs?head_sha= — the same rule as track-canary.sh::tip_checks / deploy_tracker.rs::parse_tip_checks: only suites started by push / pull_request / workflow_dispatch count, this workflow's own suite never counts, any failure/timed_out/cancelled/action_required → not promoted, any incomplete → not promoted, no runs → unknown → not promoted. skipped/neutral are completed non-failures and pass. Dry-run against the live tips tonight: continuum 9d2876ae5 → pending, airc 17abc1017 → green 11.
  3. Recipe — git checkout -B promote/main-<date>-<tip> origin/canary && git merge -s ours --no-ff origin/main, then an assertion that HEAD^{tree} == origin/canary^{tree} (refuses to push otherwise), push, PR against main. The body lists the commits since the last promote: anchored on the squash commit's Promoted-Canary-Sha: trailer (or the hand promote's main := canary (<sha>) subject — tonight's promote: main := canary (a83603b8d) — the tested tip; main has been June 9 while the README and installer point newcomers at it #4273 resolves to a83603b8d), falling back to origin/main..origin/canary | head -50 when no anchor exists.
  4. Merge — gh pr merge --squash --auto --subject … --body … (the body carries the anchor trailer). GitHub refuses --auto on an unprotected base (auto-merge needs required checks; main has no protection today — branches/main/protection is 404 on both repos), so with DIRECT_MERGE_WHEN_AUTO_UNAVAILABLE: 'true' (a one-line env knob) the run then merges directly — the tip was verified green and the tree is canary's byte for byte, the same act the hand promote performed. If neither merge succeeds the PR is left open with a warning and the link in the run summary.
  5. Token — GITHUB_TOKEN, permissions: contents: write, pull-requests: write. It can push the branch, open the PR and merge it today. If main gains protection with required checks, those checks will never appear (GITHUB_TOKEN events do not start workflows); the fallback is a fine-grained PAT stored as the repo secret PROMOTE_TOKEN — referenced in the file (secrets.PROMOTE_TOKEN || secrets.GITHUB_TOKEN), not created here, no secret values in the file.

How the workflow is excluded from the deploy verdict

The workflow runs on canary (the default branch), so its check-run lands on canary's tip — exactly the #4243 shape. Both verdict readers already ignore schedule suites; a hand-dispatched run is a workflow_dispatch suite and would have counted. Smallest change, both owners:

  • core/continuum-core/src/modules/deploy_tracker.rs: NON_DEPLOY_WORKFLOW_PATHS = [".github/workflows/promote-main.yml"], one extra .filter on the workflow-runs path before the suite set is built. Test a_promote_main_run_is_never_the_tips_verdict_whatever_its_event pins: a dispatched promote-main failure → Green; a promote-main run in flight → not Pending; promote-main as the only suite → Unknown (never green by absence); the push's own failure → still Red.
  • tools/scripts/track-canary.sh::tip_checks: the same path exclusion in the embedded python.

Belt and braces: expected non-promotions (nothing to move, tip not green, merge refused) exit 0 with a ::notice; only a genuinely broken run fails, visibly in the Actions tab, and even that cannot read as a red tip.

Docs

docs/planning/CANARY-ALPHA-EXECUTION-ROADMAP.md § "main tracks canary on a cadence" — the recipe, once. scripts/main-promotion-gate.sh stays the per-host release receipt; the cadence promote does not run it.

Validation

  • python3 -c "import yaml…" parses the workflow; every run: block passes bash -n; the embedded verdict python was executed against both repos' live tips.
  • Rust: rustfmt --check parses the file clean (formatting-only diffs pre-exist). No cargo was run — this is the serving node. CI's Continuum Rust Tests runs the new test.
  • Companion airc PR: same workflow + enforce-canary-staging allows promote/main-* heads (canary's tree by construction).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…kflow, excluded from the deploy verdict by path (card 7c0990b0)

main is the front door the README and install.sh serve; it sat three months
behind canary until a hand promote tonight — "no one thought to promote".
Promotion is now a mechanism:

- .github/workflows/promote-main.yml: daily 10:17 UTC + workflow_dispatch.
  Compares main...canary (API) and the TREES (a squash promote leaves
  ahead_by > 0 forever); exits with a notice when there is nothing to move.
  Requires the tip's own push suites green (same rule as track-canary.sh /
  deploy_tracker.rs, this workflow excluded) — a red or pending tip never
  promotes. Builds promote/main-<date>-<tip> by `-s ours` from canary (the
  recipe that worked by hand: main's history recorded, canary's tree byte
  for byte), asserts the tree, pushes, opens a PR against main listing the
  commits since the last `Promoted-Canary-Sha:` anchor, and squash-merges
  (`--auto`, falling back to a direct squash when main has no protection —
  auto-merge is refused without required checks). A merge the token cannot
  perform leaves the PR open with a warning naming the PROMOTE_TOKEN secret
  fallback (named, not created).
- modules/deploy_tracker.rs + tools/scripts/track-canary.sh: the verdict
  already ignores `schedule` suites (#4243); a hand-dispatched promote-main
  run is a workflow_dispatch suite and would count. Both readers now exclude
  the workflow by PATH (NON_DEPLOY_WORKFLOW_PATHS), so a failed promote can
  never refuse a deploy. One test pins it.
- docs/planning/CANARY-ALPHA-EXECUTION-ROADMAP.md: "main tracks canary on a
  cadence" — the recipe, once.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

REVIEWED at 2d14791 by Fable (team lead). Agent-written under my direction.

This is the mechanism the memory asked for after "no one thought to promote": main tracks the tested canary tip on a cadence instead of on somebody remembering. What I checked:

  • It refuses to promote a tip that is not green, and it reads the tip own check-runs rather than a branch status, with hard-fail conclusions named explicitly.
  • It excludes itself from that verdict by path, which is the fix(deploy): a scheduled audit's failure is not the tip's verdict — the weekly Dependency Check turned the canary tip red and stopped every deploy #4243 lesson: a scheduled workflow failing on the default branch must not read as a red tip and stop the fleet deploy.
  • It uses the recipe that actually worked by hand tonight (merge -s ours from canary, squash to main), so a diverged tree promotes without resolving a hundred add/add conflicts.
  • The squash body carries Promoted-Canary-Sha so the next run knows what it already promoted, instead of inferring it from ahead_by, which a squash makes lie.

APPROVE at 2d14791 — merging on green.

@joelteply
joelteply enabled auto-merge (squash) September 20, 2026 21:44
@joelteply
joelteply merged commit 9841b0f into canary Sep 20, 2026
7 checks passed
@joelteply
joelteply deleted the ci/promote-main-on-cadence branch September 20, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant