fix(gate): count qualified cross-repository issue references as competing work - #93
Conversation
…ting work The competing-work scan only matched bare "#N" references, but GitHub also auto-links qualified "owner/name#N" references. A PR whose body says "Fixes bytedance/deer-flow#5043" therefore passed the competing-work gate even though an open PR for the same issue existed (deer-flow #5043/#5045). Match qualified references whose qualifier equals the target repository (case-insensitively), ignore qualifiers pointing at other repositories and URL fragments such as "#issuecomment-1", and de-duplicate bare and qualified references to the same issue within one pull request. Add regression tests covering the deer-flow miss, other-repo qualifiers, case-insensitive matching, deduplication, and URL fragments. Closes tiammomo#92 Signed-off-by: betterkite <1240167669@qq.com>
tiammomo
left a comment
There was a problem hiding this comment.
Reviewed dd413d65b6b68ba8330f2e23759d29129d083521. This is a useful, focused fix for #92: matching the full repository qualifier case-insensitively closes the reported gap, preserves the existing own-PR filtering, and deduplicates each PR's references without combining different issue numbers. I found no blocking code issues in the two-file diff.
I also tested an unpublished merge of this head with current main e555d77d3001f16d2fb52951f21de00f50fff5dc. It merges without conflicts. The hardened verifier passed all 544 tests (including the five added regressions and MCP tests), the 33-test GitHub module suite, Ruff lint and format checks, CLI smoke, and the package build. Dependency bootstrap had network access; tests and checks ran without network or GitHub credentials. This integration result is local evidence and does not replace the required GitHub check.
The current branch is behind, and main requires branches to be up to date for the quality check. Please update the PR branch with current main and let that required check run on the updated head before merging. My code-review recommendation is to accept this fix, subject to reviewing any changes introduced by that update.
One non-blocking documentation correction: the PR body says six new regression tests, while the diff adds five test methods.
This maintainer review was prepared with coding-agent assistance.
Closes #92
Treat qualified owner/name#N issue references as competing work when the qualifier matches the target repository
The competing-work scan only matched bare #N references, but GitHub also auto-links qualified owner/name#N references, so PR #5045 in bytedance/deer-flow passed the gate for issue #5043 despite targeting it (Closes #92). The fix adds a qualified reference pattern whose qualifier must equal the target repository full_name case-insensitively, ignores qualifiers pointing at other repositories and URL fragments such as #issuecomment-1, and de-duplicates bare and qualified references to the same issue within one pull request. Six regression tests cover the deer-flow miss, other-repo qualifiers, case-insensitive matching, deduplication, and URL fragments. Local checks: full unittest suite (381 tests; the only 3 failures are the pre-existing macOS /private/var path failures that also fail on clean main), ruff check, ruff format --check, and CLI smoke all pass. Container verification runs the full unittest suite and the focused regression class without network. Change is limited to src/reposteward/github.py and tests/test_github.py. Authored with coding-agent assistance and human-reviewed before publication.
Verified with
uv run --no-sync python -m unittest discover -s tests,uv run --no-sync python -m unittest tests.test_github.GitHubCompetingWorkTests -v.Areas for careful review:
Implementation assistance: an external coding workspace was used to prepare the change and its
tests.
betterkitereviewed the final diff, understands it, and takes responsibilityfor this contribution.