Skip to content

fix(ci): run each gate row replay on the source of its tree - #5362

Merged
dan-petty merged 2 commits into
mainfrom
fix/5353-gate-replay-base-source
Nov 13, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/5353-gate-replay-base-source

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

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/

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
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners labels Nov 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results

Head: 4821fa23c, rebased onto origin/main 54cf0a526.

  • Red first: on the replay code of origin/main, test_a_gate_row_on_the_base_tree_imports_the_source_of_the_base_tree fails with probe gate row: 2 of 2 cases failed on base, 0 of 2 on head and A gate case of a check module that the fix does not change fails on base (probe listed.check_each_listed_manifest_exists). This is the form of the CI log of fix(k8s): allow only the Ingress origins in Open WebUI #5357.
  • uv run devops ci test tests/ci/test_fail_to_pass.py: 57 passed.
  • uv run devops ci test tests/ci tests/roadmap/implement/test_roadmap_implement_step_fail_to_pass.py and the invariants hermetic_floor, living_specs, change_folders, architectural_invariants: 349 passed.
  • uv run devops ci --check --only lint,format,domain,docs,typecheck,constructs,swallowed-failures,test-tree,test-settings,openspec: all pass (mypy strict pass).
  • uv run devops ci fail-to-pass --base origin/main: exit 0. 2 failed on base in tests/ci/test_fail_to_pass.py: the new test and test_the_command_exits_0_for_a_gate_check_that_proves_the_fix. The second test fails on base because of fix(ci): a fail-to-pass test reads a head run as a base run #5361. The changed helpers of the file make every test of the file a changed test, so the replay accepts it.

Replay of the head of #5357 with this fix

uv run devops ci fail-to-pass --base origin/main --head f7064d0f0 (the head of #5357, fetched read-only): exit 0.

  failed on base, passed on head: k8s host_overrides.check_open_webui_allows_only_the_origins_of_its_ingress_hosts
k8s gate row: 1 of 114 cases failed on base, 0 of 114 on head (tests/gate/k8s_checks/host_overrides.py).

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 #5357

After 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 main, or a close and reopen), so that its merge commit holds this fix. A plain re-run of the old failed run does not use this fix: GitHub re-runs a workflow with the same GITHUB_SHA, which is the old merge commit with the old replay code.

Render difference

This change touches no path under k8s/ or tf/. No kustomize or helm render applies, and the change restarts nothing.

@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: 4821fa23cad8098af85f8751065fd9147e84d589

Check Conclusion Link
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
CodeQL success run
Plan Check skipped run
Dependency Freshness skipped run
Test Job Duration skipped run
Tests on Main skipped run
Tests & Coverage (shard 3 of 4) success run
Tests & Coverage (shard 1 of 4) success run
Design Tokens success run
Runner Image success run
Changed-Test Independence success run
Tests & Coverage (shard 4 of 4) success run
Service Image success run
Static Analysis success run
Tests & Coverage (shard 2 of 4) success run
MCP Server Image success run
Docs Site Build success run
Analyze (actions) success run
Analyze (python) success run
Semantic PR title success run
Fail-to-Pass Check success run

Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/43370224047/job/131703998598

Skipped check: Plan Check
Skipped check: Dependency Freshness
Skipped check: Test Job Duration
Skipped check: Tests on Main

@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 05:21
@dan-petty
dan-petty merged commit 67e7aba into main Nov 13, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/5353-gate-replay-base-source branch November 13, 2026 05:41
dan-petty pushed a commit that referenced this pull request Nov 13, 2026
🤖 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>
dan-petty added a commit that referenced this pull request Nov 13, 2026
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.
dan-petty added a commit that referenced this pull request Nov 13, 2026
`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/`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): fail-to-pass gate replay imports the head source on the base

1 participant