[PR #3651] [MERGED] run-parity: a push cancels the old head's run, other labels cancel nothing; cancel-on-close takes every head #5123

Closed
opened 2026-11-03 05:10:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3651
Author: @ludovic111
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: ci/run-parity-stale-runs


📝 Commits (1)

  • 815982c run-parity: a push cancels the old head's run, other labels cancel nothing; cancel-on-close takes every head

📊 Changes

2 files changed (+12 additions, -6 deletions)

View changed files

📝 .github/workflows/cancel-on-close.yml (+6 -4)
📝 .github/workflows/run-parity.yml (+6 -2)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Pull requests' parity queue held 117 runs on 2026-10-29 at 11:20Z (~26 h of work for the two runners). Most are legitimate, one per fork PR at its head, but run-parity's flow wastes some runs and kills others. Three changes, each to .github/ (so: what each does and why).

1. run-parity.yml also starts on synchronize, only to cancel the old head's run.
Before, a push left the old head's labelled run queued, and a runner later tested a head the merge would no longer land (#2924: its run at c48c2f216 was still queued after the head moved to e932a2da6; cancelled by hand). Now the push's run joins the PR's concurrency group, which cancels the old head's queued or running run. Its own job is skipped (if: github.event.label.name == 'run-parity' is unchanged), so a push still starts no harness: parity runs after a maintainer adds the label, as before.

2. Labels other than run-parity get a concurrency group of their own.
The group was run-parity-<PR> for every labeled event. With cancel-in-progress, adding any other label (needs-proof, bug...) cancelled the PR's parity run, queued or running: run 40766180150 was cancelled 9 s after it was queued by a skipped run of the same PR. Those events now get run-parity-<PR>-<run id>.

3. cancel-on-close cancels the closed PR's runs on every head, not only the last.
It matched runs by branch name and the final head SHA, so a run labelled on an older head survived the merge (#3104's run at 5c0f6aa56 was still queued after #3104 merged at 70b51333d; cancelled by hand). It now lists the runs of the PR's branch in the PR's own repository (head_repository.full_name; another fork can have a branch of the same name), with the same statuses as before.

Security. Unchanged: run-parity's job still runs only on the run-parity label a maintainer adds after reading the change; the synchronize run executes no step. cancel-on-close stays pull_request_target with actions: write only, checks out nothing, and gets the fork's branch and repository names through env, never interpolated into the script.

Checked. actionlint clean on both files. The new runs query, run against #3104's branch, lists the stale run 40836001431 (run-parity, Expected333/horizon, 5c0f6aa56). No test covers these two workflows (grep run-parity\|cancel-on-close tests/).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 4a9501d2d, 1 min 31 s)

Check Result
Scope ✅ 2 files, +12 −6
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 408 passed (1 min 29 s)
rustfmt / clippy / tests ➖ no Rust change
Parity ➖ 1 affected, to run in CI (--quick): lan_integration
Label skip-release

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3651 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `ci/run-parity-stale-runs` --- ### 📝 Commits (1) - [`815982c`](https://github.com/horizon-rust/horizon/commit/815982c0b62fc06822a97d90bf736b86bb96176d) run-parity: a push cancels the old head's run, other labels cancel nothing; cancel-on-close takes every head ### 📊 Changes **2 files changed** (+12 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/cancel-on-close.yml` (+6 -4) 📝 `.github/workflows/run-parity.yml` (+6 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Pull requests' parity queue held 117 runs on 2026-10-29 at 11:20Z (~26 h of work for the two runners). Most are legitimate, one per fork PR at its head, but run-parity's flow wastes some runs and kills others. Three changes, each to `.github/` (so: what each does and why). **1. `run-parity.yml` also starts on `synchronize`, only to cancel the old head's run.** Before, a push left the old head's labelled run queued, and a runner later tested a head the merge would no longer land (#2924: its run at `c48c2f216` was still queued after the head moved to `e932a2da6`; cancelled by hand). Now the push's run joins the PR's concurrency group, which cancels the old head's queued or running run. Its own job is skipped (`if: github.event.label.name == 'run-parity'` is unchanged), so a push still starts no harness: `parity` runs after a maintainer adds the label, as before. **2. Labels other than `run-parity` get a concurrency group of their own.** The group was `run-parity-<PR>` for every `labeled` event. With `cancel-in-progress`, adding any other label (needs-proof, bug...) cancelled the PR's parity run, queued or running: run 40766180150 was cancelled 9 s after it was queued by a skipped run of the same PR. Those events now get `run-parity-<PR>-<run id>`. **3. `cancel-on-close` cancels the closed PR's runs on every head, not only the last.** It matched runs by branch name and the final head SHA, so a run labelled on an older head survived the merge (#3104's run at `5c0f6aa56` was still queued after #3104 merged at `70b51333d`; cancelled by hand). It now lists the runs of the PR's branch in the PR's own repository (`head_repository.full_name`; another fork can have a branch of the same name), with the same statuses as before. **Security.** Unchanged: run-parity's job still runs only on the `run-parity` label a maintainer adds after reading the change; the synchronize run executes no step. `cancel-on-close` stays `pull_request_target` with `actions: write` only, checks out nothing, and gets the fork's branch and repository names through `env`, never interpolated into the script. **Checked.** `actionlint` clean on both files. The new runs query, run against #3104's branch, lists the stale run 40836001431 (`run-parity`, `Expected333/horizon`, `5c0f6aa56`). No test covers these two workflows (`grep run-parity\|cancel-on-close tests/`). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 4a9501d2d, 1 min 31 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +12 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 408 passed (1 min 29 s) | | rustfmt / clippy / tests | ➖ no Rust change | | Parity | ➖ 1 affected, to run in CI (--quick): lan_integration | | Label | `skip-release` | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:23 +07:00
Sign in to join this conversation.
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5123
No description provided.