ci: skip a push to main that the merge queue already passed (CI-SKIP-QUEUED-PUSH) #3098

Open
MoonEyes wants to merge 3 commits from upstream-pr/3098 into main
MoonEyes commented 2026-12-02 10:44:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T10:44:02Z.


Claimed in the coordination issue as: CI-SKIP-QUEUED-PUSH (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7342924568)

Depends on: #2930 (touches the same change-scope and job if: lines; whichever merges second is rebased)

What and why

The merge queue fast-forwards main to the exact commit it tested (merge method MERGE), so the CI run on each push to main repeats a green merge_group run on the same SHA. From 1 December 22:15 to 2 December 10:00 UTC, all 25 push runs of CI were on a SHA that had already passed CI in the queue: 424 runner minutes, on the same runners the queue's jobs wait for (their p90 wait was 3.5 to 6 min).

change-scope now also runs on push. It asks the Actions API whether ci.yml already succeeded in merge_group for $GITHUB_SHA (up to three tries, 10 s apart, because the queue can move main a few seconds before its run is marked complete). Only then are check, linux-python-and-viewer and semantic-tests skipped.

Same safety as before:

  • a direct push, a failed or missing queue run, or an API error leaves queue-tested false and every job runs;
  • pull requests, the merge queue, the daily scheduled run and workflow_dispatch are unchanged;
  • no-game-data and the D3D12 workflow are untouched.

Tested

  • python -I tests/test_ci_registration.py (18 OK), tests/test_runner_calls_all_tests.py, tests/test_progress_dashboard_ci.py, tests/test_no_game_data_workflow.py: OK.
  • The API query was run by hand on a recent push SHA: it returns 1 for the merge_group run of ci.yml.
  • Measurements: 674 runs read with gh api (300 pull request, 74 merge queue, 300 push).
  • actionlint was not available locally; jactionlint runs on this pull request.

GPUs tested: n/a

AI-assisted: yes (Claude Opus 5.5; a separate read-only reviewer agent on Claude Opus 5.5 audited the diff and accepted it, and its one remark, the retry, is included).

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

A .github/ change: a second maintainer has to agree.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5604810298 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3098). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T10:44:02Z. --- Claimed in the coordination issue as: CI-SKIP-QUEUED-PUSH (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7342924568) Depends on: #2930 (touches the same `change-scope` and job `if:` lines; whichever merges second is rebased) ### What and why The merge queue fast-forwards `main` to the exact commit it tested (merge method MERGE), so the CI run on each push to `main` repeats a green `merge_group` run on the same SHA. From 1 December 22:15 to 2 December 10:00 UTC, all 25 push runs of CI were on a SHA that had already passed CI in the queue: 424 runner minutes, on the same runners the queue's jobs wait for (their p90 wait was 3.5 to 6 min). `change-scope` now also runs on push. It asks the Actions API whether `ci.yml` already succeeded in `merge_group` for `$GITHUB_SHA` (up to three tries, 10 s apart, because the queue can move `main` a few seconds before its run is marked complete). Only then are `check`, `linux-python-and-viewer` and `semantic-tests` skipped. Same safety as before: - a direct push, a failed or missing queue run, or an API error leaves `queue-tested` false and every job runs; - pull requests, the merge queue, the daily scheduled run and `workflow_dispatch` are unchanged; - `no-game-data` and the D3D12 workflow are untouched. ### Tested - `python -I tests/test_ci_registration.py` (18 OK), `tests/test_runner_calls_all_tests.py`, `tests/test_progress_dashboard_ci.py`, `tests/test_no_game_data_workflow.py`: OK. - The API query was run by hand on a recent push SHA: it returns 1 for the `merge_group` run of `ci.yml`. - Measurements: 674 runs read with `gh api` (300 pull request, 74 merge queue, 300 push). - actionlint was not available locally; jactionlint runs on this pull request. GPUs tested: n/a AI-assisted: yes (Claude Opus 5.5; a separate read-only reviewer agent on Claude Opus 5.5 audited the diff and accepted it, and its one remark, the retry, is included). ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a) A `.github/` change: a second maintainer has to agree. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fiestorra commented 2026-12-02 23:04:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T23:04:24Z.


VERIFY-3098 — Windows nativo: red then green, y el control hubo que hacerlo con el fichero del padre

Own commit 0f63052bd — tests/test_ci_main_signal.py (+17/−1)
Merge base recent

Ran

python -I tests/test_ci_main_signal.py      Ran 8 tests in 0.03s — OK

Negative control: git apply -R of the commit did not apply (the branch has later commits on the same file), so I used the file from the commit's parent (git show 0f63052bd^:tests/test_ci_main_signal.py):

FAIL: test_jobs_are_not_restricted_to_push_events
Ran 7 tests — FAILED (failures=1)

The modified test bites.

What the change is: the "no job is restricted to push events" check now skips change-scope, which is the one job that legitimately runs on both pull requests and pushes and only decides what the others skip — a check that flags the exception as if it were the bug. And a new test pins the other side of it: change-scope may skip a push the merge queue already passed, but only a push — the daily scheduled run and a manual dispatch still run every job on main. The test parses the workflow YAML rather than trusting a comment.

Why this matters here, of all repositories: a job silently skipped on the nightly snapshot is how main ends up red without anyone seeing it — which is exactly the state main is in tonight (see #2570: leonida-lua's tests have not compiled since 057cc94d8, and two merges landed on it anyway).

What I could not test

  • The workflow on GitHub: the test reads the YAML; whether Actions honours it is a run, and the incident in this repository's CI earlier today is not something I can reproduce locally.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361528489 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3098#issuecomment-7361528489). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T23:04:24Z. --- ## VERIFY-3098 — Windows nativo: `red then green`, y el control hubo que hacerlo con el fichero del padre | | | |---|---| | Own commit | `0f63052bd` — `tests/test_ci_main_signal.py` (+17/−1) | | Merge base | recent | **Ran** ``` python -I tests/test_ci_main_signal.py Ran 8 tests in 0.03s — OK ``` **Negative control**: `git apply -R` of the commit **did not apply** (the branch has later commits on the same file), so I used the file from the commit's parent (`git show 0f63052bd^:tests/test_ci_main_signal.py`): ``` FAIL: test_jobs_are_not_restricted_to_push_events Ran 7 tests — FAILED (failures=1) ``` **The modified test bites.** **What the change is**: the "no job is restricted to `push` events" check now **skips `change-scope`**, which is the one job that legitimately runs on both pull requests and pushes and only decides what the others skip — **a check that flags the exception as if it were the bug**. And a new test pins the other side of it: **`change-scope` may skip a push the merge queue already passed, but only a push** — the daily scheduled run and a manual dispatch still run every job on `main`. The test parses the workflow YAML rather than trusting a comment. **Why this matters here, of all repositories**: **a job silently skipped on the nightly snapshot is how `main` ends up red without anyone seeing it** — which is exactly the state `main` is in tonight (see #2570: `leonida-lua`'s tests have not compiled since 057cc94d8, and **two merges landed on it anyway**). ## What I could not test - **The workflow on GitHub**: the test reads the YAML; whether Actions honours it is a run, and the incident in this repository's CI earlier today is not something I can reproduce locally. Written with an AI assistant.
merzleckeier commented 2026-12-02 23:28:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T23:28:15Z.

Review: COMMENTED


Workflow identity in the push shortcut is a prefix match. I ran the exact Bash step from 0f63052b on 81efe4566 with canned Actions API responses and jq. When the only successful run was from a different workflow whose filename began with ci.yml, the step emitted queue-tested=true. That would skip all three push jobs even though ci.yml itself had no successful run for that SHA. The real ci.yml@main, an unrelated workflow, an empty result, and an API error all behaved as intended.

Could the request use the workflow-scoped actions/workflows/ci.yml/runs endpoint, or compare the complete .path before the optional @ suffix? I tried the exact comparison in the scratch harness and all five cases passed. The five existing CI test files also passed, 53 tests total. GitHub’s workflow-runs API

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6160911962 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3098#pullrequestreview-6160911962). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T23:28:15Z. **Review:** COMMENTED --- Workflow identity in the push shortcut is a prefix match. I ran the exact Bash step from `0f63052b` on `81efe4566` with canned Actions API responses and `jq`. When the only successful run was from a different workflow whose filename began with `ci.yml`, the step emitted `queue-tested=true`. That would skip all three push jobs even though `ci.yml` itself had no successful run for that SHA. The real `ci.yml@main`, an unrelated workflow, an empty result, and an API error all behaved as intended. Could the request use the workflow-scoped `actions/workflows/ci.yml/runs` endpoint, or compare the complete `.path` before the optional `@` suffix? I tried the exact comparison in the scratch harness and all five cases passed. The five existing CI test files also passed, 53 tests total. [GitHub’s workflow-runs API](https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3098:upstream-pr/3098'
git switch 'upstream-pr/3098'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3098'
git switch 'upstream-pr/3098'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3098'
git switch 'upstream-pr/3098'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3098'
git switch 'main'
git merge --squash 'upstream-pr/3098'
git switch 'main'
git merge --ff-only 'upstream-pr/3098'
git switch 'main'
git merge 'upstream-pr/3098'
git push origin 'main'
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
ProjectLeonida/mandy!3098
No description provided.