Repository navigation
Description
Problem
The Fail-to-Pass Check failed 38 times from 2026-11-12 to 2026-11-19. In 22 of them (58%), each changed test that the fix adds or changes errors on the base: an ImportError, ModuleNotFoundError or AttributeError at collection or setup, because the base lacks the function, module or field that the fix adds. On the head these tests pass. The check counts only a failure in the call phase (src/devops_cli/ci/fail_to_pass.py, module docstring: "at least one changed test fails in the call phase on base"), so it fails these fixes, for example:
- fix(telemetry): Keep the age metrics' reads across pods #6326 (age metrics):
tests.github.test_item_label_timesis a collection failure on base. - the secretKeyRef fix (run 44197567892):
ImportError: cannot import name 'check_secret_key_refs'. - the npm audit ignore fix (run 44141652351):
tests.commands.test_dependency_auditis a collection failure on base.
The rule comes from #844 ("Collection errors are reported but do not count"), which also gave a Fail-to-pass: not applicable line for such pull requests. That line is gone, so a fix whose test must import new code has no way to pass. The replay overlays the head's tests/ on the base, so only src/ differs: an error of a changed test on base comes from the code that the fix changes, which is the proof that the check asks for. SWE-bench counts a test that fails or errors before the fix and passes after it as FAIL_TO_PASS.
The other classes of the 38: 3 changed no test file (a pin or data change in a .py file, see #5585 and the removal of copied pins), 1 changed test passed on base, and the rest had an unchanged test that failed on base or head.
Expected
- A changed test that errors on base (collection, import or setup) and passes on the head proves the fix, as a call-phase failure does.
- An error or a failure of a test that the fix does not change still fails the replay, as now.
- Tests: a replay whose only changed test has a collection error on base exits 0; a replay where an unchanged test errors on base still exits 1.
- The module docstring, docs/TESTING.md and CONTRIBUTING.md ("Fail-to-Pass Evidence") state the rule.
Proposed design
Problem statement
The Fail-to-Pass Check rejects valid fixes when a changed test errors on the base tree during collection, import or setup. The check counts only call-phase failures, so 22 of 38 failed checks had no way to pass. The change counts a changed test that errors on base and passes on head as proof, and it still refuses unchanged errors and failures.
Acceptance criteria
Requirement: Changed error proves fix
The fail-to-pass check SHALL count a changed test that errors on the base tree and passes on the head tree as proof of the fix.
Scenario: Changed test errors on base
- WHEN the unit test
tests/ci/test_fail_to_pass.pyreplays one changed test that errors during collection on base and passes on head - THEN the report is satisfied and the command exits 0.
Requirement: Unchanged error refuses replay
The fail-to-pass check SHALL refuse a replay when a test that the fix does not change errors on the base tree.
Scenario: Unchanged test errors on base
- WHEN the unit test
tests/ci/test_fail_to_pass.pyreplays an unchanged test that errors on base - THEN the report has
tests_refusedtrue and the command exits 1.
Requirement: Unchanged failure still refuses
The fail-to-pass check SHALL keep refusing a replay when a test that the fix does not change fails in the call phase on the base tree.
Scenario: Unchanged test fails on base
- WHEN the unit test
tests/ci/test_fail_to_pass.pyreplays an unchanged test that fails in the call phase on base - THEN the report has
tests_refusedtrue and the command exits 1.
Requirement: Module docstring names the error rule
The fail-to-pass module docstring SHALL state that a changed test that errors on base and passes on head proves the fix.
Scenario: Module docstring check
- WHEN the unit test
tests/ci/test_fail_to_pass.pychecks the module docstring - THEN the docstring names collection, import and setup errors of a changed test as proof.
Requirement: Docs state the error rule
The testing and contributing documentation SHALL state that a changed test that errors on base and passes on head proves the fix.
Scenario: Documentation check
- WHEN the documentation check
uv run vale docs/TESTING.md CONTRIBUTING.mdruns - THEN it exits 0 and both files state the changed-test error rule.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this project-specific fail-to-pass policy. pytest already reports errored outcomes in JUnit XML, and the project keeps the decision in src/devops_cli/ci/fail_to_pass.py. Build and test cost: about 3,000 output tokens and 1 hour. Keep and fix cost: low, because the change extends one predicate and adds two tests.
Key questions
- Should a changed test that errors on base count as fail-to-pass proof?: Yes. Count a changed test that errors during collection, import or setup on base and passes on head as proof, as SWE-bench FAIL_TO_PASS does. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py, tests/ci/test_fail_to_pass.py]
- Chosen: Count changed errors as proof. The base lacks the code that the changed test imports or calls, so the error is the proof.
- Rejected: Count only call-phase failures. It rejects 22 of 38 observed valid fixes and leaves no way to pass.
- Rejected: Count all errors as proof. An unchanged test error would pass and hide a pre-existing defect.
- How should the check tell a changed error from an unchanged error?: Use the existing changed-test classification and apply the same unchanged-test exclusion to
erroredoutcomes as tofailedoutcomes. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py, tests/ci/test_fail_to_pass.py]- Chosen: Extend the existing classification to errors. It reuses one rule for both statuses and keeps the change small.
- Rejected: Add a second classifier for errors. It duplicates logic and risks a different result for the same test.
- Rejected: Treat all errors as changed. It lets an unchanged test error pass the replay.
- Does pytest report a collection error in the JUnit XML that the check reads?: Yes. pytest writes a testcase with an
errorstatus for a collection or setup error, and the module already parses it aserrored. [sources: src/devops_cli/ci/fail_to_pass.py] - Which documents must state the rule?: The module docstring of
src/devops_cli/ci/fail_to_pass.py,docs/TESTING.mdandCONTRIBUTING.mdin theFail-to-Pass Evidencesection. [sources: src/devops_cli/ci/fail_to_pass.py, docs/TESTING.md, CONTRIBUTING.md] - Should an errored changed test also pass on head before it proves the fix?: Yes. The check requires the changed test to pass on head, so an error that remains on head is no proof. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py, tests/ci/test_fail_to_pass.py]
- Chosen: Require a head pass. Fail-to-pass means the test fails on base and passes on head.
- Rejected: Count a base error alone. It would count a test that still errors on head.
- Which open tool covers the fail-to-pass policy?: No open tool covers the policy. pytest reports the status, and the project keeps the gate in
src/devops_cli/ci/fail_to_pass.py. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py]- Chosen: Use pytest JUnit XML as the data source. It already reports failed and errored outcomes.
- Rejected: Build a new replay tool. It duplicates the existing pytest replay and adds maintenance.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
The check failed 38 times in one week and 22 of those failures are caused by this gap, blocking valid fixes in CI.The failed run 44197567892 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.devops ci fail-to-pass) #844, which asks for a different change.#844 created the check and set the rule that only call-phase failures count; this candidate fixes a gap in that rule by adding errors as valid proof.devops-cli-service commentedon Nov 19, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
devops-cli-service commentedon Nov 19, 2026
Released in v0.179.5: https://github.com/dan-petty/devops-cli/releases/tag/v0.179.5
devops-cli-service commentedon Nov 19, 2026
Live since 2026-11-19 11:42 UTC