CI: allow reviewed test-only diffs without retail smoke #502

Merged
ZekkJJ merged 1 commit from upstream-pr/507 into main 2026-11-24 02:44:36 +00:00
ZekkJJ commented 2026-11-24 01:05:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ZekkJJ on 2026-11-24T01:05:20Z.


Implements the maintainer-label approach proposed in #452. A test-only edit in a runtime source file can be exempted from retail smoke after someone with repository triage access reviews the diff and applies test-only.

What is in it

  • The existing check accepts that exemption on a test-only label event when the live PR still matches the event's head, target branch, and description. Subsequent pushes and edits use normal validation until the label is reapplied.
  • The workflow keeps its read-only permissions. Required description sections, AI-use validation, and asset checks still run.

The workflow routes unrelated label changes to a separate check to preserve the last description result. Thanks to PHeitor1 for testing the waiver and reporting the label interaction.

Tested

  • Windows 11 build 26200, Ryzen 7 8845HS, RTX 4060 Laptop GPU, Rust 1.95.0, debug.
  • python -B -m unittest discover -s scripts -p test_pr_check.py -v passed 3 tests.
  • Ran the workflow's Bash step locally with mocked GitHub responses. Seven cases passed, including the valid label event, a retained label after a push, label removal, and stale head/target/description.
  • actionlint 1.7.12 passed. The GitHub Actions expression evaluator passed nine event cases from the workflow YAML. Adding or removing an unrelated label uses a separate check name and skips the description checker. Applying or removing the test-only label still runs it.
  • Workspace build and cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture passed on the 2997c9a base with this patch. 676 passed, 0 failed, 41 ignored. Two wave64 cases reported runtime skips.

Not tested

  • Live label events in ivall/xcl. Trying them requires the repository label and the updated workflow on the base branch. The patch changes only CI and contributor documentation.

AI use

  • Codex (GPT-6, exact variant unavailable) implemented and tested the change and drafted this PR.
<!-- greyfinch-sync:ivall/xcl:issue:6572232070 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/507). Originally posted by [ZekkJJ](https://github.com/ZekkJJ) on 2026-11-24T01:05:20Z. --- Implements the maintainer-label approach proposed in #452. A test-only edit in a runtime source file can be exempted from retail smoke after someone with repository triage access reviews the diff and applies `test-only`. **What is in it** - The existing check accepts that exemption on a `test-only` label event when the live PR still matches the event's head, target branch, and description. Subsequent pushes and edits use normal validation until the label is reapplied. - The workflow keeps its read-only permissions. Required description sections, AI-use validation, and asset checks still run. The workflow routes unrelated label changes to a separate check to preserve the last description result. Thanks to PHeitor1 for [testing the waiver and reporting the label interaction](https://github.com/ivall/xcl/pull/507#issuecomment-7119100998). **Tested** - Windows 11 build 26200, Ryzen 7 8845HS, RTX 4060 Laptop GPU, Rust 1.95.0, debug. - `python -B -m unittest discover -s scripts -p test_pr_check.py -v` passed 3 tests. - Ran the workflow's Bash step locally with mocked GitHub responses. Seven cases passed, including the valid label event, a retained label after a push, label removal, and stale head/target/description. - actionlint 1.7.12 passed. The GitHub Actions expression evaluator passed nine event cases from the workflow YAML. Adding or removing an unrelated label uses a separate check name and skips the description checker. Applying or removing the test-only label still runs it. - Workspace build and `cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture` passed on the `2997c9a` base with this patch. 676 passed, 0 failed, 41 ignored. Two wave64 cases reported runtime skips. **Not tested** - Live label events in `ivall/xcl`. Trying them requires the repository label and the updated workflow on the base branch. The patch changes only CI and contributor documentation. **AI use** - Codex (GPT-6, exact variant unavailable) implemented and tested the change and drafted this PR.
upstream-sync closed this pull request 2026-11-24 06:58:40 +00:00
PHeitor1 commented 2026-11-24 07:05:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by PHeitor1 on 2026-11-24T01:26:24Z.


Ran this PR's scripts/pr_check.py (302615f) with --local against the two cases that motivated it, using Python 3.13.17 on Windows 11. The body is #264's description, which has no xcl-smoke blocks.

files without --test-only with --test-only
#343's fix: hle/d3d12x/vram.rs + gpu/recomp/tests.rs fails: both smoke-block problems description ok
#264 + hle/kernelx.rs (the skip line kept out of it) fails: both smoke-block problems description ok
a binary under crates/xcl/src/ (exe.rs.dll, binary) fails: game-data + smoke still fails on the game-data rule only

So the flag drops only the smoke check, as described. The PR's test_pr_check.py: 3 tests, all OK.

One gap: the job runs on every labeled / unlabeled event, but TEST_ONLY_APPROVAL is true only when the label in that event is test-only.

  • Say a maintainer applies test-only and the check goes green. If anyone later adds or removes another label (bug, gpu and so on), that event re-runs the check without --test-only, and the PR goes red again with no new push or edit.
  • The approval is lost to an unrelated label change, and the label has to be removed and reapplied to get it back.

A fix: for a labeled / unlabeled event of another label, keep the waiver when the live PR still carries test-only and the label was applied after the head commit was pushed.

  • The step could read the PR's timeline (gh api repos/$REPO/issues/$NUMBER/timeline): the last labeled event for test-only against the last head_ref_force_pushed / committed event.
  • Exiting early (exit 0) or a job-level if: would not do. Both report success, which would also turn a real failure green.

Reviewed and written with Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7119100998 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/507#issuecomment-7119100998). Originally posted by [PHeitor1](https://github.com/PHeitor1) on 2026-11-24T01:26:24Z. --- Ran this PR's `scripts/pr_check.py` (`302615f`) with `--local` against the two cases that motivated it, using Python 3.13.17 on Windows 11. The body is #264's description, which has no `xcl-smoke` blocks. | files | without `--test-only` | with `--test-only` | |---|---|---| | #343's fix: `hle/d3d12x/vram.rs` + `gpu/recomp/tests.rs` | fails: both smoke-block problems | `description ok` | | #264 + `hle/kernelx.rs` (the skip line kept out of it) | fails: both smoke-block problems | `description ok` | | a binary under `crates/xcl/src/` (`exe.rs.dll`, binary) | fails: game-data + smoke | still fails on the game-data rule only | So the flag drops only the smoke check, as described. The PR's `test_pr_check.py`: 3 tests, all OK. **One gap:** the job runs on every `labeled` / `unlabeled` event, but `TEST_ONLY_APPROVAL` is true only when the label in that event is `test-only`. - Say a maintainer applies `test-only` and the check goes green. If anyone later adds or removes another label (`bug`, `gpu` and so on), that event re-runs the check without `--test-only`, and the PR goes red again with no new push or edit. - The approval is lost to an unrelated label change, and the label has to be removed and reapplied to get it back. A fix: for a `labeled` / `unlabeled` event of another label, keep the waiver when the live PR still carries `test-only` and the label was applied after the head commit was pushed. - The step could read the PR's timeline (`gh api repos/$REPO/issues/$NUMBER/timeline`): the last `labeled` event for `test-only` against the last `head_ref_force_pushed` / `committed` event. - Exiting early (`exit 0`) or a job-level `if:` would not do. Both report success, which would also turn a real failure green. _Reviewed and written with Claude Code (Claude Opus 5.5)._
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
xcl-dev/xcl!502
No description provided.