Repository navigation
fix(ci): run each gate row replay on the source of its tree - #5362
Conversation
The fail-to-pass replay started the gate row of the base tree with the interpreter of the head checkout. Its editable install named the head src/, so the base run imported the head source. A fix that lists a new manifest in src/ then failed gate cases of check modules that it does not change. The replay script now puts the src/ of the tree that it runs in first on sys.path, as pythonpath = ["src"] does for the pytest replay. Refs #5353
Test resultsHead:
Replay of the head of #5357 with this fix
Before this fix, the same replay failed 5 of 114 cases on base, 4 of them in check modules that #5357 does not change. After the merge: the Fail-to-Pass Check of #5357After this pull request merges, the Fail-to-Pass Check of #5357 passes on a new run. The run must start from a new event (a push, an update of its branch from Render differenceThis change touches no path under |
Check resultsHead commit:
Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/43370224047/job/131703998598 Skipped check: Plan Check |
🤖 I have created a release *beep* *boop* --- ## [0.127.0](v0.126.1...v0.127.0) (2026-11-13) ### Features * **argocd:** admit the homelab repo in both AppProjects ([#5365](#5365)) ([f299667](f299667)), closes [#5364](#5364) ### Bug Fixes * **ci:** run each gate row replay on the source of its tree ([#5362](#5362)) ([67e7aba](67e7aba)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
The fixture of the #5362 test set PYTHONPATH to the src/ of the checkout only. In the Service image, the sitecustomize of the inherited PYTHONPATH gives the gate row pytest, so the row failed with "No module named 'pytest'" on both trees. The fixture now puts the src/ of the checkout first and keeps the inherited PYTHONPATH after it, as tests/commands/test_ci.py does.
`devops ci job-time` now fails only when the mean of the last 20 runs of `Tests & Coverage` on `main` is over 360 s: the 300 s target of AGENTS.md rule 5 and the 60 s of tolerance that the owner allowed on 2026-10-23. With `--file-issue`, the daily `Test Job Duration` job comments on the open alarm issue of the check, or files one with the Status New and the priority P0. The mean was 316 s because the split by lines put a short module with slow tests in one shard. The split now weighs each test module by its seconds in `tests/module_durations.json`, which the new `devops ci durations` writes from the JUnit reports of the shards. This builds the shard weights that #4250 asks for. The unused pytest-split pin goes. A fixture of #5362 keeps the inherited PYTHONPATH, which gives pytest in the Service image. Closes #5247 Change: `openspec/changes/archive/2026-11-13-5247-the-duration-alarm-fires-at-360/`
The fail-to-pass replay started the gate row of the base tree with the interpreter of the checkout that runs the command. The editable install of that interpreter names the src/ of that checkout, so the base run imported the head source on the manifests of the base. A fix that lists a new manifest in src/, as the fix of #5306 does, then failed gate cases of check modules that it does not change, and the check exited 1.
The gate row script of the replay now puts the src/ of the tree that it runs in first on sys.path, as pythonpath = ["src"] of pyproject.toml does for the pytest replay. So the base run imports the base source, and the head run imports the head source. The script sets the path because run_subprocess refuses a caller PYTHONPATH, and that security refusal stays. The rows of devops ci keep their script: uv run already imports the source of their checkout.
Closes #5353
Change:
openspec/changes/archive/2026-11-13-5353-fail-to-pass-gate-replay-imports/