fix(tools): fetch each open pull request by the head commit the API reports #3427

Merged
reyani-dev merged 1 commit from upstream-pr/3427 into main 2026-10-11 10:35:24 +00:00
reyani-dev commented 2026-10-11 10:14:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T10:14:08Z.


What

The PR overlap workflow has failed on every push to main since 10:02 UTC today (last success 09:59). The step dies in fetch:

fatal: couldn't find remote ref refs/pull/3418/head
subprocess.CalledProcessError: Command '['git', 'fetch', '--no-tags', '-q', 'https://github.com/boykopovar/AnyPS5.git', '+refs/heads/main:refs/pr/base', '+refs/pull/3424/head:refs/pr/3424', ...

Open PR #3418 has no refs/pull/3418/head on GitHub: git ls-remote lists only refs/pull/3418/merge. fetch asks for every open PR's refs/pull/N/head in one command, so a single missing ref fails the whole run, and no overlap report gets written for anyone. pr_overlap.py --branch fails locally the same way.

open_prs already reads each PR's head commit from the API (pr["sha"]). fetch now fetches that commit (+<sha>:refs/pr/N) instead of the head ref. GitHub serves a commit that is reachable from the repository by its id: #3418's head a8e6c104 fetches fine this way. The comparison then also uses exactly the commit the API reported, without a window where the ref has moved. FetchTests pins the refspecs.

Tested

Windows 11, Python 3.12.6, on main 24cb0d24:

  • Every tools/tests/test_*.py passes. The new FetchTests case fails with main's pr_overlap.py.
  • With the open PRs as of now, including #3418:
    • pr_overlap.py --out <dir> (the workflow's mode) writes reports for all 118 open PRs in 38 s;
    • --branch HEAD completes.
    • main's script fails on both with the error above.
  • check_conventions.py passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4818308250 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3427). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T10:14:08Z. --- ### What The **PR overlap** workflow has failed on every push to `main` since 10:02 UTC today (last success 09:59). The step dies in `fetch`: ``` fatal: couldn't find remote ref refs/pull/3418/head subprocess.CalledProcessError: Command '['git', 'fetch', '--no-tags', '-q', 'https://github.com/boykopovar/AnyPS5.git', '+refs/heads/main:refs/pr/base', '+refs/pull/3424/head:refs/pr/3424', ... ``` Open PR #3418 has no `refs/pull/3418/head` on GitHub: `git ls-remote` lists only `refs/pull/3418/merge`. `fetch` asks for every open PR's `refs/pull/N/head` in one command, so a single missing ref fails the whole run, and no overlap report gets written for anyone. `pr_overlap.py --branch` fails locally the same way. `open_prs` already reads each PR's head commit from the API (`pr["sha"]`). `fetch` now fetches that commit (`+<sha>:refs/pr/N`) instead of the head ref. GitHub serves a commit that is reachable from the repository by its id: #3418's head `a8e6c104` fetches fine this way. The comparison then also uses exactly the commit the API reported, without a window where the ref has moved. `FetchTests` pins the refspecs. ### Tested Windows 11, Python 3.12.6, on `main` `24cb0d24`: - Every `tools/tests/test_*.py` passes. The new `FetchTests` case fails with `main`'s `pr_overlap.py`. - With the open PRs as of now, including #3418: - `pr_overlap.py --out <dir>` (the workflow's mode) writes reports for all 118 open PRs in 38 s; - `--branch HEAD` completes. - `main`'s script fails on both with the error above. - `check_conventions.py` passes. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-11 10:19:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T10:19:56Z.


I hit the same failure while checking #3392: the overlap workflow could not fetch refs/pull/3418/head, so it did not produce a report. This change addresses that exact failure by fetching the head SHA already returned by the API, and using that same snapshot for the scan also avoids a ref moving between API lookup and fetch.

I reviewed the full diff. The completed checks are green; macOS Intel registration and macOS relinker checks are still pending in the latest run. I do not see a remaining issue in this change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108011491 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3427#issuecomment-6108011491). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T10:19:56Z. --- I hit the same failure while checking #3392: the overlap workflow could not fetch `refs/pull/3418/head`, so it did not produce a report. This change addresses that exact failure by fetching the head SHA already returned by the API, and using that same snapshot for the scan also avoids a ref moving between API lookup and fetch. I reviewed the full diff. The completed checks are green; macOS Intel registration and macOS relinker checks are still pending in the latest run. I do not see a remaining issue in this change.
adriadam10 commented 2026-10-11 10:35:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T10:35:21Z.


Checked: the new FetchTests case fails with main's pr_overlap.py and passes here; ctest 13/13; fetching #3418's head commit (a8e6c104) by sha from the repository works, while refs/pull/3418/head does not exist. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108129771 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3427#issuecomment-6108129771). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T10:35:21Z. --- Checked: the new `FetchTests` case fails with `main`'s `pr_overlap.py` and passes here; ctest 13/13; fetching #3418's head commit (`a8e6c104`) by sha from the repository works, while `refs/pull/3418/head` does not exist. Merging.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
boykopovar/AnyPS5!3427
No description provided.