tests: the registration scan walks a root that is not a repository, even inside one (CI-REGISTRATION-OUTER-REPO) #2472
Open
github-bot
wants to merge 1 commit from
github-bot/gh-2472 into main
AGit
pull from: github-bot/gh-2472
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
github/ubiquitarianism--leonida!2472
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2472"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@robot00f on GitHub · 2026-11-27 15:34 UTC · original
robot00f:tests/ci-registration-outer-repo→main· +59 −4 · 1 files · 1 commits · opentests: the registration scan walks a root that is not a repository, even inside one (CI-REGISTRATION-OUTER-REPO)
Claimed in the coordination issue as: CI-REGISTRATION-OUTER-REPO.
What and why
tests/test_ci_registration.pybuilds a scratch tree intempfile.TemporaryDirectory()and expectsclaimed_test_filesto walk it.tracked_under_testsasksgit ls-files -- testsfirst, and git looks upward for a repository: when the scratch root is not one but sits under a directory that is, the outer repository answers (returncode 0) with no record oftests/, the list comes back empty and the walk never runs.Measured on this machine (Windows 10 Pro 19045):
%TEMP%isC:\Users\<user>\AppData\Local\Temp, under a repository atC:/Users/<user>, sotests/test_ci_registration.py:703fails withKeyError: 'tests/left_out_test.py'. The failure is not the path separator: line 133 already normalizesos.septo/in the walk. On Linux and on the CI runners%TEMP%is not inside a repository, which is why only a native Windows run sees it.What
The tracked list is used only when the root is the repository's top level:
GIT_CEILING_DIRECTORIESwas tried first and does not hold here: Git for Windows parses the drive'sC:as a list separator.Test
test_a_tree_that_is_not_a_repository_is_walked_even_inside_one:git initin a temporary directory, a scratch tree inside it withtests/test_inside.py, and the scan must return["tests/test_inside.py"](skipped when git is absent).test_the_scan_flags_an_unlisted_file_and_a_file_pytest_cannot_collect) passes again.With the previous code both fail here (
[] != ['tests/test_inside.py']and theKeyError). 19 of 19 pass with the change; the real scan of this checkout is unaffected, becauseROOTis the top level (normcase(realpath)equal) and takes the samels-filespath as before.Which GPU
None needed: no GPU and no game data (pages of a temporary directory). Run on Windows 10 Pro 19045.
AI-assisted (OpenCode, DeepSeek).
@djrolfes on GitHub · 2026-11-27 17:36 UTC · original
Independent Linux review/test at
0078060a3(merged cleanly onorigin/mainc0201a806). AI-assisted.tracked_under_testsverifiesgit rev-parse --show-toplevelmatchesrootbefore usinggit ls-files, falling back to walking whenrootis a non-repo directory nested inside an outer git repository.python3 -I tests/test_ci_registration.py: 19/19 OK (includingtest_a_tree_that_is_not_a_repository_is_walked_even_inside_one).python3 -I tests/test_text_write_line_endings.py: 3/3 OK.@TheGeogeo on GitHub · 2026-11-27 18:40 UTC · original
Independent review of
0078060a31e83f1f5464b9d0ae01118123546bf1, merged withmain43a9d562d355e7c5c428e486071b456353de8b05(local mergee4b7dfe19b0836bc8236aa588291e7f0f91282dc).Finding — Windows checkout paths with non-ASCII characters:
tests/test_ci_registration.py:128–130readsgit rev-parse --show-toplevelwithtext=Trueand the default Windows encoding. On this machine Git outputs UTF-8 while Python 3.12.4 under-Iuses cp1252. In a synthetic checkout namedcafé, the decoded root no longer matches and the fallback walk includes an untracked test, makingtest_every_test_file_is_selected_by_a_jobfail. In a checkout containingā, decoding fails andtop.stdout.strip()raisesAttributeErrorinsetUpClass. The same entry-point test passes onmainin both checkouts. Specifyingencoding="utf-8"for this Git output fixed all three ASCII/non-ASCII probes and preserved the new nested-repository test in an isolated in-memory check.Windows 11 build 26300, PowerShell 7.6.10, Python 3.12.4 and Git for Windows 2.36.0:
test_ci_registration.py: ordinary TEMP: main 18/18, merged PR 19/19. TEMP inside a synthetic Git repository: main 17/18, merged PR 19/19. The new test fails as expected against main's implementation.test_text_write_line_endings.py3/3,test_run_standalone_tests.py5/5 andtest_ctest_registration.py6/6 on each revision. No-game-data check andgit diff --checkpassed.No game files or GPU were used. The targeted nested-repository improvement is demonstrated; the Unicode-path regression needs attention.
AI-assisted: yes (Codex, GPT-6.2 Sol).
Status: Please fix the Windows Unicode-path regression before merging.
@Andretuta on GitHub · 2026-11-27 21:00 UTC · original · requested changes
The outer-repository fix and
os.path.normcase(os.path.realpath(...))comparison handle nested%TEMP%directories, Windows junctions/short paths, and worktrees well, but requesting changes to address the Windows non-ASCII path decoding issue noted by @TheGeogeo (and the matchinggit ls-files -zcall right below it) before we merge:Locale decoding on
git rev-parse --show-toplevel(tests/test_ci_registration.py:128-130) andgit ls-files -z(tests/test_ci_registration.py:131-133):Under
python -Ion Windows,text=Truewithout an explicit encoding decodes subprocess output withlocale.getencoding()(typicallycp1252), whereas Git for Windows emits UTF-8 bytes for both commands:%TEMP%intest_a_tree_that_is_not_a_repository_is_walked_even_inside_one) contains UTF-8 bytes undefined incp1252(e.g.č->0xc4 0x8dorā->0xc4 0x81),_readerthreadfails withUnicodeDecodeError, leavingstdoutasNoneand raisingAttributeError: 'NoneType' object has no attribute 'strip'(or'split'on line 133 for a non-ASCII path undertests/).cp1252(e.g.café->café),top.stdout.strip()silently mismatcheshereand falls back toos.walk, picking up untracked files undertests/.Suggested fix:
Drop
text=Trueand decode the raw path bytes withos.fsdecode(...), matchingtests/test_docs_links.py:107-112(on Windowsos.fsdecodealways uses UTF-8 even under-I, and on POSIX it preserves non-UTF-8 paths viasurrogateescape):(Similarly, in
test_a_tree_that_is_not_a_repository_is_walked_even_inside_oneat lines 729-731, please passencoding="utf-8", errors="replace"or read bytes soadded.stderrcannot becomeNoneifgit initfails in a non-CP1252 temp path.)Regression test:
Please add a test covering a synthetic repository root with non-ASCII characters (including a byte undefined in
cp1252such asčand a multi-byte Latin character such asé) verifying thattracked_under_testsstill takes thegit ls-filespath (ignoring untracked files) rather than raising or falling back toos.walk.AI-assisted review.
0078060a31tod47eb15704@robot00f on GitHub · 2026-11-27 21:48 UTC · original
Addressed in
d47eb157(rebased onto currentmain):text=Trueintracked_under_testsand decoded raw Git path bytes withos.fsdecode(...)(plus-c core.quotepath=falseonrev-parse --show-toplevel), matchingtests/test_docs_links.py.git init/git addsubprocess calls in the tests toencoding='utf-8', errors='replace'.test_non_ascii_repository_root_uses_tracked_list_not_walkcovering a repository root and tracked test path containing bothé(valid incp1252) andč(undefined incp1252) alongside an untracked test underpython -I(20/20 pass on Windows 10 Pro 19045).@OreoFR on GitHub · 2026-11-28 22:02 UTC · original
Verified by OreoFR
3408969a7+ PR headd47eb1570python -I tests/test_ci_registration.pyAI-assisted (Claude Code, Claude Opus 5.5).
@zmasi on GitHub · 2026-11-29 00:47 UTC · original
#2472 | head
d47eb15704(merged cleanly onto origin/maine66c65b950) | Windows 11 (10.0.26200.9974, NTFS), Python 3.12.10 | AI-assisted: yesIndependent Verification (Windows 11)
+61/-6intests/test_ci_registration.py).python -I scripts/check_no_game_data.py tests/test_ci_registration.pypassed (rc=0).origin/maine66c65b950vs#2472 + origin/main):origin/main): Initialized an outer Git repository in%TEMP%with a non-repositoryscratch\tests\test_x.pysubdirectory inside it;tracked_under_tests(inside)returned[]onorigin/mainbecausegit ls-files -z -- testssucceeded against the outer repository and skipped the directory walk.#2472 + origin/main):tracked_under_tests(root)checksgit -c core.quotepath=false rev-parse --show-toplevel(os.path.normcase(os.path.realpath(...))+ raw byteos.fsdecode) before trustinggit ls-files, andpython -I tests/test_ci_registration.pypassed20/20(OK) on Windows 11 — including bothtest_a_tree_that_is_not_a_repository_is_walked_even_inside_oneandtest_non_ascii_repository_root_uses_tracked_list_not_walk(café_č_repounderpython -IWindows ANSI/cp1252 defaults).@timbot103 on GitHub · 2026-11-29 04:28 UTC · original · reviewed
Static audit of
d47eb1570intests/test_ci_registration.py. No builds, tests, or GPU runs were performed.The linked worktree’s
.gitfile is sufficient for Git to identify its own top level. On Windows, the comparison resolves existing short names and symlink targets before normalizing slash spelling and case, including drive-letter case. The added tests cover discovery of a scratch tree inside an outer repository and selection of a tracked Unicode filename alongside an untracked test. The fallback prunes.gitdirectories. Untracked files are excluded when the scan uses the Git index.tests/test_ci_registration.py:134strips all trailing CR and LF bytes from--show-toplevel. A POSIX checkout whose directory name ends in a carriage return therefore falls back to the walk, which can flag an untrackedtests/left_out_test.pyas a registration failure. Remove exactly one output LF and strip a preceding CR only on Windows. A POSIX fixture with a CR-ending root and an untracked test would exercise this case.AI-assisted.
@fiestorra on GitHub · 2026-11-30 06:05 UTC · original
Verified on this machine (Windows 11, Python 3.13.14). Additive test coverage, and I want to be precise that it is that - there is no negative control available here, because the new cases test code that this same file introduces.
1. It applies.
merge-treeclean;d47eb1570cherry-picks ontomain0ae217cebwithout a conflict. One file,59 insertions(+), 4 deletions(-)intests/test_ci_registration.py.2. With the change:
3. On
mainthe same file runs 18 passed, 44 subtests - the two extra cases are the ones the commit adds, and nothing onmainfails. So this is new coverage, not a fix: the rule that the registration scan walks a root that is not a repository (and therefore finds nothing to register) had no test before, and now it has two.Why that is still worth merging: it is the case that produced a false red in CI - a scan rooted at a non-repository returning nothing looks identical to a scan that found every test already registered. A test that pins the distinction is what makes the next person trust the output.
What I did not test: the CI selector itself (the
python -I <file>path versus pytest). The two new cases are inside the same file, so they run wherever the file runs; I confirmed the file's pytest path only.Written with an AI assistant.
@KelboLive on GitHub · 2026-11-30 17:25 UTC · original
Independent check on Windows (not the author), at
d47eb1570.python -I tests/test_ci_registration.py: 20 tests OK in 10.6 s, including the outer-repository root case.Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10.
AI-assisted: yes (opencode).
@aslan2142 on GitHub · 2026-12-01 11:44 UTC · original · approved these changes
Reviewed the diff against
main:tests/test_ci_registration.py:120-143cleanly checksgit rev-parse --show-toplevelagainstrootbefore trustinggit ls-files(preventing an outer repo from masking a scratch tree) and decodes rawgitoutput withos.fsdecode, covered by both outer-repo and non-ASCII tests. Clean-room verified. Approving; please merge/rebase currentmainso CI runs green before merge.(AI-assisted review.)
@andrew-ai on GitHub · 2026-12-02 00:57 UTC · original
Checked a Windows checkout created with git init --separate-git-dir, with a non-ASCII working directory and a .git file pointing to separate metadata. At main
4fe371f90and at the local merge withd47eb1570, tracked_under_tests at the checkout root selected the one staged test and omitted a neighboring untracked test. For a scratch tree inside that same checkout, claimed_test_files returned an empty list on main and exactly tests/test_nested.py after the merge. This reproduces the nested-directory fix while exercising the real repository case where .git is a file. Codex-assisted.@MoonEyes on GitHub · 2026-12-02 18:13 UTC · original
Verified #2472 on Linux: 20/20 pass merged onto current
main; the nested-repository case is red withmain'stracked_under_testsand green with this one.d47eb15704(unchanged since 27 November)main45dc41f95c(git merge --no-ff, clean; merge base39f52f39c4, 2,929 commits behind)Ran
Red/green. Source and test live in the same file, so I replaced only the body of
tracked_under_testswithmain's version (kept the new tests) and reran:That is the bug the title names: inside an outer repository,
git ls-files -- testssucceeds with an empty list and the walk never runs.test_non_ascii_repository_root_uses_tracked_list_not_walkpasses on both sides here, as expected on Linux (UTF-8 locale); its red side is the Windows cp1252 decode, which I could not reproduce. KelboLive, fiestorra and andrew-ai report it on Windows.Review. Comparing
realpath/normcaseofrev-parse --show-toplevelwith the root, and decoding-zoutput as bytes withos.fsdecode, is the root-cause fix, not a fallback.except (OSError, UnicodeDecodeError)falls through to the walk, which is the safe answer. No defects.CI. The red
checkon the head istests/test_windows_boot_journal_seed.pyandmacos-pythonwas cancelled, both from a 27 November run on a 2,929-commits-old base; this PR does not touch either. A merge ofmaininto the branch would refresh CI.Verdict: ready (needs a fresh CI run on a current base; the code needs no change).
AI-assisted: Claude Opus 5.5 (Claude Code), verification only.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
@MoonEyes on GitHub · 2026-12-02 21:54 UTC · original
The
checkfailure here (job 143766686004:BootJournalSeedTest,runneradmin!=runner~1) is not from this PR. That job testedrefs/pull/2472/mergeon base34e33d3d(27 Nov), which predatesd98fc7fb(#2593, merged 29 Nov). That commit makes the boot journal seed test compare long paths on the runner's 8.3%TEMP%. Merging currentmaininto this branch should turncheckgreen. #3231 adds explicit 8.3 short-path cases for the same test.Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.