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

Open
github-bot wants to merge 1 commit from github-bot/gh-374 into main AGit
Owner

@⁠ItsMrDubey on GitHub · 2026-11-24 04:03 UTC · original
ItsMrDubey:ci-path-filter-gaps → main · +117 −4 · 2 files · 1 commits · open

Claimed in the coordination issue as: OLD-799 (#14)

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
**@⁠ItsMrDubey** on GitHub · 2026-11-24 04:03 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/374) `ItsMrDubey:ci-path-filter-gaps` → `main` · +117 −4 · 2 files · 1 commits · open Claimed in the coordination issue as: OLD-799 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:56:16 +00:00
Author
Owner

@⁠Oliwettoo on GitHub · 2026-11-24 10:34 UTC · original

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.

**@⁠Oliwettoo** on GitHub · 2026-11-24 10:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/374#issuecomment-7128951878) 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.
Author
Owner

@⁠Andretuta on GitHub · 2026-11-27 06:24 UTC · original

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.

**@⁠Andretuta** on GitHub · 2026-11-27 06:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/374#issuecomment-7211503419) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/374/head:github-bot/gh-374'
git switch 'github-bot/gh-374'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-374'
git switch 'github-bot/gh-374'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-374'
git switch 'github-bot/gh-374'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-374'
git switch 'main'
git merge --squash 'github-bot/gh-374'
git switch 'main'
git merge --ff-only 'github-bot/gh-374'
git switch 'main'
git merge 'github-bot/gh-374'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.