fix(tools): recognize markdown links and pull request URLs in pr_overlap dependencies #8025
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8025"
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?
Imported from boykopovar/AnyPS5. Originally posted by emirplus on 2026-10-19T18:04:51Z.
What
In
tools/pr_overlap.py,depends_on(body)matches dependency declarations using regular expressions that strictly require#\d+syntax.When contributors format dependency declarations using Markdown links (such as
[#123](https://github.com/.../pull/123)or[PR #123](...)) or raw pull request URLs,depends_onfails to extract the pull request numbers and returns an empty set.#<number>.#<number>.Tested
python tools/check_conventions.py --base origin/mainpython -m unittest tools/tests/test_pr_overlap_dependencies.pypython -m unittest tools/tests/test_pr_overlap_dependencies.py tools/tests/test_pr_overlap_encoding.py tools/tests/test_pr_overlap_exports.py tools/tests/test_pr_overlap_own_branch.py tools/tests/test_pr_overlap_wrapped_exports.pyChecklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T04:30:49Z.
@emirplus thanks. One problem: the new patterns accept a pull request URL from any repository, so
Depends on: https://github.com/shadps4-emu/shadPS4/pull/1234now reads as a dependency on #1234 here (main returns none). Could they match onlygithub.com/boykopovar/AnyPS5/pull/N(case-insensitive)?Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T04:59:19Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
tools/pr_overlap.pyImported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T03:11:50Z.
Linux data point for
358dda936e(WSL2, Ubuntu 24.04, kernel 6.18 - a virtualised kernel, not bare-metal Linux; Python 3.12.3), this head merged ontomain5d10ea9ea(clean merge),python3 -I tools/tests/test_pr_overlap_dependencies.py:test_pr_overlap_dependencies.pyon top ofmainwithout the PR's source change): FAILED (5 failures).Not tested: macOS, Windows (Windows data from another run is not part of this comment).
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T03:37:08Z.
Windows data point for
358dda936e: Windows 10 19045, Python 3.12.10, WinLibs GCC 15.2.0 and Ninja on PATH, this head merged ontomain05f9995704(clean merge),python -I tools/tests/test_pr_overlap_dependencies.py:test_pr_overlap_dependencies.pyon top ofmainwithout the PR's source change): FAILED (5 failures).Not tested: Linux/macOS in this comment.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-21T05:33:03Z.
Review: COMMENTED
Verified on Windows 11, Python 3.14:
python -m unittest tools/tests/test_pr_overlap*.py: 61 tests, OK (4 skipped).tools/pr_overlap.pyreverted to main,test_markdown_links_and_full_urlsfails 5 of its 6 subtests, so the new test does cover the change.Depends on: none,[none](...), issue URLs, and PR URLs in prose afternoneall still give no dependencies./pull/12/files,/pull/12#issuecomment-1, comma-separated URLs and "and"-joined links parse correctly.python tools/check_conventions.py --base main: passed.github.com/<owner>/<repo>/pull/N, not only this repository's.- [x] Depends on: https://github.com/llvm/llvm-project/pull/12(or[llvm#12](https://github.com/llvm/llvm-project/pull/12)) now returns{12}, where main returnsset().overlaps()then treats AnyPS5 PR #12 as a dependency and drops the overlap report between the two PRs.rf"https?://github\.com/{re.escape(REPO)}/pull/(\d+)\b"withre.I, or pass the repo intodepends_on. The test helper already patchesREPOtoowner/repo, so the existing cases keep passing. Please add a subtest that a URL to another repository yieldsset().Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T05:44:45Z.
@emirplus @harisibrar1's check confirms the open ask from 20 Oct: the URL patterns accept a pull request from any repository, so a link to another project's PR #12 is read as a dependency on AnyPS5 #12 and hides a real overlap. Please match only this repository's URLs (case-insensitive), and add a subtest that a URL to another repository gives
set(). Thanks @harisibrar1 for the Windows run and the extra cases.Imported from boykopovar/AnyPS5. Originally posted by emirplus on 2026-10-21T16:36:30Z.
@oneandonlydean Updated to restrict pull request URLs and Markdown links strictly to this repository (case-insensitively). Also added subtests verifying that external pull request URLs and links to other repositories yield an empty set.
Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-21T17:56:37Z.
Review: APPROVED
Rechecked
486eb18dcmerged onto main950388bfd: links to other repositories (https://github.com/llvm/llvm-project/pull/12,[llvm#12](https://github.com/llvm/llvm-project/pull/12)) now giveset(), this repository's links are still read case-insensitively,nonestill parses, andtest_pr_overlap*.pypasses (4 platform skips).Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.