Repository navigation
fix(tools): recognize markdown links and pull request URLs in pr_overlap dependencies - #8025
Conversation
|
@emirplus thanks. One problem: the new patterns accept a pull request URL from any repository, so |
|
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.
|
|
Linux data point for
AI-assisted (Claude Code). |
|
Windows data point for
AI-assisted (Claude Code). |
harisibrar1
left a comment
There was a problem hiding this comment.
Verified on Windows 11, Python 3.14:
python -m unittest tools/tests/test_pr_overlap*.py: 61 tests, OK (4 skipped).- With
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.- Problem: the URL patterns on lines 43 and 45 accept any
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. - Suggested fix: match only URLs for the current repository, e.g.
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.
|
@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 |
358dda9 to
486eb18
Compare
|
@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. |
harisibrar1
left a comment
There was a problem hiding this comment.
Rechecked 486eb18 merged onto main 950388b: links to other repositories (https://github.com/llvm/llvm-project/pull/12, [llvm#12](https://github.com/llvm/llvm-project/pull/12)) now give set(), this repository's links are still read case-insensitively, none still parses, and test_pr_overlap*.py passes (4 platform skips).
Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
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)