PR checks: require hex commit hashes in xcl-smoke blocks #1141
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1141
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1141"
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?
@microwave805 on GitHub · 2026-11-24 12:28 UTC · original
microwave805:pr-check-hex-commits→main· +75 −3 · 2 files · 1 commits · openscripts/pr_check.pyaccepted any 7+ character token on anxcl-smokeblock'scommit:line and passed it verbatim togh api repos/<repo>/compare/<sha>...main(running underpull_request_target) andgit merge-base --is-ancestor.As a result, symbolic refs and rev expressions such as
refs/heads/mainandmain~00returnedidenticalfrom GitHub's compare API (andorigin/main/HEAD~000exited0locally), passing the main-baseline check without naming any commit hash. Untrusted path segments (../../pulls, query strings) and leading-dash git flags (--version) were also interpolated directly into those calls.Note on overlap with #834: #834 checks the first word's length (≥ 7) to reject short prefixes like
1 some other, but still allows non-hex refs, paths, and options through tois_main_ancestor(). Validating 7–40 hex digits handles both.What is in it
scripts/pr_check.py: addCOMMIT_SHA([0-9a-f]{7,40}, case-insensitive) andcommit_sha()to extract and lowercase valid hex SHAs before matchingheador callingis_main_ancestor(), plus the same check insideis_main_ancestor()as defense-in-depth.scripts/test_pr_check.py: cover non-hex refs, path traversal, query strings, leading-dash flags, out-of-range lengths, short/non-hex PR head commits, and valid 7–40 character lowercase/uppercase hex SHAs.Tested
stable-x86_64-pc-windows-msvc, debug), Python 3.11.3eebd284(rebased ontomainb7aa9f3):python -I -m unittest discover -s scripts -p "test_*.py" -v: 19 passed, 0 failed.\scripts\test.ps1(cargo build --workspace && cargo test --workspace -- --test-threads=4): 770 passed, 0 failed, 41 ignoredgpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)b00fd33(base47efa2e): before the fix all 3 new tests failed with 12 subtest failures;python -I scripts/pr_check.py --localrejectedorigin/main,refs/heads/main,HEAD~000, and--version(exit 1) and accepted47efa2e(description ok); checkedcommit_sha()against 25 recently merged PRs onxcl-dev/xcl(16 PRs, 32xcl-smokeblocks, 0 false positives)Regression run
scripts/pr_check.pyandscripts/test_pr_check.py(no runtime or build-input files).Not tested
pull_request_targetexecution (usesmain's copy ofscripts/pr_check.pyuntil merged)AI use
scripts/pr_check.py, wrote the fix, unit tests, rebase conflict resolution, and this PR description, and ran the verification commands above.@DavidM1911 on GitHub · 2026-11-24 12:52 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X; Python 3.
python scripts/test_pr_check.py: 12 tests OK.commit_sha()now requires a 7–40 hexcommit:token, and both the PR-head match (head_sha.startswith(sha)) and the baseline selection go through it — a smoke block with a non-hex or missing commit no longer counts as a valid run. Theuncommittedcheck still applies to the matched block.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@futurepro62 on GitHub · 2026-11-24 14:15 UTC · original
Tested exact head
b00fd33, script tests only, since this PR has no test report yet.Tested
python -m pytest scripts/test_pr_check.pyat the head: 12 passed, 25 subtests passed.930e8b4): 12 subtests fail acrosstest_non_hex_main_commits_are_refused_before_ancestor_checkandtest_short_or_non_hex_head_commits_are_refused(e.g.main~00,HEAD~000,../../pulls). So the new test catches the problem the PR fixes.Not tested
AI use
@microwave805 on GitHub · 2026-11-24 19:01 UTC · original
@GonZiin Thanks for cross-checking #834 against
eebd284and verifying the merge! I also ran.\scripts\test.ps1directly oneebd284(770 passed, 0 failed, 41 ignored; 2SKIPPEDforno wave64) and updated Tested. Happy to pull #834's remaining two test cases (uncommitted head / unrelated commit) into this branch too if maintainers prefer consolidating here.(Comment drafted with Antigravity (Gemini 4 Neon).)
@DavidM1911 on GitHub · 2026-11-26 03:40 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.