Skip to content

ci(tests): plan-only pull requests run only invariant tests - #2871

Merged
dan-petty merged 12 commits into
mainfrom
ci/2860-plan-only-runs-invariant-tests
Oct 31, 2026
Merged

dan-petty merged 12 commits into
mainfrom
ci/2860-plan-only-runs-invariant-tests

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

What

A pull request that only adds a plan under openspec/changes/<issue>-<slug>/ now runs tests/invariants and nothing more of the suite. The job Tests & Coverage finds such a pull request with dorny/paths-filter. Every other pull request, push and manual run still gets the full gate. The step Changed-Line Coverage does not run for a plan-only pull request.

The filter runs only for a pull request with fewer than 3000 changed files. The REST list of the files holds 3000 files at most and gives no sign of a cut, so a larger pull request gets the full gate.

Why

Plan pull requests ran the full suite for 297 s to 371 s, and they change no line that the suite tests. AGENTS.md rule 5 treats a check that averages more than 5 minutes as a P0 bug. The job keeps its name and its place, so the required check reports success. A workflow contract test holds each part of the rule.

Closes #2860

@dan-petty dan-petty added the type/infra Type infra: the build, CI, images or cluster label Oct 31, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results

  • devops ci fail-to-pass --base origin/main: 7 tests failed on the base and pass on the head. The 7 are in tests/invariants/test_workflow_contracts.py and tests/commands/test_ci.py.
  • Full devops ci on the head: every check passed except test. One test failed: test_scan_report_skips_named_scanners. It is the known host fact of test(floor): every test sees the same tokenizer cache, mounts, process table, PATH and programs on every host, and no skip depends on the host #2165 (kube-linter is on the PATH here). The test check took 5 m 55 s on this host with other agents running.
  • Goal of the issue: the job Tests & Coverage should take under 150 s on a plan-only pull request. A person reads that time on the first plan-only pull request after the merge.

Review findings

Fixed:

  • Security (minor): a pull request with 3000 changed files or more could look plan-only. The filter step now runs only when github.event.pull_request.changed_files < 3000. Otherwise its output is empty and the full gate runs. The contract test and a mutation case hold this.
  • Standards (minor, docs/SELF_IMPROVEMENT.md): the sentence about the full suite names the plan-only exception now.
  • Spec and standards (minor, archived tasks.md): the "Workflow follow-up" section is removed. The defect that devops ci test <directory> verifies nothing is filed as fix(ci): devops ci test accepts a directory, verifies nothing and exits 0 #2868. The ci.yml comment names it.
  • design.md and docs/SDLC.md state the 3000 file limit.

Not fixed: none.

@dan-petty dan-petty changed the title ci(test): plan-only pull requests run only invariant tests ci(tests): plan-only pull requests run only invariant tests Oct 31, 2026
@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 14:04
@dan-petty
dan-petty merged commit e915b5d into main Oct 31, 2026
18 of 19 checks passed
@dan-petty
dan-petty deleted the ci/2860-plan-only-runs-invariant-tests branch October 31, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/infra Type infra: the build, CI, images or cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(test): a pull request that only adds a plan runs the invariant tests, not the full suite

1 participant