Repository navigation
Queue pull request CI runs per author and workflow #1426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
cf76307
68e005b
3d448f9
a752e1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,16 @@ on: | |
| branches: [main] | ||
| pull_request: | ||
|
|
||
| # Each pull request author runs one PR at a time per workflow, so one person | ||
| # opening many PRs cannot fill the runner queue ahead of everyone else. Their | ||
| # other runs wait in order instead of being cancelled, and every job has a | ||
| # timeout so a hung run cannot hold that queue for hours. Bot-authored PRs and | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 thinking — Bot-authored PRs get a run-ID group, so a Dependabot batch runs fully in parallel. Dependabot opens PRs here in bursts (#1021 to #1024 within 30 seconds, and three ecosystems update weekly), and no one is waiting on those runs, so they are the cheapest ones to queue. Keying bots on their login like everyone else (one |
||
| # other events get their own group from the run ID and are never held back. | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot' && github.event.pull_request.user.login || github.run_id }} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔧 wrench — A per-author queue that never cancels superseded runs backs the required checks up for hours, and it can reach the 100-pending cap. I replayed the 391
The description says cancelling superseded runs needs a separate privileged workflow because a workflow has only one concurrency group. Jobs have their own Proposed shape (apply manually: it touches every job in the five workflows): # One run per PR: a newer push cancels the superseded run.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
test-rust:
# One test-rust job per author at a time; the rest wait in order.
concurrency:
group: ${{ github.workflow }}-test-rust-${{ github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot' && github.event.pull_request.user.login || github.run_id }}
queue: maxMatrix jobs ( |
||
| cancel-in-progress: false | ||
| queue: max | ||
|
|
||
| jobs: | ||
| test-rust: | ||
| name: cargo test | ||
|
|
@@ -68,6 +78,7 @@ jobs: | |
| test-axum: | ||
| name: cargo test (axum native) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 note — Heads-up for the module stack: ten of jwrosewell's PRs (#1347 to #1399, and #1423) get a new timeout-minutes: ${{ matrix.os == 'windows-latest' && 65 || 30 }}The windows cloudflare leg (max 10.0 min) fits in 15. |
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -116,6 +127,7 @@ jobs: | |
| test-cloudflare: | ||
| name: cargo check (cloudflare native + wasm32-unknown-unknown) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -137,6 +149,7 @@ jobs: | |
| test-spin: | ||
| name: cargo check/build/test (spin native + wasm32-wasip1) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -170,6 +183,7 @@ jobs: | |
| test-parity: | ||
| name: cargo test (cross-adapter parity) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -195,6 +209,7 @@ jobs: | |
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -259,6 +274,7 @@ jobs: | |
| test-typescript: | ||
| name: vitest | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| defaults: | ||
| run: | ||
| working-directory: crates/trusted-server-js/lib | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 wrench — Nothing enforces the shared concurrency block or the job timeouts, and open PRs already break both.
Trial merges of the open workflow-touching PRs with this head:
lint-domainsand Set up pinned Node in Rust CI jobs and drop unused tsjs deps #1257 addscheck-ci-node-pin, both with notimeout-minutes. Gate PRs on non-allowlisted URL hosts in changed lines #1254 merges cleanly.worker-auction-deadlines.yml, Adapt Trusted Server to the EdgeZero AWS demo RC #1424 addsnative-container.yml, and the Add the permission model with the Privacy Taxonomy vocabulary #1345 to Move module browser scripts and Tinybird into their crates #1423 stack addsinspector.yml. All are PR-triggered with no per-author group, and the stack'sbuild-inspector-wasmandcheck-core-platform-namesjobs have no timeout either.Following #1259's precedent of a guard step in the required
cargo fmtjob, this step fails when any PR-triggered workflow'sconcurrencydiffers from test.yml's, or when a job lackstimeout-minutes. Jobs that call a reusable workflow are skipped, since they can't set it. It uses the runner image'syq(4.54.1 on ubuntu-latest), so it needs no setup.Verified on 15 fixtures, locally and under bash 5.2.15 with yq 4.54.1 in Docker. It passes on this head. It fails on trial merges with #1254, #1257, #1433, #1424 and #1345, on main, on one edited group, on every group removed, on a dropped
queue, onon: pull_requestandon: [push, pull_request]without the block, and on a matrix job missing its timeout. It passes for push-only workflows and for reusable-workflow callers. actionlint and shellcheck report nothing new. If you adopt the job-level design from the other comment, the check moves to the workflow block plus each job'squeue.