ci: a docs-only pull request runs every test that reads the document it changes (OLD-799) #374

Merged
ItsMrDubey merged 1 commit from upstream-pr/374 into main 2026-11-27 09:02:31 +00:00
ItsMrDubey commented 2026-11-24 04:03:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ItsMrDubey on 2026-11-24T04:03:53Z.


Claimed in the coordination issue as: OLD-799 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121328982)

What and why

OLD-799 asks for the CI path-filter blind spots: a file whose change would not start a job that depends on it. The workflow-linting half is already covered by jactionlint.yml (.github/**), so this PR only covers the filters.

I went through every workflow's filters, and through what each job reads:

Workflow / job Filter What it reads beyond its own tree Blind spot?
runtime.yml (windows, wine, linux, macos) paths: list tools/*.py through runtime/test/shaders/build.py, runtime/cmake/translator_deps.cmake, scripts/run_gpu_tests.py, CMake ../tools/*.py, scripts/**, .gitattributes, third_party/** No. tests/test_runtime_paths.py already recomputes the import chain and every tools/ entry is listed. (build.py names tests/semantic/fixtures/ps_mullit, but that file isn't tracked and no CI job runs mullit_readback.py.)
xma2-decoder.yml runtime/xma_decoder/**, third_party/xma/**, itself the xma crate comes from git through Cargo.lock (in the tree) No
jactionlint.yml .github/** workflows only No
no-game-data.yml, conflict-label.yml none n/a No
ci.yml check, stdlib-tests-linux, macos-python skipped by change-scope when only README.md, CONTRIBUTING.md, AGENTS.md or docs/**/*.md changed four tests outside tests/test_docs_*.py read those documents from the repository Yes

The four documentation readers that a docs-only pull request skips:

  • tests/test_design_contract_rows.py reads docs/design.md (rows repeated within a table).
  • tests/test_exe_checklist.py test_this_repository runs exe_checklist.collect(ROOT) over every docs/*.md and expects the UNVERIFIED/ASSUMPTION notes in runtime_imports.md, d3d12_vulkan.md and modding.md.
  • tests/test_make_game_preflight.py test_ensure_submodule_names_the_clone_command_the_readme_gives reads README.md.
  • tests/test_progress_dashboard.py test_default_repo_is_the_one_the_readme_clones reads README.md.

So a PR that only edits the README clone line, drops one of those notes or duplicates a design.md row goes green, and main fails after the merge. To confirm the list, I ran every test file under a sys.addaudithook open hook that records each document it reads from the repository. Outside test_docs_*/test_i18n_index it found the first, second and fourth. The make_game file errors out early under 3.11 (ntpath.isjunction, which is 3.12+), so the hook never reached its README case. That case was run on its own and opens README.md directly (line 690).

Fix: the docs-only step now runs test_design_contract_rows.py in its loop. For the other three it runs only the cases that read a document, named one by one, so the docs-only job stays a few seconds long. No filter was removed. tests/test_ci_registration.py now checks this too. It scans every tracked test with the AST for os.path.join(<root>, ...) calls that build a document path, where <root> is __file__ or a module-level name derived from it (synthetic trees under a temporary folder don't count). It also keeps a short list of tests that reach the documents through a tool (test_exe_checklist.py). It fails when one of these tests isn't run by the docs-only step. Like the existing docs-only check, it uses the standard library only, with no PyYAML and regex/AST parsing.

Tested

Windows 11, Python 3.11.9, no GPU needed.

  • python -I tests/test_ci_registration.py: 19 tests OK. Before the ci.yml change, the new repository test fails and lists the four files.
  • python -I tests/test_runtime_paths.py: 5 tests OK (Runtime filter unchanged and complete).
  • The new docs-only step's commands under bash: all test_docs_*.py, test_i18n_index.py, test_design_contract_rows.py and the three named cases pass.
  • The audit-hook scan over all 503 tests/test_*.py (stdlib files under python -I, pytest files under pytest): document reads only in the files above.
  • python -I scripts/check_no_game_data.py .github/workflows/ci.yml tests/test_ci_registration.py: clean.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. n/a: no translator rule
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465855398 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/374). Originally posted by [ItsMrDubey](https://github.com/ItsMrDubey) on 2026-11-24T04:03:53Z. --- Claimed in the coordination issue as: OLD-799 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121328982) ### What and why OLD-799 asks for the CI path-filter blind spots: a file whose change would not start a job that depends on it. The workflow-linting half is already covered by `jactionlint.yml` (`.github/**`), so this PR only covers the filters. I went through every workflow's filters, and through what each job reads: | Workflow / job | Filter | What it reads beyond its own tree | Blind spot? | |---|---|---|---| | `runtime.yml` (windows, wine, linux, macos) | `paths:` list | `tools/*.py` through `runtime/test/shaders/build.py`, `runtime/cmake/translator_deps.cmake`, `scripts/run_gpu_tests.py`, CMake `../tools/*.py`, `scripts/**`, `.gitattributes`, `third_party/**` | No. `tests/test_runtime_paths.py` already recomputes the import chain and every `tools/` entry is listed. (`build.py` names `tests/semantic/fixtures/ps_mullit`, but that file isn't tracked and no CI job runs `mullit_readback.py`.) | | `xma2-decoder.yml` | `runtime/xma_decoder/**`, `third_party/xma/**`, itself | the `xma` crate comes from git through `Cargo.lock` (in the tree) | No | | `jactionlint.yml` | `.github/**` | workflows only | No | | `no-game-data.yml`, `conflict-label.yml` | none | n/a | No | | `ci.yml` `check`, `stdlib-tests-linux`, `macos-python` | skipped by `change-scope` when only `README.md`, `CONTRIBUTING.md`, `AGENTS.md` or `docs/**/*.md` changed | **four tests outside `tests/test_docs_*.py` read those documents from the repository** | **Yes** | The four documentation readers that a docs-only pull request skips: - `tests/test_design_contract_rows.py` reads `docs/design.md` (rows repeated within a table). - `tests/test_exe_checklist.py` `test_this_repository` runs `exe_checklist.collect(ROOT)` over every `docs/*.md` and expects the UNVERIFIED/ASSUMPTION notes in `runtime_imports.md`, `d3d12_vulkan.md` and `modding.md`. - `tests/test_make_game_preflight.py` `test_ensure_submodule_names_the_clone_command_the_readme_gives` reads `README.md`. - `tests/test_progress_dashboard.py` `test_default_repo_is_the_one_the_readme_clones` reads `README.md`. So a PR that only edits the README clone line, drops one of those notes or duplicates a design.md row goes green, and main fails after the merge. To confirm the list, I ran every test file under a `sys.addaudithook` `open` hook that records each document it reads from the repository. Outside `test_docs_*`/`test_i18n_index` it found the first, second and fourth. The make_game file errors out early under 3.11 (`ntpath.isjunction`, which is 3.12+), so the hook never reached its README case. That case was run on its own and opens `README.md` directly (line 690). Fix: the docs-only step now runs `test_design_contract_rows.py` in its loop. For the other three it runs only the cases that read a document, named one by one, so the docs-only job stays a few seconds long. No filter was removed. `tests/test_ci_registration.py` now checks this too. It scans every tracked test with the AST for `os.path.join(<root>, ...)` calls that build a document path, where `<root>` is `__file__` or a module-level name derived from it (synthetic trees under a temporary folder don't count). It also keeps a short list of tests that reach the documents through a tool (`test_exe_checklist.py`). It fails when one of these tests isn't run by the docs-only step. Like the existing docs-only check, it uses the standard library only, with no PyYAML and regex/AST parsing. ### Tested Windows 11, Python 3.11.9, no GPU needed. - `python -I tests/test_ci_registration.py`: 19 tests OK. Before the `ci.yml` change, the new repository test fails and lists the four files. - `python -I tests/test_runtime_paths.py`: 5 tests OK (Runtime filter unchanged and complete). - The new docs-only step's commands under bash: all `test_docs_*.py`, `test_i18n_index.py`, `test_design_contract_rows.py` and the three named cases pass. - The audit-hook scan over all 503 `tests/test_*.py` (stdlib files under `python -I`, pytest files under pytest): document reads only in the files above. - `python -I scripts/check_no_game_data.py .github/workflows/ci.yml tests/test_ci_registration.py`: clean. AI-assisted: yes ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. n/a: no translator rule
Oliwettoo commented 2026-11-24 10:34:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:34:03Z.


Looks good. With the PR on current main, tests/test_ci_registration.py passes, and the three single cases the docs-only step now runs exist and pass by name (ExeChecklist.test_this_repository, PreflightPrerequisiteTest.test_ensure_submodule_names_the_clone_command_the_readme_gives, Github.test_default_repo_is_the_one_the_readme_clones), as does tests/test_design_contract_rows.py. Ship. AI-assisted review.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7128951878 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/374#issuecomment-7128951878). Originally posted by [Oliwettoo](https://github.com/Oliwettoo) on 2026-11-24T10:34:03Z. --- Looks good. With the PR on current `main`, `tests/test_ci_registration.py` passes, and the three single cases the docs-only step now runs exist and pass by name (`ExeChecklist.test_this_repository`, `PreflightPrerequisiteTest.test_ensure_submodule_names_the_clone_command_the_readme_gives`, `Github.test_default_repo_is_the_one_the_readme_clones`), as does `tests/test_design_contract_rows.py`. Ship. AI-assisted review.
Andretuta commented 2026-11-27 06:24:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-27T06:24:47Z.


I ran the docs step from 13d0c9d10 on main d1dff7949 in Git Bash on Windows. All 69 tests passed. I then changed only the README clone URL in the test checkout. The original step passed, and the new step caught it in PreflightPrerequisiteTest.test_ensure_submodule_names_the_clone_command_the_readme_gives.

One limit I reproduced in the guard: if two methods in the same test file read repository docs and the workflow invokes only one by name, document_readers_not_run_for_docs_only reports no missing coverage. The four current readers are covered.

AI-assisted testing.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7211503419 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/374#issuecomment-7211503419). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-27T06:24:47Z. --- I ran the docs step from `13d0c9d10` on `main` `d1dff7949` in Git Bash on Windows. All 69 tests passed. I then changed only the README clone URL in the test checkout. The original step passed, and the new step caught it in `PreflightPrerequisiteTest.test_ensure_submodule_names_the_clone_command_the_readme_gives`. One limit I reproduced in the guard: if two methods in the same test file read repository docs and the workflow invokes only one by name, `document_readers_not_run_for_docs_only` reports no missing coverage. The four current readers are covered. AI-assisted testing.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!374
No description provided.