Repository navigation
test(ci): skip the smoke matrix when no script can be affected (tier 1) - #220
Merged
Merged
Conversation
`smoke-tests.yml` had exactly one reason to skip: a docs-only diff. Anything else ran the full curated smoke list whatever it touched — ~11m20s in `autolens_workspace_test` (~17 runs/week), ~8m40s in `autolens_workspace` (5.8 runs/day). `smoke_tests.txt` already records the failure mode on the 2026-08-22 disable of a jax_likelihood entry: "Hit 4/4 jobs ... whose diff touches no script this gate runs." Add a second reason, classified from the SAME `$files` list the docs-only pass reads: `no_smoke_relevant_changes`. A smoke entry is a path in `smoke_tests.txt` / `smoke_notebooks.txt`, resolved under `scripts/`, run with the workspace's `config/` and the ceremony that `.github/` supplies — so a diff touching none of those cannot change what any smoke script does. The two flags are independent and ORed in the `smoke` job's `if:`; a docs-only diff satisfies both, which is fine. Fail closed, exactly as the docs-only gate is: the new flag is initialised `false` BEFORE the guard, so no base sha, the all-zero sha, an unfetchable base, an empty diff or a single relevant path all leave the matrix running. The two-dot diff against the base TIP is unchanged and not re-derived — one diff, two verdicts — so upstream drift still shows up as extra files and conservatively runs everything. Gated to `pull_request` inside the classify step, so the output itself means "a skip is warranted" rather than needing a second condition to be read correctly. `config/repos.yaml` lists "Smoke Tests" under `required_workflows` for the workspace groups; `ci_status` reads its conclusion on the `main` HEAD commit and only an explicit `success` rolls up green. Narrowing the PR side is free — Heart never reads it — so the saving is taken there and only there, and push-to-`main` behaviour is byte-for-byte what it was. The skip stays INSIDE the workflow rather than moving to `on.pull_request.paths`: a path-filtered job reports no conclusion at all and a required check would sit pending forever, where a skipped job reports `skipped`, which satisfies required-check semantics. Tests run the step's own `run:` body against a synthetic diff with only `git` stubbed, so the `case` glob lists are executed rather than string-matched: the relevant-path table, the mixed diff at every position, both fail-closed bases, the empty diff, the `pull_request` gate on three other events, the untouched docs-only verdict, and the step summary. Verified against both caller shapes: `autolens_workspace` and `autolens_workspace_test` ship byte-identical `smoke_tests.yml` callers (blob 6578926), declaring only `chain:`, consuming no output of the reusable workflow and running no job downstream of the matrix. Neither passes an input this change invalidates and neither depends on the matrix always running. Tier 2 (narrowing the entry list to the packages the diff touches) needs the selected set passed down to each workspace's vendored `run_smoke.py` and is deliberately left to its own prompt. Closes #219 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qr64vy2ZcjjxaS7jSpH5eM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #219.
Summary
smoke-tests.yml— the reusable workflow every workspace'ssmoke_tests.ymlcalls — had exactly one reason to skip its matrix: a docs-only gate. Anything else ran the full curated smoke list, whatever it touched, so a one-character change to any non-markdown file cost the full run (~11m20s inautolens_workspace_test, ~8m40s inautolens_workspace). The repo already records the failure mode, insmoke_tests.txton the 2026-08-22 disable ofmulti_dataset/jax_likelihood/mge.py: "Hit 4/4 jobs (3.12 and 3.13, twice each) on autolens_workspace_test#261, whose diff touches no script this gate runs."This adds a second reason:
no_smoke_relevant_changes. A smoke entry is a path insmoke_tests.txt/smoke_notebooks.txt, resolved underscripts/, run with the workspace'sconfig/and this workflow's own ceremony — so a diff touching none of those, nor.github/(the vendored runner and the caller workflow), cannot change what any smoke script does.Tier 1 only. Tier 2 — narrowing the entry list to the packages the diff touches — needs the selected set passed down to each workspace's vendored
run_smoke.pyand is deferred to its own prompt.API Changes
None. No workflow input was added, removed or re-typed: the change is one
envkey (EVENT_NAME), one job output, and one clause on thesmokejob'sif:. Callers are unaffected — see the caller verification below.Design notes worth reading before review
git diff --name-onlystill appears exactly once; the new pass re-reads the same$fileslist. One diff, two verdicts, so they cannot disagree about what changed — and a test pins that.pull_requestonly, gated inside the step, not on thesmokejob'sif:. This is the load-bearing half.config/repos.yamllists"Smoke Tests"underrequired_workflowsfor the workspace groups;ci_status.rollup's own docstring says all required must be "present, completed, success and on HEAD" to returnsuccess, and "otherwise ... an unknown, never a green". So askippedrun onmainwould not RED (skippedis not inFAILURE_CONCLUSIONS), but it would leave readiness permanently unable to reach GREEN — whilecancelledwould RED outright. Narrowing the PR side is free because Heart never reads it; narrowing themainside would cost the readiness gate its signal. Push-to-mainbehaviour is byte-for-byte unchanged, and the docs-only gate was deliberately not narrowed topull_requestalong with it. The gate lives in the step rather than theif:so the published output means "a skip is warranted", instead of being true-but-inapplicable on a push.falsebefore the$BASEguard, so every early exit runs everything. The step's realrun:body was executed with onlygitstubbed — itsfetchexit status and--name-onlyoutput being the two facts the guard reads — and both flags come backfalse, with an empty step summary, for: an empty$BASE; the all-zero SHA; a failinggit fetch; an empty diff. A single relevant path in an otherwise irrelevant diff also yieldsfalse, tested at every insertion position since the loop breaks on first match.merge-baseappears nowhere. Upstream drift on the base branch still shows up as extra files and conservatively runs the matrix.on.pull_request.paths— a job filtered out that way reports no conclusion at all and a required check sits pending forever. The job header comment now says so explicitly.elif, so one reason is printed per run; docs-only is the narrower one and wins when a diff satisfies both.Test Plan
python3 -m pytest -q -n autofrom the worktree: 965 passed, 0 failed, 0 skipped (5.2s). Run independently by the implementing agent and again by the architect session — same result.tests/test_workflow_wiring.py— the existing docs-only assertion (which compared theif:string by equality) generalised to both gates, plus a new test that both skip reasons are published as job outputs.tests/test_smoke_tests_wiring.py— 11 new test functions / 25 node ids that execute the predicate rather than pattern-match the YAML: a_classify()helper runs the step's ownrun:body underbash -e(GitHub's shell) against a synthetic diff, following the repo's existingsubprocess.run(["bash", …])convention fromtest_verify_install_script.py. Covers the 8-path relevant table, 4 irrelevant diffs, the mixed diff at every position, the three unresolvable bases, the empty diff, thepull_requestgate onpush/workflow_dispatch/schedule, the docs-only verdict staying unchanged (alone and with a config sidecar), env-vs-interpolation, single-diff/no-merge-base, and the step summary's content.autolens_workspaceandautolens_workspace_testship byte-identicalsmoke_tests.yml(same blob SHA65789266). Each declareson: push: branches: [main]+pull_request;concurrency: smoke_tests-${{ github.ref }}withcancel-in-progress: ${{ github.ref != 'refs/heads/main' }}— whose own comment already records thecancelled-is-in-FAILURE_CONCLUSIONSreasoning this change is consistent with; and one job calling this workflow withchain:andsecrets: inherit. Neither passes an input this change invalidates, neither reads any output of the reusable workflow, and neither declares a job downstream of the matrix, so a skipped matrix has no dependant. Thepull_requestgate lands correctly for both: a called workflow inherits the caller'sgithubcontext, which this very step already proves —github.event.pull_request.base.sharesolves off the caller's event today.Acceptance, against the issue
README.mdplus a config sidecar still skips — via the unchanged docs-only path. ✔scripts/,config/,smoke_tests.txt,smoke_notebooks.txtor.github/now skips. ✔Smoke Testscheck reportsskipped, not pending, on every skip path — the gate is inside the workflow. ✔main-push runs are unchanged and Heart'sci_statusstill reads a real conclusion. ✔Validation checklist (--auto run — plan was not pre-approved)
Autonomy: safe, cap: test → safe)pyauto-brain vitalsreportsCI unavailable (query failed)for all 17 repos because this container's egress proxy serves no REST repo paths, so the documented fallback applies and the worktree suite is the gateShipped as member 3 of the
ci-smokebundle; one PR per task, closed out by/prmunchanged.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Qr64vy2ZcjjxaS7jSpH5eM
Generated by Claude Code