Skip to content

fix(tools): report squash-merged PRs in main sync checks - #10380

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Bram910:fix/main-sync-squash-prs
Oct 25, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Bram910:fix/main-sync-squash-prs

Conversation

@Bram910

@Bram910 Bram910 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

What

tools/check_main_sync.py lists upstream PRs that touched files also changed on the current branch, but it only recognizes Merge pull request #N subjects. GitHub squash merges use a trailing (#N), so they are omitted. This repository already contains that format, for example #1119 at 881fb01069.

Recognize the trailing squash-merge number as well as the existing merge-commit format. Keep the first-parent and shared-path filtering, commit association, conflict detection and exit statuses unchanged. A (#N) reference in the middle of a subject is not treated as a squash merge.

Tested

Base main: 3c44638fc67f00471aded5f12311983fdb300d3a. Tested head: c9ace48eb71bf4b28e16265c3ae2bc387df543f4. Publication recheck against newer main a42f61d5b1: its changes are limited to libkernel_sys and do not change this tool or its tests.

  • Red/green: all three new regression methods fail against main's unchanged production implementation, then pass with the fix. The tests create real Git squash merges and cover both clean and conflicting shared-file edits, relaxed/strict exit statuses, multiple references in a subject and exclusion of an unrelated-path commit.
  • Real repository history: merged_pull_requests over commit 881fb01069 and its Net source path returns {} on main and identifies PR 1119 with the fix.
  • Windows x64, Python 3.13.5: python tools/tests/test_check_main_sync.py -v, 16/16 tests pass, no skips. The three new methods also pass independently.
  • Ubuntu 22.04 under WSL, Python 3.10.12, isolated Git 2.51.0: python3 tools/tests/test_check_main_sync.py -v, 16/16 tests pass, no skips. The distro's Git 2.34.1 cannot run the tool's existing merge-tree --write-tree command, so validation used a checksum-verified upstream Git build installed only under ignored build-tools; system Git was not upgraded.
  • Windows MinGW-w64 GCC 14.1.0 UCRT, Ninja Release, ANYPS5_RELINKER_ONLY=ON, BUILD_TESTING=ON: cmake --build build-relinker --parallel 4 and ctest --test-dir build-relinker --output-on-failure --parallel 4; 235/235 CTest entries pass.
  • The focused registered check_main_sync CTest also passes twice consecutively without competing build jobs: 24.67 s and 22.89 s. Command: ctest --test-dir build-relinker -R '^check_main_sync$' --output-on-failure --repeat until-fail:2.
  • python tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch fix/main-sync-squash-prs --jobs 4: no overlap with open pull requests.
  • python tools/check_conventions.py --base origin/main and git diff --check pass.
  • No PS5, title, GPU, macOS or full-runtime run; this changes Python tooling only.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes, Codex

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the parser change and its regression coverage. The regex preserves the existing merge-commit capture while accepting a trailing (#N) squash reference only; the new cases cover clean/conflicting squash merges, strict status, multiple references, nonterminal references and unrelated paths. I ran python3 tools/tests/test_check_main_sync.py -v at the exact PR head: 13/13 tests passed; python3 tools/check_conventions.py --base upstream/main --head upstream/pr/10380 and git diff --check upstream/main...upstream/pr/10380 also passed. Hosted conventions, eligibility, intake, labels and report pass; relinker/platform jobs are still running, and product jobs are path-skipped. The author separately reports 16/16 on Windows and Linux. No blocking issue found in this change.

@oneandonlydean oneandonlydean self-assigned this Oct 23, 2026

@THEMANnt THEMANnt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head c9ace48eb71bf4b28e16265c3ae2bc387df543f4 against pinned base a42f61d5b15d0263a81a1dc62c62f555c3f40d7c. No actionable findings in this focused review.

merged_pull_requests() previously recognized only Merge pull request #N. It now also recognizes a trailing (#N) and selects the populated capture group while preserving the associated commit hash. The suffix anchor excludes middle-of-subject references; first-parent history and shared-path filtering remain unchanged. I inspected the report/render/CLI callers and tests covering clean and conflicting squash merges, relaxed/strict statuses, multiple references, unrelated paths, existing merge subjects, Unicode paths and missing/unrelated refs.

The controller's local execution of tools/tests/test_check_main_sync.py on Windows AMD64, Python 3.11.9 and Git 2.52.0.windows.1 passed 13 baseline test methods, 16 pristine PR methods and 16 candidate methods, with no reported skips. Running the candidate tests against baseline production code failed exactly the three new regression methods: each expected PR 4242's commit association but received an empty map. These were behavior assertion failures, with the remaining methods passing. The recorded conventions check also passed; the whitespace command reported no errors.

GitHub-reported CI shows success for relinker (ubuntu-latest, g++), relinker (windows-latest, g++), both listed macOS clang++ relinker jobs, relinker-asan, and conventions. The windows, linux, write-watch and register-context jobs were skipped, so they provide no passing product-test evidence. The author's additional platform, compiler and CTest claims remain separate from independent local validation. No game, GPU or full-runtime validation was performed.

@oneandonlydean
oneandonlydean merged commit b7681c0 into boykopovar:main Oct 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants