Repository navigation
Description
Decision from the consumer side: a red canary should block a release. The lecture family wants quantecon/actions verified green — within the bounds of current testing — before a release is published, and is sequencing its move to floating @v0 behind that. Consumer-side context in QuantEcon/workspace-lectures#33; this issue is the implementation.
This is stage 4 of #100, plus the thing #100 did not specify: how a gate is supposed to work when the canary is pinned to the very tag the release moves.
The blocker: the canary cannot gate a release as built
Every one of the canary's action references is @v0:
| Ref | Count in test-actions-lecture-intro |
|---|---|
build-lectures@v0 |
6 |
build-jupyter-cache@v0 |
1 |
restore-jupyter-cache@v0 |
1 |
preview-netlify@v0 |
1 |
publish-gh-pages@v0 |
1 |
v0 is what a release moves. So the canary always exercises the previous release, never the candidate — it is a post-release regression detector, and no amount of scheduling changes that. "Green before we release" is not expressible against it today.
Two further facts shape any fix. GitHub does not allow expressions in uses:, so a ref can never be parameterised. And build-jupyter-cache reaches its siblings at a hardcoded @v0 — setup-environment@v0 at action.yml:149 and build-lectures@v0 at :164, :174, :184.
Proposal: a v0-next staging tag
Add a second floating tag that always points at the release candidate, and give the canary a workflow set pinned to it. The release then becomes:
- move
v0-nextto the candidate commit; - dispatch the canary's
v0-nextworkflows; - green is a precondition for step 4 — red stops the release;
- move
v0to the same commit.
This works precisely because it does not need parameterised refs: @v0-next is as static as @v0. It costs a duplicate workflow set in the canary, which is the price of the uses: constraint rather than a design smell.
What it gates, and what it cannot
Gated — every action the canary calls directly, which is the whole publish path and the highest-consequence surface:
publish-gh-pages, preview-netlify, build-lectures, restore-jupyter-cache, setup-environment.
Not gated — the build-jupyter-cache sibling chain. A build-jupyter-cache@v0-next run still executes setup-environment@v0 and build-lectures@v0, i.e. the previous release's siblings. The candidate's cache action is tested against stale siblings, so the pairing that consumers will actually run remains untested until after v0 moves. That is the structural limit named in #100 and this proposal does not remove it; it narrows the ungated surface to one action's internal chain.
Worth stating plainly so the gate is not over-trusted: "100% before release" will mean "everything except the build-jupyter-cache sibling chain", unless that chain is addressed separately (see below).
Options for the residual, not recommended unilaterally
- Rewrite sibling refs at release time. A release step rewrites
@v0→ the candidate SHA inbuild-jupyter-cache/action.ymlon the tagged tree. Fully self-consistent and testable, but the tagged tree then differs frommain, which is a real cost to reasoning about the repo. - Accept it, and lean on cadence. The cache path already has the longest post-release lead of any consumer path — the canary's weekly build runs Sunday 03:00 UTC against lecture repos' Monday 02:00/03:00 UTC. Combined with rollback, exposure is bounded to roughly a day.
Work
Gate mechanism
- Introduce the
v0-nexttag and document its meaning alongsidev0 - Add a
v0-nextworkflow set toQuantEcon/test-actions-lecture-intro - Add a release step that moves
v0-next, dispatches the canary, and requires green beforev0moves - Document the rollback:
v0is movable, so recovery from a bad release isgit tag -f v0 <previous>. Write it down before it is needed, with who is expected to act
Close the ungated consumer paths (these matter whether or not the gate lands, since they are also the post-release safety net)
- Schedule the canary's
ci.yml— the preview path currently runs only when a human opens a PR in the canary (last: 2026-08-05, before that 2026-07-15) - Schedule the canary's
publish.yml, and give it aworkflow_dispatch— it currently has neither, so it cannot even be run by hand - Keep any canary schedule strictly ahead of consumers' Monday 02:00/03:00 UTC cache builds
Prove the gate is real
A gate that has never been exercised is not a gate, and this repo has precedent on both halves: the container smoke tests could not fail for three independent reasons and still reported green (#108), and the canary failed eight consecutive weeks (2026-02-22 → 2026-04-12) filing zero issues (#83).
- Self-test the gate — stage a deliberately broken candidate, confirm the canary goes red and the release is actually stopped, then revert
- Confirm a red canary reaches a human, separately from the above. The eight silent weeks were failures that alerted nobody
Open questions
| Question | Why it matters |
|---|---|
| Is the release blocked automatically, or by convention in the runbook? | There is no release automation here today — v0 is moved by hand — so "blocked" may initially mean a documented step rather than an enforced one |
Does v0-next also get a scheduled canary run, or only on release? |
Only-on-release is cheaper; scheduled would catch drift on main between releases |
Is the build-jupyter-cache residual acceptable? |
It decides whether "100%" is qualified or whether the ref-rewrite option is worth its cost |
Related
- testing: publish/preview/cache action logic has no automated tests #100 — testing; this is its stage 4 and the gating design it left open
- build-jupyter-cache: container-mode failures are silent, undebuggable, and use unpinned sub-actions #83 — the two-month silent alerting failure behind the "prove it reaches a human" item
- test: unify container smoke tests and make the fixture exercise the Dockerfiles #108 — the smoke tests that could not fail; precedent for self-testing the gate
- QuantEcon/workspace-lectures#33 — the consumer-side plan, blocked on this
- QuantEcon/workspace-lectures#31 — the lecture-family CI migration this unblocks
Activity
README: state the sandbox role, and why this repo is not the release …
mmcky commentedon Aug 11, 2026
Sequenced under #138, the tracking issue for the gating work — it holds the order, the definition of done, and the open decisions. This issue keeps the design detail; #138 does not duplicate it.
PLAN.mdnow carries the same work as backlog items 0a–0d at P0 (#137).PLAN: add release gating as P0, correct the consumers table (#137)
docs(plan): refresh to v0.11.1 and disposition the whole tracker
docs: 2026.06 baseline, measured image sizes, and READMEs reconciled …
docs(plan): refresh after v0.12.0 closed the July 2026 audit; finish …
docs: correct the statements the #143 spike disproved (#211)
pull_requeston request, and report whether anything was deployed #227mmcky commentedon Nov 4, 2026
From the 2026-10-06 codebase review (finding H2; record:
.qe/dev/log/2026-10-06-codebase-review.md, #220).Input for #138's open decision on whether the
build-jupyter-cacheresidual is accepted or worth the ref rewrite. This issue frames the residual as release gating. Since decision 1 on #143 (2026-11-04), the gate is agate.ymlin the canary with nov0-nexttag, and it can test the candidate's own sibling chain by rewriting the fouruses:lines at test time, as the #143 spike did. The review found a consumer-facing side that a test-time rewrite does not reach:uses:is resolved when the job runs. So pinningbuild-jupyter-cacheto an exact tag or a commit does not pinsetup-environmentorbuild-lectures(build-jupyter-cache/action.yml:216,:232,:242,:252): they followv0. Because 0.x minor releases may break, an exactly pinned cache build can break whenv0moves.CONTRIBUTING.md:36andREADME.md:181offer exact pins as "maximum reproducibility".docs/user/actions/build-jupyter-cache.md:129says this action followsv0for its siblings. A one-line caveat in the version tables should land whichever way Tracking: release gating — get to a candidate that is verified before v0 moves #138 decides.main;quantecon/actions/…@v0remains in a tagged tree.Impact as of 2026-10-06 is nil: every
build-jupyter-cacheconsumer is on@v0, and every exact pin is on an action that calls no sibling. #83 part 1 asked for the same hermeticity. It was marked resolved by the earlier move of the refs from@mainto@v0(#83 closed with #122), which met half of the ask.mmcky commentedon Nov 4, 2026
Re-scoped, 2026-11-04, following the decisions on #143: no
v0-nexttag. The gate is agate.ymlin the canary. It takes the candidate commit as aworkflow_dispatchinput, accepts only commits reachable frommainor av*tag of this repo (checked before any secret is read), checks the candidate out, and runs the actions through localuses: ./actions-repo/<action>paths. In the gate run, the four nesteduses:lines inbuild-jupyter-cacheare rewritten to local paths, so its sibling chain is also tested at the candidate, whichv0-nextcould not do. Deploy secrets live in a canary environment that only the canary'smaincan use. Builds are frozen (committed image digest, cold, intersphinx off).publish-gh-pagesis included and redeploys the canary's own Pages site.Release flow: dispatch the gate on the candidate, require green, then move
v0. Until the gate exists, releases stay staged by hand (CONTRIBUTING, Staged Releases).One work item is already done: the rollback is documented in CONTRIBUTING (Staged Releases → Rollback). This issue is now blocked by #227 (the preview opt-in deploy, for the preview leg) as well as by #136 (the fixture).
Posted by Claude Code (on behalf of mmcky), from the 2026-11-04 decision session.
[-]Release gating: require a green canary before v0 moves (adds a v0-next staging tag)[/-][+]Release gating: a gate.yml in the canary tests the candidate before v0 moves[/+]docs(plan): catch up with the v0.12.0 follow-ups and the 2026-11-04 d…
docs(plan): catch up with wave 1 and the v0.13.0 and v0.14.0 releases (…
docs(plan): catch up with wave 1 and the v0.13.0 and v0.14.0 releases (…
mmcky commentedon Nov 10, 2026
Issue check, 2026-11-10, against
mainata8a4eca. The re-scope of 2026-11-04 holds, and #240 (v0.14.0) removed the last blocker: both preview actions takedispatch-aliasand reportdeployed.Re-checked.
build-jupyter-cachestill calls its siblings at@v0four times, now ataction.yml:254,:270,:281and:292. The canary'srelease-gateenvironment allowsmainonly and holds the four gate-only secrets. The canary'sci.ymlnow hasworkflow_dispatchbut passes nodispatch-alias, so a dispatch deploys nothing, andpublish.ymlstill runs only on apublish*tag. The rollback is documented in CONTRIBUTING.The design.
gate.ymlis dispatched withcandidate, a commit SHA or av*tag of this repository, andself-test:off,build-failsornothing-deployed. A first job with no secret resolves the candidate to one SHA, and refuses it unless it is reachable frommainor av*tag; every later job checks out that SHA. A cache job runsbuild-jupyter-cachecold with all three builders, after rewriting every nesteduses: quantecon/actions/…to a local path and failing if any is left. Two site jobs restore that run's caches, one the execution cache as the templates'ci.ymldoes and one the build cache as the canary'sci.ymldoes, and build the HTML. The deploys run in jobs of their own that execute no notebook. The previews deploy underrelease-gatetodispatch-release-gate, and the job assertsdeployedand that each URL serves a marker holding the candidate's SHA, compared by content, since a Cloudflare preview answers every path (#291). Pages deploys undergithub-pages, in thepagesconcurrency group, with the same marker check. A last job passes only if every job passed.A red reaches a person: the release procedure waits on the run and moves
v0only on green, and a red run frommainopens or comments on one canary issue assigned to whoever dispatched it. Thebuild-failsself-test onmainshows both.The release procedure. For a release that changes an action, the gate replaces the
cache.ymldispatch, thepublish-*tag and the generic part of the canary PR. A canary PR, or a throwaway workflow, stays only for what a fixed gate cannot reach: a preview's pull-request half, a standard-runner install, or a release's own scenario. The lecture-matrix condition for movingv0is unchanged. The first release after the gate lands runs both, once.Not covered, stated up front: how consumers fetch the actions by tag;
build-jupyter-cacheas shipped, since the gate runs a copy with its nested lines rewritten; standard-runner installs (setup-environmentoutside a container,setup-latex);deploy-cloudflare; and the previews' pull-request half (thepr-<N>alias, change detection, the comment), which the harness tests against stand-ins. The comment of 2026-11-04, on exact pins ofbuild-jupyter-cachenot being hermetic, is not addressed here.How it is shown. Up to the deploys, on a canary branch, where the deploy jobs are refused by the environments' branch rules, so a branch run is always red. Then, after the merge, a green run on
main, and both self-tests red.The maintainer's decisions, 2026-11-10, taken one at a time, each as recommended:
candidatetakes a full SHA or av*tag name, resolved once.self-testisoff,build-failsornothing-deployed, and the preview alias isdispatch-release-gate;ci.ymlandpublish.yml, is not in this wave. It is revisited once the gate has replaced the generic hand-staged legs.Claude Code (on behalf of mmcky), organiser session; the check by the mini:actions-gate session
ci(containers): keep the release gate's pinned quantecon-build digest (…
gate: the release gate's fixture, a book built only by gate.yml (Quan…
gate: the release gate's fixture, a book only gate.yml builds (QuantE…
ci: gate.yml, the release gate, tests a QuantEcon/actions candidate b…
docs: releases pass the release gate before v0 moves (#135, #136) (#301)
mmcky commentedon Nov 10, 2026
The release gate is live:
gate.ymlin the canary, from QuantEcon/test-actions-lecture-intro#85 with a docs follow-up in QuantEcon/test-actions-lecture-intro#87. #301 makes it part of the release procedure in CONTRIBUTING's Staged Releases, and describes it in TESTING and PLAN.Its runs on the canary's
main:v0points: green (run 42769820139).nothing-deployed: red at the preview deploy, and it opened arelease-gateissue assigned to the dispatcher (run 42770761791).build-fails: red at the cache build (run 42773299612).fae622c(run 42776388278).What remains of release gating, PLAN's P0 item 0c, stays on #138. Closing as done.
Claude Code (on behalf of mmcky)