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

Open
opened 2026-11-26 20:17:50 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/374
Author: @ItsMrDubey
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: ci-path-filter-gaps


📝 Commits (1)

  • 13d0c9d ci: a docs-only pull request runs every test that reads the document it changes

📊 Changes

2 files changed (+117 additions, -4 deletions)

View changed files

📝 .github/workflows/ci.yml (+10 -2)
📝 tests/test_ci_registration.py (+107 -2)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/374 **Author:** [@ItsMrDubey](https://github.com/ItsMrDubey) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `ci-path-filter-gaps` --- ### 📝 Commits (1) - [`13d0c9d`](https://github.com/ubiquitarianism/leonida/commit/13d0c9d10b7ff62f8e9878554d9c657f2cc6d150) ci: a docs-only pull request runs every test that reads the document it changes ### 📊 Changes **2 files changed** (+117 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+10 -2) 📝 `tests/test_ci_registration.py` (+107 -2) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#426
No description provided.