mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
On open and push, overlap-note.yml (pull_request_target, main's script only) lists, in one comment edited on every push, the other open pull requests that close the same issue or change the same functions. Functions come from git's own rust/python hunk headers, which name indented methods (GitHub's stop at `impl Game<'_>`). The heads are fetched as objects and diffed, never checked out; hooks, fsmonitor, external diff and textconv are off. Measured on the 207 open pull requests: one shared function, or a few of a big pull request's hundred, was mostly chance, so a pair needs a shared issue, or 2 shared functions and a tenth of the bigger one's; functions 5 compared pull requests change, probes, tests and stacks don't count. 21 pairs (34 notes): 16 related (4 duplicates), 4 doubtful, 1 unrelated. Part of #3859. Co-Authored-By: Claude Opus 5.5 <[email protected]>
42 lines
1.6 KiB
YAML
42 lines
1.6 KiB
YAML
name: overlap note
|
|
# One comment on a pull request naming the other open pull requests that close the same issue or change the same
|
|
# functions, edited on every push (tools/ci/overlap_note.py, issue #3859).
|
|
#
|
|
# Why no pull request's code runs here, though `pull_request_target` gives a token that can write:
|
|
# - `pull_request_target` runs this file and the script from main, never the pull request's copy.
|
|
# - The checkout is main's (`ref: main`), blobless, with the script alone on disk. The pull requests' heads are fetched
|
|
# as git objects and only diffed, never checked out; git runs with hooks, fsmonitor, external diff and textconv off.
|
|
# - The rest comes from the API. The token writes the comment only.
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, reopened, synchronize, ready_for_review]
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
note:
|
|
if: github.event.pull_request.base.ref == 'main'
|
|
# A newer push replaces the note being computed.
|
|
concurrency:
|
|
group: overlap-note-${{ github.event.pull_request.number }}
|
|
cancel-in-progress: true
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: main
|
|
fetch-depth: 0
|
|
filter: blob:none
|
|
persist-credentials: false
|
|
sparse-checkout: |
|
|
tools/ci/overlap_note.py
|
|
sparse-checkout-cone-mode: false
|
|
- name: Note
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
REPO: ${{ github.repository }}
|
|
run: python3 tools/ci/overlap_note.py event
|