[PR #3903] [MERGED] Overlap note: one comment naming the open pull requests doing the same work #5281

Closed
opened 2026-11-03 05:11:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3903
Author: @ludovic111
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: feat/overlap-note


📝 Commits (1)

  • ca08886 Overlap note: one comment naming the open pull requests doing the same work

📊 Changes

4 files changed (+491 additions, -0 deletions)

View changed files

➕ .github/workflows/overlap-note.yml (+41 -0)
📝 CONTRIBUTING.md (+3 -0)
➕ tests/test_overlap_note.py (+147 -0)
➕ tools/ci/overlap_note.py (+300 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What and why

Step 2 of #3859: a bot notes overlap on every pull request, so authors find each other before reviewers do.
On open, reopen, push and ready-for-review, one comment (edited on later pushes, never repeated) lists up to 5 other
open pull requests against main that:

  • close the same issue (GraphQL closingIssuesReferences), or
  • change the same functions of the same files. Functions come from git's built-in rust/python hunk-header
    drivers on git diff -U0 main...head; these name indented methods (fn tick_dragon), where GitHub's own headers
    stop at impl Game<'_> {. A hunk that only adds new items doesn't count.

No note when there's none; when a listed overlap goes away, the note is edited to "none any more". Other pull
requests are named by number and author without @-mention (the #N link already shows up in their timeline).

Example (real, today):

🤖 Overlap: these open pull requests touch the same work. …

  • #3607 by degepie: also closes #3024; changes armor_layers in armor_stands.rs, stack_armor_layers in armor_stands.rs, render_visible in render.rs, render_with in render.rs

False positives, measured before enabling (as the plan asked)

overlap_note.py survey over all open pull requests (207 at the time), in a blobless clone like CI's:

Rule Pairs PRs with a note Judged related
any shared function 523 137 — (Renderer::new, draw_frame, Game::new everywhere)
+ hot functions (changed by ≥ 5 compared PRs), stacks and probes/tests out 295 115 ~⅓
+ ≥ 2 shared functions 58 53 ~½ (big PRs share a bit with everything)
+ a tenth of the bigger PR's functions (this PR) 21 34 16 related, 4 doubtful, 1 unrelated

Among the 16: four look like duplicates of each other's work: #3576/#3624 (same issue), #3607/#3622 (armour glint),
#3638/#3656 (water in waterlogged blocks), #3341/#3813 (styled item names, text shadow). The one unrelated pair
(#3655/#3686) shares enter_guest/leave_guest by chance.

.github/ change, explained

New .github/workflows/overlap-note.yml on pull_request_target (fork PRs need a token that can comment):

  • Runs main's file; checks out main (ref: main), blobless, with only tools/ci/overlap_note.py on disk;
    persist-credentials: false.
  • The pull requests' heads are fetched by SHA as git objects and only diffed (git diff), never checked out;
    git runs with core.hooksPath=/dev/null, core.fsmonitor=false, diff.external=, --no-ext-diff --no-textconv,
    and our own attributes file (only diff=rust|python|java). Nothing of theirs is built, run or imported.
  • Token: contents: read, pull-requests: write (the comment). Job-level concurrency per PR cancels a stale run.
  • Cost per event: a few GraphQL pages, one comment lookup, one write; git fetches up to 40 candidate heads.
  • tests/test_overlap_note.py checks the parser, the rules, the text and those properties of the workflow.

Docs: one paragraph in CONTRIBUTING.md under "Claim before you start".

Vanilla reference

None (tooling).

Self-check

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 90aded96a, 4 min 51 s)

Check Result
Scope ✅ 3 files, +488 −0
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 455 passed (4 min 50 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 1 affected, to run in CI (--quick): lan_integration
Label skip-release

Needs Ludovic

Nothing. Once it merges, notes appear on pull requests as they are pushed (not on all 200 at once).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3903 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/overlap-note` --- ### 📝 Commits (1) - [`ca08886`](https://github.com/horizon-rust/horizon/commit/ca0888663e252d9de7d707fdeb7ed670ceb248b4) Overlap note: one comment naming the open pull requests doing the same work ### 📊 Changes **4 files changed** (+491 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/overlap-note.yml` (+41 -0) 📝 `CONTRIBUTING.md` (+3 -0) ➕ `tests/test_overlap_note.py` (+147 -0) ➕ `tools/ci/overlap_note.py` (+300 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What and why Step 2 of #3859: **a bot notes overlap on every pull request**, so authors find each other before reviewers do. On open, reopen, push and ready-for-review, one comment (edited on later pushes, never repeated) lists up to 5 other open pull requests against main that: - **close the same issue** (GraphQL `closingIssuesReferences`), or - **change the same functions of the same files**. Functions come from git's built-in `rust`/`python` hunk-header drivers on `git diff -U0 main...head`; these name indented methods (`fn tick_dragon`), where GitHub's own headers stop at `impl Game<'_> {`. A hunk that only adds new items doesn't count. No note when there's none; when a listed overlap goes away, the note is edited to "none any more". Other pull requests are named by number and author **without @-mention** (the `#N` link already shows up in their timeline). Example (real, today): > 🤖 Overlap: these open pull requests touch the same work. … > - #3607 by degepie: also closes #3024; changes `armor_layers` in `armor_stands.rs`, `stack_armor_layers` in `armor_stands.rs`, `render_visible` in `render.rs`, `render_with` in `render.rs` ### False positives, measured before enabling (as the plan asked) `overlap_note.py survey` over all open pull requests (207 at the time), in a blobless clone like CI's: | Rule | Pairs | PRs with a note | Judged related | |---|---|---|---| | any shared function | 523 | 137 | — (`Renderer::new`, `draw_frame`, `Game::new` everywhere) | | + hot functions (changed by ≥ 5 compared PRs), stacks and probes/tests out | 295 | 115 | ~⅓ | | + ≥ 2 shared functions | 58 | 53 | ~½ (big PRs share a bit with everything) | | **+ a tenth of the bigger PR's functions (this PR)** | **21** | **34** | **16 related, 4 doubtful, 1 unrelated** | Among the 16: four look like duplicates of each other's work: #3576/#3624 (same issue), #3607/#3622 (armour glint), #3638/#3656 (water in waterlogged blocks), #3341/#3813 (styled item names, text shadow). The one unrelated pair (#3655/#3686) shares `enter_guest`/`leave_guest` by chance. ### `.github/` change, explained New `.github/workflows/overlap-note.yml` on `pull_request_target` (fork PRs need a token that can comment): - Runs main's file; checks out **main** (`ref: main`), blobless, with only `tools/ci/overlap_note.py` on disk; `persist-credentials: false`. - The pull requests' heads are fetched by SHA as git objects and only diffed (`git diff`), **never checked out**; git runs with `core.hooksPath=/dev/null`, `core.fsmonitor=false`, `diff.external=`, `--no-ext-diff --no-textconv`, and our own attributes file (only `diff=rust|python|java`). Nothing of theirs is built, run or imported. - Token: `contents: read`, `pull-requests: write` (the comment). Job-level concurrency per PR cancels a stale run. - Cost per event: a few GraphQL pages, one comment lookup, one write; git fetches up to 40 candidate heads. - `tests/test_overlap_note.py` checks the parser, the rules, the text and those properties of the workflow. Docs: one paragraph in CONTRIBUTING.md under "Claim before you start". ## Vanilla reference None (tooling). ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 90aded96a, 4 min 51 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +488 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 455 passed (4 min 50 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 1 affected, to run in CI (--quick): lan_integration | | Label | `skip-release` | ## Needs Ludovic Nothing. Once it merges, notes appear on pull requests as they are pushed (not on all 200 at once). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5281
No description provided.