Repository navigation
Conversation
… and lines GitHub's search reads titles and descriptions, not diffs, so a pull request that makes the same change in other words is not found by searching. This read-only check lists the open pull requests that change given paths, a branch's files or a pull request's files, and marks the ones whose hunks are on the same lines, with the number of identical changed lines. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Independent CLI check on
No live snapshot scan was needed. Synthetic inputs only. AI-assisted (Codex). |
|
Tested 74d14c2 on Arch Linux, Python 3.14.10, CPU only: pass, first Linux check. New tests/test_pr_overlap.py 18/18 OK via documented python -I runner. Negative control: tool removed so tests fail at import, restored green. Note: under pytest the usage-error test fails on prog name rendering, runner-specific, not the PR. No game files. AI-assisted. |
Grimkaaah
left a comment
There was a problem hiding this comment.
Independent Linux CPU review (74d14c27)
What changed: new scripts/pr_overlap.py lists open PRs that touch the same files/lines (coordination helper), with unit tests around the overlap logic.
Checked:
- New script + tests only.
python3 -I tests/test_pr_overlap.py→ 18 OK.
Looks correct; no game files.
|
Tested
|
TEST validation — ApproveValidated on CPU (no GPU, no game files). Pure Python read-only tool. What changed: Two new files:
Tests added: diff parser (replaced/inserted/removed lines, hunks, new/deleted/renamed/binary/quoted-path files), paging of PRs and 231-file list, saved cache (LF, reuse, refresh, refusal), paths/folders, Verification:
Note: AI-assisted (Codex). CI checks show 0 (no CI run yet). Recommendation: Approve / merge. Fully CPU-validatable, 18/18 tests pass across Windows/Linux, independent positive review, touches no existing files. |
|
Closed my #8509 in favour of this. It added a One suggestion:
Note that |
Claim: #8344 (comment) (new BUILD item, not on the list)
Why
AGENTS.mdasks every contributor to check the open pull requests before starting. GitHub's search reads titles and descriptions, not diffs, so a pull request that makes the same change in other words is not found by searching for yours. That is how my #8170 missed #6432: the same one-line CSS change, four hours earlier, under a title that shares no keyword with mine. @LaugeM's one-off comparison in the coordination issue found 36 such groups among the open pull requests.What
scripts/pr_overlap.py, a read-only check to run before a claim or a pull request:With
--branchor--prthere is a diff to compare, so each pull request sharing a file is markedsame lines(a hunk within--slacklines of one of yours, default 3) orsame file, with the number of identical changed lines the two diffs share. On #8170, from the 3,643 pull requests open at the time:How it works:
gh api graphql, 100 per request (about two seconds each; 3,643 took 1 min 53 s). A file list longer than 100 is paged to its end rather than cut, since a cut list would hide an overlap.--cache FILEkeeps that list and reuses it (--refreshreads again), so several checks cost one read and a saved file works offline. The second run above took 20 s, all of it the 25 diffs.--max-diffsdiffs are fetched (default 25, the pull requests sharing the most files first); the rest are listed assame file, lines not compared. A diff GitHub refuses (too_large, hit on the first live run) is listed the same way instead of ending the run.same linesmeans "look at this one", not proof; the docstring says so.ghorgiterror (one line on stderr).--jsonfor scripts.It does not overlap
scripts/merge_check.py(is a pull request already on main, would merging it again duplicate text) or #8319 (security scan). Two new files, no existing file touched, so it conflicts with nothing open.Tests
python -I tests/test_pr_overlap.py: 18 tests, 0.7 s, no network.ghis replaced by a stand-in that answers the two GraphQL queries andgh pr difffrom a table of made-up pull requests; the--branchcase runs the realgit diffon a throwaway repository. Covered: the diff parser (replaced, inserted and removed lines, two runs in one hunk, new, deleted, renamed, binary and quoted-path files, the no-newline marker), paging of pull requests and of a 231-file list, the saved list (LF, reused without a request, refreshed, refused when unusable or for another repo), paths and folders,--slack,--max-diffs,--skip-author, a refused diff, the text and JSON reports, usage errors andgh/gitfailures.--pr 8170,--pr 8093,--branch, three paths (one with a backslash), a folder and a path nobody changes, with and without--cache.python -I tests/test_ci_registration.py: OK (the new test file is selected by CI).tests/test_tool_stdout_encoding.pyandtests/test_text_write_line_endings.pyfail on main for other files and do not name these two.python -m compileall -qandpython -I scripts/check_no_game_data.pyon both files: clean.Windows 11, Python 3.13.17, gh 2.x, git for Windows. CPU only; no game files, no GPU involved. Not run: the translator suite, runtime/CMake and GPU tests (nothing here is read by them), and Linux or macOS.
AI-assisted (Claude Code).
🤖 Generated with Claude Code