Repository navigation
Description
Container changes get no automated signal until after they are merged and published. The merge that first builds an image is the same event that pushes :latest, which every consumer pins — so the window between "broken image built" and "broken image live in seven lecture repos" is zero.
Today
build-containers.yml:3-17 triggers on push to main (paths containers/**), the weekly cron, and dispatch. There is no pull_request trigger anywhere for container builds. Both build steps are push: true to a latest tag (:62/:70 and :104/:110).
test-container.yml:6-11 fires only on workflow_dispatch or a completed build run, and :33 hardcodes ghcr.io/quantecon/${{ matrix.image }}:latest — the smoke suite is structurally incapable of testing anything but an already-published image.
The action harness does not cover this and currently disguises it: test-actions.yml triggers on pull_request but never builds or pulls an image, and the gate's IGNORED regex (:112) does not list containers/. A containers-only PR therefore runs the full harness and reports the required check Action harness: all checks green, having asserted nothing whatsoever about the image. That is the "green that reads as coverage" defect #108 was filed about, relocated.
The exposure is not hypothetical: #28 (stack drift breaking lecture execution), #85 (kaleido/Chrome), #103 (publish pipeline) were all image defects, and Dependabot proposes conda and docker bumps against both container directories weekly with nothing validating them.
Phase 1 — validate on the PR
- On
pull_requesttouchingcontainers/**, detect which image directories changed and build only those, withcache-fromthe published:latestto keep it minutes rather than a cold hour - Push to a PR-scoped tag (
pr-<N>), never:latest, and run the existingcontainers/quantecon/tests/smoke-test.shagainst it in aneeds:job withcontainer: ghcr.io/quantecon/<image>:pr-<N> - Delete the PR tag when the PR closes
- Add
containers/to the harness relevance gate, or make the container job part of the required check, so a containers-only PR can no longer report green from jobs that never touched an image - Skip on forks (
github.event.pull_request.head.repo.fork == false) — do not reach forpull_request_target, see fix(preview): surface deploy errors, pin CLIs, remove unsafe fork guidance #105
Do not copy the shape the audit that prompted this suggested (push: false + load: true + docker run). A locally-loaded image cannot back a container: block, and docker run is the HOME=/root execution mode that #125 deliberately replaced — it is the reason #85 escaped the smoke tests in the first place. Pushing a PR-scoped tag keeps the real container: job semantics.
Phase 2 — gate the tag itself
Even with phase 1, the weekly cron and any direct push still move :latest before a test meets it. lecture-dp's weekly cache build crons at 0 2 * * 1, the same minute build-containers.yml does, against quantecon-build:latest.
- Publish only the
main-<sha>tag frombuild-containers.yml, run the smoke suite against that tag, and retag:lateston green
This is the same structural flaw that made action release-gating P0 (#135, #136, #138) — an artifact reaching consumers before anything verified it — applied to the container tag instead of the action ref. Worth sequencing after #136 so it reuses whatever that lands, and cheap now that smoke-test.sh exists and runs in minutes.
Related
#108 — this makes its fixture changes (theme, fontpkg) validatable on the PR instead of by manual dispatch. #100's coverage table should record that containers are covered post-merge only. #141 — the matrix that is currently the only post-publish safety net has been silently red for three weeks.
Activity
mmcky commentedon Nov 4, 2026
From the 2026-10-06 codebase review (finding H1; record:
.qe/dev/log/2026-10-06-codebase-review.md, #220).The review reached this issue's diagnosis independently, and its validation confirmed it against
build-containers.ymlat4550f69. These additions for phase 2 are not here yet:type=sha,prefix={{branch}}-givesmain-<sha>. A scheduled or dispatched rebuild of an unchangedmainoverwrites that tag, and its contents can differ between builds because apt, conda and pip packages are unpinned. Gate on a tag that cannot be reused, such as a dated tag plus the SHA.docker buildx imagetools create -t …:latest …@sha256:<old>is a rollback, but nothing records which digest was last good. CONTRIBUTING's Rollback section covers onlyv0.test-container.ymlthroughworkflow_callwith an image input, and remove itsworkflow_runtrigger, or it re-tests:latest.needs:the smoke test, that usesimagetools create, so the promoted digest is the tested digest.test-containers-lectures.ymltakes two hours or more perlecture-python.mystleg, it was red from mid-September until 🔴 CI failure: Test Container Builds #159 closed on 2026-10-05, and it has been red again since 2026-10-12 (🔴 CI failure: Test Container Builds #222). It fits better as a check after promotion than as the gate.#150's dispatch tag input for
test-container.ymloverlaps the mechanism.ci(containers): build and smoke-test a pull request's images before t…
docs(contributing): how to roll back a container image, and what stag…
ci(containers): build and smoke-test a pull request's images before t…
docs(contributing): how to roll back a container image, and what stag…
ci(containers): build and smoke-test a pull request's images before t…
docs(contributing): how to roll back a container image, and what stag…
docs(changelog): move #142's entries under [Unreleased]
ci(containers): build and smoke-test a pull request's images before t…
docs(contributing): how to roll back a container image, and what stag…
docs(changelog): move #142's entries under [Unreleased]
ci(containers): build and smoke-test a pull request's images before t…
7 remaining items
ci(containers): hash the dry run's manifest bytes exactly, and pin th…
ci(containers): move :latest only once main's build has passed the sm…
ci(containers): hash the dry run's manifest bytes exactly, and pin th…
ci(containers): move :latest only once main's build has passed the sm…
ci(containers): hash the dry run's manifest bytes exactly, and pin th…
ci(containers): move :latest only once main's build has passed the sm…
ci(containers): hash the dry run's manifest bytes exactly, and pin th…
ci(containers): move :latest only once main's build has passed the sm…
ci(containers): hash the dry run's manifest bytes exactly, and pin th…
docs(changelog): keep #142's entry under [Unreleased] after v0.16.0
Merge origin/main into ci/142-promote-tested-image
ci(containers): count the newer runs behind a cancelled build in a sc…
ci(containers): move :latest only once main's build has passed the sm…
docs(plan): #188 is closed; #282 and #291 join the open issues (#292)