fix(tools): report conflicts and exports between an author's own pull requests #1228
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1228"
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 ebosido444-ai on 2026-10-07T18:32:04Z.
What
tools/pr_overlap.py'sconflicts()derived its file set only from a failinggit merge-tree, soclashes()— the range-level comparator — never ran for pairs whose hunks overlap yet merge cleanly. Root cause and live repro identified by @Dextroid17 in review of the previous revision. Three behaviours, all asserted:conflicts+exportscolumns (the earlier revision) — stacked PRs reach review labeled instead of silent.Tested
Windows 11, Python 3.14, standalone harness importing
tools/pr_overlap.pywithmerge/clashesstubbed to mirrorscan()'s dict shape (pure pair logic), 7/7 green: (1) overlapping hunks + clean merge → row with spans [the new root case], (2) merge-failed pair with empty ranges → row [the positive @Dextroid17 flagged as unexercised, now asserted], (3) disjoint hunks + clean merge → quiet, (4) same new file → row, (5) shared exports → row, (6) cross-author unchanged, (7)Depends onsuppression intact.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T21:30:46Z.
The change is safe, and I verified that properly. But I could not reproduce the motivating case with it, and I think the reason is worth knowing before this merges.
Safety: confirmed. Removing the guard cannot turn a clean pair into a reported one.
conflicts()bails before doing any work when the pair shares no file (pr_overlap.py:87), andexportsis an intersection, so both stay empty;overlaps()still ends inreturn found if any(found.values()) else None. Nothing new can be reported that has nothing in it.Motivating case, live: #1049 and #1053 are both @Kikoarl and both touch
tools/progress.py, so with the guard they are exactly the same-author pair the report misses.But they are not reported by this change either. Driving the two versions through the module's own functions (fetching
refs/pr/base,refs/pr/1049,refs/pr/1053, thenscan()on each andoverlaps(prs, 1049, 1053)):The reason is
conflicts()'s second source of truth:filesis populated only whengit merge-treefails, i.e. when the pair genuinely conflicts. Two PRs that edit the same file in different places merge cleanly, sofilesis empty andconflicts()returns{}without consultingclashes()at all. The guard was not what made that pair invisible —conflicts()'s dependence on a failed merge is.So the change has a real effect in two situations: same-author pairs whose merge does conflict, and same-author pairs whose exports intersect. If the case that reached review today was two PRs editing the same lines without conflicting, this PR will not surface it either.
What I did not do: I did not construct a conflicting same-author pair to watch the new path report it. I have no reason to doubt it does —
conflicts/exportsare simply computed now instead of skipped — but the positive case is unexercised in what I ran, and I would rather say that than imply I saw it.If the intent is also to surface the non-conflicting same-file case,
clashes()(hunks onrefs/pr/base→pr["tree"]) already has everything it needs; the missing piece is calling it for shared files rather than only for files that failed to merge. That may be a follow-up rather than this PR, but it is the case in the description.Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-07T23:09:50Z.
Root cause adopted wholesale — pushed on this head (
e9465aeb).clashes()now runs for every shared file instead of only merge-failing ones, so the auto-resolved identical-edit class reports with real line spans, and the positive you flagged as unexercised (merge-failed pair, empty ranges) is now assert 2 of 7.One semantic point for the record: your live pair (#1049/#1053 — disjoint hunks, clean merge) stays quiet by design; the report charter is "merging one will break the other, or both implement the same thing", and co-location alone is neither. Assert 3 pins that so any widening is a deliberate decision.
The guard I removed in the first revision was the symptom — you found the disease.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T02:44:36Z.
Closing: no open pair is shown that this reports and main misses, and running
clashes()on every shared file would list pairs that merge cleanly under "Merging one will break the other". If you find a pair main misses, please comment here with the two PR numbers.Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-08T09:12:37Z.
Accepted — closing is right on your terms: the 7/7 asserts were synthetic while your read is measured across the live open set, and no pair exists today that this surfaces and main misses. Dextroid17 predicted the same boundary from the other side (clean-merging pairs under a "would break" banner). I'll bring the two-PR-numbers case if one materializes.
Pull request closed