The accessibility gate was shallowing this checkout, and five tests about tags paid for it - #74
Merged
Merged
Conversation
…bout tags paid for it On a pull_request run, Playwright's git-info plugin calls gitDiff, which begins with `git fetch origin <pr base sha> --depth=1` (node_modules/playwright/lib/runner/index.js). tools/a11y_browser runs with its working directory inside this work tree, so --depth=1 wrote .git/shallow at the repository root naming main's own tip. tests/test_release_claims.py then refused to read the tag list, which is the right refusal, and `make verify` failed on branches whose diffs had nothing to do with tags, releases or accessibility. It read as intermittent because it was a race: whether it fired depended on whether `pytest -n auto` scheduled tests/test_a11y_browser_gate.py before the release-claims tests. Measured on a runner on 2026-09-06, on a pull_request event, with fetch-depth: 0 and no --depth anywhere in the checkout's own fetch: .git/shallow absent after checkout, absent after `make browser-sync`, present the moment that one test module ran, holding d4f533f, the base SHA. Bisected by running each subprocess-invoking test module alone. playwright.config.ts now declares captureGitInfo with both halves false; Playwright reads an undeclared half as "capture when this looks like CI", so unset is not off. harness_env also strips GITHUB_ACTIONS, GITHUB_EVENT_PATH, GITLAB_CI and JENKINS_URL, because the plugin keys off those rather than off CI, which is why setting CI to "" did nothing. tests/test_browser_gate_touches_no_git.py holds both halves, and sets each variable before checking it is gone so it is not asserting an absence that was never there.
This was referenced Sep 7, 2026
ChelseaKR
added a commit
that referenced
this pull request
Sep 7, 2026
… the checkout The previous run failed on tests/test_release_claims.py because tools/a11y_browser wrote .git/shallow into the work tree. That is fixed on main (PR #74). A re-run replays the merge commit recorded when the run was created, which predates the fix, so this asks for a fresh one.
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.
What was wrong
Every open pull request in this repository was red on the same five tests, none of which
had anything to do with the changes under review:
The message names a cause it did not measure.
fetch-depth: 0is set on theverifyjob, the logged fetch carries no
--depth, and the same refspec reproduced locally ongit 2.55.0 produces a clone that is not shallow. Something else was shallowing the
checkout after
actions/checkoutfinished with it.It is
tools/a11y_browser. On apull_requestrun Playwright's git-info plugin callsgitDiff, andgitDiffopens with:The harness's working directory is inside this work tree, so
gitDirresolves to therepository root and
--depth=1writes.git/shallowthere, holding the pull request'sbase SHA.
tests/test_release_claims.pythen refuses to read the tag list — which is thecorrect refusal, and the reason that file exists: a shallow checkout cannot tell an
untagged repository from an unfetched one, and this project has no tags, so "none found"
read as "none exist" would be a vacuous pass.
It read as intermittent, and it was a race. Whether it fired depended on whether
pytest -n autohappened to scheduletests/test_a11y_browser_gate.pybefore therelease-claims tests. Pushes to
mainwere unaffected — with no PR base SHA there isnothing to fetch — so
mainstayed green while pull requests failed at random. That isthe worst shape for a CI defect: it looks like flake, and the branch it lands on looks
guilty.
Measured
On a runner, on a
pull_requestevent, via a throwaway diagnostic branch (deleted):git rev-parse --is-shallow-repositoryactions/checkout(fetch-depth: 0, no--depthin its fetch)false, no.git/shallowmake lock-check sync node-syncfalse, no.git/shallowmake browser-syncfalse, no.git/shallowpytest tests/test_release_claims.pyalone18 passed-n autotrue,.git/shallow=d4f533f, the base SHAThen bisected by running each subprocess-invoking module on its own:
What changed
tools/a11y_browser/playwright.config.tsdeclarescaptureGitInfo: { commit: false, diff: false }. Playwright reads an undeclared halfas "capture when this looks like CI", so leaving it unset is not the same as off. This
harness reads static pages off disk as
file://URLs; it has no reason to read git atall, and none to write to it.
tests/test_a11y_browser_gate.pyhands the harness an environment withGITHUB_ACTIONS,GITHUB_EVENT_PATH,GITLAB_CIandJENKINS_URLremoved. Theexisting
CI: ""did nothing, becauseciInfo()keys off those names rather than offCI— that is exactly why the first obvious fix in the file had already failed toprevent this.
tests/test_browser_gate_touches_no_git.pyis new and holds both halves.CHANGELOG.mdunder[Unreleased].Both fixes are kept, deliberately: the config is the durable one (it holds for
npm testand for a maintainer running the harness by hand), the environment scrub is the one a
Playwright default cannot silently undo at the next version bump.
How it was verified
827 passedlocally (-n 2; the two browser specs skip without the Playwright browserbinary, and CI runs them).
ruff checkandruff format --checkclean.Each control was run against the fault it exists to catch, with the sabotage asserted
present in the file before the result was read:
captureGitInfo: { commit: false, diff: true }grep -n captureGitInfoshoweddiff: true…captures_no_git_info[diff]FAILEDcaptureGitInfoline deletedgrep -c captureGitInfo→0[commit]and[diff]both FAILEDharness_envreturnsdict(os.environ)grep -nshowed the replacement line…not_told_it_is_running_in_ciFAILEDRestored from byte copies (SHA-256 compared against the pre-sabotage copies),
7 passed.The environment control sets each variable before checking it is gone. Asserting that
GITHUB_ACTIONSis absent from an environment that never had it is an assertion thatcannot fail, and this repository has an ADR about that.
What this does not do
It does not change
tests/test_release_claims.py. That test was right and its refusal wasright; the only thing wrong with it is that its message names
actions/checkoutas thecause when the checkout was innocent. Rewording it would be a separate, smaller change and
is left out so this one stays reviewable.
Two open pull requests, #70 and #71, were red on this alone.
Prepared with AI assistance; reviewed before submission.