ci(conventions): check pull requests with the current base branch rules #8892

Merged
harisibrar1 merged 1 commit from upstream-pr/8892 into main 2026-10-21 19:12:55 +00:00
harisibrar1 commented 2026-10-21 04:52:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-21T04:52:56Z.


What

The Conventions workflow checked out pull_request.base.sha, the base recorded when the pull request was opened, and ran that revision's checker. A rule merged after a pull request was opened never ran on it. #7005 passed with the checker of 07e741481, which had no env-reference rule, and merged APS5_NO_WGI without an ENVIRONMENT.md row.

  • conventions.yml: check out the current tip of pull_request.base.ref and pass --base HEAD. Check already diffs from git merge-base, so only the pull request's own changes are checked. It still runs only base-branch code and never executes pull request code.
  • check_conventions.py: an older branch lacks ENVIRONMENT.md rows added on the base branch after its branch point. Such a row now counts as documented unless the pull request removes it. Without this, #674 is reported for ANYPS5_INPUT_CONFIG, which main already documents.
  • CONTRIBUTING.md: say which checker revision runs.

Effect: an open pull request that breaks a rule merged after it was opened fails on its next push, edit or reopen.

Tested

Windows 11, Python 3.14.

  • python -m unittest on every tools/tests/test_check_conventions_*.py and test_env_reference.py: all pass. The new test test_a_row_the_target_added_after_the_branch_point_documents_the_read fails without the check_conventions.py change.
  • #7005, simulated as CI ran it: checkout 07e741481 with --base 07e741481 passes. Checkout of main at the time of the run with --base HEAD reports APS5_NO_WGI.
  • 31 open pull requests spread over the queue, old workflow against new workflow with this branch's checker: 27 identical. #674 and #7275 newly report ANYPS5_EDITOR_SCREENSHOT and APS5_HOT_RELOAD (no rows on main). #6481 and #6867 newly get debt-length warnings (no errors).
  • python tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py: #8777 and #6044 share files, and their hunks were checked by hand with no shared lines.
  • The workflow itself was not run on GitHub; it runs on the first pull_request_target event after merge.

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: Fixes #8891
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4946586029 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8892). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-21T04:52:56Z. --- ### What The Conventions workflow checked out `pull_request.base.sha`, the base recorded when the pull request was opened, and ran that revision's checker. A rule merged after a pull request was opened never ran on it. #7005 passed with the checker of 07e741481, which had no env-reference rule, and merged `APS5_NO_WGI` without an `ENVIRONMENT.md` row. - `conventions.yml`: check out the current tip of `pull_request.base.ref` and pass `--base HEAD`. `Check` already diffs from `git merge-base`, so only the pull request's own changes are checked. It still runs only base-branch code and never executes pull request code. - `check_conventions.py`: an older branch lacks `ENVIRONMENT.md` rows added on the base branch after its branch point. Such a row now counts as documented unless the pull request removes it. Without this, #674 is reported for `ANYPS5_INPUT_CONFIG`, which main already documents. - `CONTRIBUTING.md`: say which checker revision runs. Effect: an open pull request that breaks a rule merged after it was opened fails on its next push, edit or reopen. ### Tested Windows 11, Python 3.14. - `python -m unittest` on every `tools/tests/test_check_conventions_*.py` and `test_env_reference.py`: all pass. The new test `test_a_row_the_target_added_after_the_branch_point_documents_the_read` fails without the `check_conventions.py` change. - #7005, simulated as CI ran it: checkout 07e741481 with `--base 07e741481` passes. Checkout of main at the time of the run with `--base HEAD` reports `APS5_NO_WGI`. - 31 open pull requests spread over the queue, old workflow against new workflow with this branch's checker: 27 identical. #674 and #7275 newly report `ANYPS5_EDITOR_SCREENSHOT` and `APS5_HOT_RELOAD` (no rows on main). #6481 and #6867 newly get debt-length warnings (no errors). - `python tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py`: #8777 and #6044 share files, and their hunks were checked by hand with no shared lines. - The workflow itself was not run on GitHub; it runs on the first `pull_request_target` event after merge. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: Fixes #8891 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-21 05:06:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T05:06:48Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6044 CONTRIBUTING.md
PR 9137 tools/check_conventions.py
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6308523074 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8892#issuecomment-6308523074). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T05:06:48Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `CONTRIBUTING.md` | | [PR 9137](https://www.github.com/boykopovar/AnyPS5/pull/9137) | `tools/check_conventions.py` |
harisibrar1 commented 2026-10-21 05:11:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-21T05:11:02Z.


Checked by hand: #6044 adds a section at CONTRIBUTING.md line 21 (this PR changes line 44), and #8777 changes code() and symbol_nid in tools/check_conventions.py (this PR changes Check.__init__ and env_reference). No shared lines.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6308577387 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8892#issuecomment-6308577387). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-21T05:11:02Z. --- Checked by hand: #6044 adds a section at `CONTRIBUTING.md` line 21 (this PR changes line 44), and #8777 changes `code()` and `symbol_nid` in `tools/check_conventions.py` (this PR changes `Check.__init__` and `env_reference`). No shared lines.
MarcZX10 commented 2026-10-21 05:51:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T05:51:20Z.

Review: APPROVED


I reviewed the base-tip checkout and checker changes, including the merge-base diff behavior and the ENVIRONMENT.md rows inherited from the current target branch. I ran python3 -m unittest discover -s tools/tests -p "test_check_conventions_*.py" (143 passed) and python3 tools/check_conventions.py --base upstream/main (passed) on this head. The PR checks also pass. I found no blocking issue; the workflow integration itself still awaits its first GitHub run after merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5595475070 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8892#pullrequestreview-5595475070). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T05:51:20Z. **Review:** APPROVED --- I reviewed the base-tip checkout and checker changes, including the merge-base diff behavior and the `ENVIRONMENT.md` rows inherited from the current target branch. I ran `python3 -m unittest discover -s tools/tests -p "test_check_conventions_*.py"` (143 passed) and `python3 tools/check_conventions.py --base upstream/main` (passed) on this head. The PR checks also pass. I found no blocking issue; the workflow integration itself still awaits its first GitHub run after merge.
adriadam10 commented 2026-10-21 19:13:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T19:13:55Z.


Checked the workflow change (current base tip with --base HEAD, merge-base still scopes the diff, only base code runs), the ENVIRONMENT.md rows inherited from the target (minus rows the PR drops) and the three new tests; the inherited-row test needs the check_conventions.py change. Conventions, intake and labels are green on the head; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6324378182 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8892#issuecomment-6324378182). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-21T19:13:55Z. --- Checked the workflow change (current base tip with `--base HEAD`, merge-base still scopes the diff, only base code runs), the `ENVIRONMENT.md` rows inherited from the target (minus rows the PR drops) and the three new tests; the inherited-row test needs the `check_conventions.py` change. Conventions, intake and labels are green on the head; merged.
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!8892
No description provided.