ci(build): run pull request jobs only when their files change #4405

Merged
adriadam10 merged 1 commit from upstream-pr/4405 into main 2026-10-12 09:54:46 +00:00
adriadam10 commented 2026-10-12 09:35:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T09:35:45Z.


What

Fixes a regression: since the path filter of #1704 was replaced by the eligibility job, register-context (#1499) and write-watch (#1686) went in without needs: eligibility, so their 6 runners (Ubuntu and macOS) run on every event of every pull request, documentation included, and the relinker matrix runs on every pull request whose author has a commit in main. Runs were queueing behind them (59 queued when this was written).

  • eligibility lists the pull request files (pulls.listFiles, paginated, renames counted by both names) and sets one output per job:
    • relinker: the author rule stays, and the pull request must also change a file the relinker-only build uses: core/relinker/, core/libs/prx/libc/ (VabiMacros.hpp, Windows specifics), core/libs/prx/libkernel/AppMetadata/ and core/libs/tests/ParamJsonParser.cpp, the two shader cache files the top-level CMakeLists.txt builds before ANYPS5_RELINKER_ONLY returns, tools/ (its ctest runs the tools/tests suites), cmake/, CMakeLists.txt or build.yml.
    • register-context: its directory, RegisterContext.cpp, core/libs/prx/libc/ (it includes libc/src/specifics/x86_64/RegisterContext.cpp) or build.yml.
    • write-watch: its directory, WriteWatch.cpp, core/libs/prx/libc/ (GuestWriteWatch.cpp) or build.yml.
    • Pushes to main, manual runs and pull requests of 3000 files or more (the listFiles limit) run everything, as before.
  • New Conventions rule ci-gate so this cannot happen again: a job in a workflow triggered by pull_request fails the check unless the trigger has paths/paths-ignore, or the job has needs: eligibility and an if on needs.eligibility.outputs.*. Multi-line needs/if are read. On today's main it reports exactly register-context and write-watch.
  • CONTRIBUTING: one sentence with the rule.

The rule only applies once merged (Conventions runs the base branch checker).

Tested

  • tools/tests/test_check_conventions_ci_gate.py (registered in ctest as conventions_ci_gate): ungated job, needs without if, if on another condition, gated job, gate over several lines, paths filter, paths of another trigger, inline on: [push, pull_request], other triggers, and every workflow in the repository passing. Mutation check: replacing the register-context condition with sed makes the repository case fail, restoring it passes.
  • The eligibility script run in node with a mocked github: docs-only pull request → nothing runs; libc change → all three; write_watch/CMakeLists.txt → only write watch; tools/ → only relinker; author without commits → no relinker; CMakeLists.txt.bak / core/relinkerx/ → nothing (exact names and prefixes); 3000 files and push → everything.
  • Existing conventions tests and test_registration pass; python3 tools/check_conventions.py --base upstream/main passes.

@oneandonlydean this is the path filter regression after the 2026-10-09 change, merging it now since runs are queueing; say if a path is missing and I'll add it.

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
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4827553205 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4405). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-12T09:35:45Z. --- ### What Fixes a regression: since the path filter of #1704 was replaced by the `eligibility` job, `register-context` (#1499) and `write-watch` (#1686) went in without `needs: eligibility`, so their 6 runners (Ubuntu and macOS) run on every event of every pull request, documentation included, and the relinker matrix runs on every pull request whose author has a commit in `main`. Runs were queueing behind them (59 queued when this was written). - `eligibility` lists the pull request files (`pulls.listFiles`, paginated, renames counted by both names) and sets one output per job: - `relinker`: the author rule stays, and the pull request must also change a file the relinker-only build uses: `core/relinker/`, `core/libs/prx/libc/` (`VabiMacros.hpp`, Windows specifics), `core/libs/prx/libkernel/AppMetadata/` and `core/libs/tests/ParamJsonParser.cpp`, the two shader cache files the top-level `CMakeLists.txt` builds before `ANYPS5_RELINKER_ONLY` returns, `tools/` (its ctest runs the `tools/tests` suites), `cmake/`, `CMakeLists.txt` or `build.yml`. - `register-context`: its directory, `RegisterContext.cpp`, `core/libs/prx/libc/` (it includes `libc/src/specifics/x86_64/RegisterContext.cpp`) or `build.yml`. - `write-watch`: its directory, `WriteWatch.cpp`, `core/libs/prx/libc/` (`GuestWriteWatch.cpp`) or `build.yml`. - Pushes to `main`, manual runs and pull requests of 3000 files or more (the `listFiles` limit) run everything, as before. - New Conventions rule `ci-gate` so this cannot happen again: a job in a workflow triggered by `pull_request` fails the check unless the trigger has `paths`/`paths-ignore`, or the job has `needs: eligibility` and an `if` on `needs.eligibility.outputs.*`. Multi-line `needs`/`if` are read. On today's `main` it reports exactly `register-context` and `write-watch`. - CONTRIBUTING: one sentence with the rule. The rule only applies once merged (Conventions runs the base branch checker). ### Tested - `tools/tests/test_check_conventions_ci_gate.py` (registered in ctest as `conventions_ci_gate`): ungated job, `needs` without `if`, `if` on another condition, gated job, gate over several lines, `paths` filter, `paths` of another trigger, inline `on: [push, pull_request]`, other triggers, and every workflow in the repository passing. Mutation check: replacing the `register-context` condition with `sed` makes the repository case fail, restoring it passes. - The `eligibility` script run in node with a mocked `github`: docs-only pull request → nothing runs; `libc` change → all three; `write_watch/CMakeLists.txt` → only write watch; `tools/` → only relinker; author without commits → no relinker; `CMakeLists.txt.bak` / `core/relinkerx/` → nothing (exact names and prefixes); 3000 files and push → everything. - Existing conventions tests and `test_registration` pass; `python3 tools/check_conventions.py --base upstream/main` passes. @oneandonlydean this is the path filter regression after the 2026-10-09 change, merging it now since runs are queueing; say if a path is missing and I'll add it. ### 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] Unblocks: none - [x] AI-assisted: yes
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!4405
No description provided.