Repository navigation
docs: check the index and add the two pages it misses - #4804
bobcatchris wants to merge 2 commits into
Conversation
|
At
Compute To reproduce, run this script from the checkout root with import sys, tempfile
from pathlib import Path
from unittest.mock import patch
sys.path.insert(0,str(Path("tests").resolve()))
import test_docs_index as d
for n in (64,128,256):
with tempfile.TemporaryDirectory() as root:
names=[f"p{i}.md" for i in range(n)]
d.write_tree(root,names)
index="\n".join(f"| [{s}]({s}) | text |" for s in names)
with patch.object(d.os,"listdir",wraps=d.os.listdir) as ls, patch.object(d.os.path,"isfile",wraps=d.os.path.isfile) as check:
print(n,d.dangling_rows(root,index),ls.call_count,check.call_count)AI-assisted. |
|
Ran this at Also ran The new No blocking issue. AI-assisted. |
|
Verified on current main: merges cleanly; the new tests/test_docs_index.py passes 7/7 and the neighbours test_docs_links (6) and test_i18n_index (5) pass unchanged, so the new coverage rule does not break the docs-only CI path. The added modding.md row matches the page. One cosmetic nit: write_tree in the test opens with encoding but without newline="\n" — harmless for a one-line stub, but inconsistent with the repo pin. CI was still pending at check time — please confirm it goes green before merge. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested
|
352fa5e to
7c67c74
Compare
|
AI-assisted verification of
I also removed the |
|
Independent macOS code read and test run at head 7c67c74 (Apple M2, Python 3.13.18). AI-assisted. |
|
Tested 7c67c74 merged with main 8575d36 on Linux (WSL2), CPython 3.12.16: concern |
Current main already lists modding.md, ped_catalogues.md and strand_grooms.md, so keep the index test and add only the two pages it reports missing: dev-tools.md and gpu_test_results.md.
7c67c74 to
e9a3a29
Compare
|
Rebased onto current
AI-assisted. |
|
Tested e9a3a29 applied cleanly to main dde82f2. All 7 docs-index tests passed on Windows 11 (CPython 3.15.2) and WSL2 (CPython 3.14.7). All 14 CI-registration tests passed on Windows. With the test kept in place and only docs/README.md restored to main, it reported exactly dev-tools.md and gpu_test_results.md as missing. The existing link and CLI-flag failures still reproduce on main. For merge coordination, #7453 adds both of the same rows and an orphan-page check, and #7441 adds the same dev-tools row. AI-assisted (Codex). |
|
All seven index tests passed on Windows at AI-assisted reproduction. |
A fenced sample row satisfied the index check and could hide an orphan page. Skip backtick and tilde blocks when reading the index's rows.
|
Good catch — fixed.
AI-assisted. |
|
Tested f60911a on Linux (WSL), Python 3.13: pass, 1 minor issue. Ran:
Code read: the two new rows match their pages (
|
|
Tested
Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting; claimed in #8047. |
isfcrctfs
left a comment
There was a problem hiding this comment.
Read the checker and the two rows it adds; python3.12 -I tests/test_docs_index.py passes (8 tests).
Proved it can fail. Reverting only docs/README.md to the merge-base version makes test_every_page_has_a_row fail
with exactly ['dev-tools.md', 'gpu_test_results.md'], and the PR's rows make it pass - so the test is not vacuous. I also
checked the added rows against reality: python -I scripts/dev.py discover --json emits {"schema_version": 1, "tools": [...]} with boot-trace and guest-scene ids, and docs/gpu_test_results.md is the per-GPU/commit record with the
build.py / check.py / run_gpu_tests.py counts the row describes. Fenced examples are excluded, and a dangling row or a
twice-listed page are both reported (their own tests cover it).
One coverage gap. pages() is non-recursive, so the 12 .md files under docs/i18n/ (including
docs/i18n/README.md) are never checked, although the module docstring says "every page in docs/". The exact failure this
test exists to catch - a page reachable from nowhere - can still happen under a subdirectory. Either say "pages beside the
index" in the docstring or walk docs/ and require a row somewhere for each page.
AI-assisted
docs/README.mdis the only route into the notes, so a page merged without a row is unreachable from the index and easy to miss when it later goes stale. This PR addstests/test_docs_index.py(every page has exactly one row, every row resolves) and indexes the two pages the test reports missing on currentmain:dev-tools.mdandgpu_test_results.md.The earlier version of this branch also added rows for
modding.md,ped_catalogues.mdandstrand_grooms.md. Currentmainalready has rows for those, so the branch is rebased onmainand no longer re-adds or rewrites them.Tests (Windows 11, Python 3.12):
python -I tests/test_docs_index.py: 7/7 OK; the synthetic-tree tests cover a missing row, a dangling row and a duplicate row.python -I tests/test_ci_registration.py: 14/14 OK.tests/test_docs_*.py: all OK excepttest_docs_cli_flags.py(docs/embedded_shaders.md flags) andtest_docs_links.py(adev-tools.mdanchor inruntime/README.md), both of which fail the same way onmainand are outside this diff.Docs and a test only; no game data.
AI-assisted.