From 3e6d851ca64d49e94d1a6621db6b5e31d8ae550e Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 12 Nov 2026 02:28:57 -0800 Subject: [PATCH 1/2] chore(quest): claim quest/m0/queue-context.md Quest-Claim: a6d8b893840d4c1d From 801ce698c6733f300fd4317eaf606636871b100d Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 12 Nov 2026 02:29:54 -0800 Subject: [PATCH 2/2] ci(queue): require the self-hosted build's own context The required Queue job ran on ubuntu-latest after the build, so a group with a passed build waited on org-wide hosted capacity. Call the build on pull requests too, where its job skips as Queue build / Build, and drop the hosted job; the ruleset then requires the build's context. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/queue.yml | 55 +++++++++++++++---------------------- quest/m0/queue-context.md | 27 ------------------ 2 files changed, 22 insertions(+), 60 deletions(-) delete mode 100644 quest/m0/queue-context.md diff --git a/.github/workflows/queue.yml b/.github/workflows/queue.yml index 1c1ffb73a..bf03d85e7 100644 --- a/.github/workflows/queue.yml +++ b/.github/workflows/queue.yml @@ -5,11 +5,13 @@ name: Queue # queue drops a PR, moq-dev/quest's queue watcher on the host runs the land # fixer and re-enqueues it at the back of the queue. # -# `main`'s ruleset requires this job's `Queue` context. GitHub admits a PR to -# the queue only once its required checks pass on the PR itself, so the job -# also runs, as skipped, on main pull requests; a skipped job satisfies the -# requirement. Only the merge group build runs code, and only a maintainer's -# pick enters the queue. +# `main`'s ruleset requires the build's own `Queue build / Build` context, so +# a group's check reports from the self-hosted runner and waits on no +# GitHub-hosted one. GitHub admits a PR to the queue only once its required +# checks pass on the PR itself, so the build is also called on main pull +# requests, where its job skips under the same name; a skipped job satisfies +# the requirement. Only the merge group build runs code, and only a +# maintainer's pick enters the queue. on: pull_request: branches: [main] @@ -25,46 +27,33 @@ on: workflow_dispatch: inputs: sha: - description: The PR head commit to report the skipped Queue context on. + description: The PR head commit to report the skipped Queue build / Build context on. required: true permissions: contents: read -# No concurrency group. A pull request's `Queue` job waits on `build` before it -# skips, so cancelling the run then, as a second event for the PR would, -# reports `Queue` cancelled and fails the requirement; even a group without -# cancel-in-progress cancels a pending run. Each merge group has its own ref, so -# its run never had another to replace, and a repeated dispatch only reports the -# same skipped context twice. +# No concurrency group. Cancelling a pull request's run, as a second event for +# the PR would, can report the build cancelled and fail the requirement; even a +# group without cancel-in-progress cancels a pending run. Each merge group has +# its own ref, so its run never had another to replace, and a repeated dispatch +# only reports the same skipped context twice. jobs: # The build runs in queue-build.yml so its runner group can admit that # workflow alone; see that file. It calls main's copy, not the merge group's, # since the group admits that workflow only at refs/heads/main: a PR's edit to # queue-build.yml runs only after it lands. + # + # The call has no `if`: a skipped call reports only `Queue build`, while a + # call whose job skips reports `Queue build / Build`, the context the + # ruleset requires. main's copy skips that job on every event but + # merge_group, so a pull request gets no runner. A failed or cancelled build + # reports its own context failed or cancelled, which fails the group. build: name: Queue build - if: github.event_name == 'merge_group' uses: moq-dev/rust2/.github/workflows/queue-build.yml@main - # The required context. A reusable workflow's jobs report as - # `Queue build / Build`, so this job reports the build's result under the - # name main's ruleset requires. It skips with the build on pull requests, and - # runs even when the build fails or is cancelled, since a skipped context - # would pass the group. - queue: - name: Queue - needs: build - if: always() && github.event_name == 'merge_group' - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - name: Require the build to pass - env: - RESULT: ${{ needs.build.result }} - run: '[[ "$RESULT" == success ]] || { echo "::error::the queue build ended $RESULT" >&2; exit 1; }' - # The merge queue still builds every group with the jobs above; this only # satisfies the PR-side requirement, as a pull_request run's skipped job does. report: @@ -75,12 +64,12 @@ jobs: permissions: checks: write steps: - - name: Report the skipped Queue context + - name: Report the skipped Queue build / Build context env: GH_TOKEN: ${{ github.token }} REPO: ${{ github.repository }} SHA: ${{ inputs.sha }} run: | [[ "$SHA" =~ ^[0-9a-f]{40}$ ]] || { echo "::error::sha must be a full commit SHA" >&2; exit 1; } - gh api "repos/$REPO/check-runs" -f name=Queue -f head_sha="$SHA" -f status=completed -f conclusion=skipped \ - -f 'output[title]=Queue' -f 'output[summary]=Skipped on the pull request; the merge queue builds the group.' --silent + gh api "repos/$REPO/check-runs" -f 'name=Queue build / Build' -f head_sha="$SHA" -f status=completed -f conclusion=skipped \ + -f 'output[title]=Queue build / Build' -f 'output[summary]=Skipped on the pull request; the merge queue builds the group.' --silent diff --git a/quest/m0/queue-context.md b/quest/m0/queue-context.md deleted file mode 100644 index e90ee96a1..000000000 --- a/quest/m0/queue-context.md +++ /dev/null @@ -1,27 +0,0 @@ -# [S] The merge queue's required check waits on no GitHub-hosted runner - -## Goal - -A merge group's required context reports as soon as its self-hosted build finishes, however -busy GitHub-hosted runners are across moq-dev. - -## Plan - -`main`'s ruleset requires `Queue`, which `.github/workflows/queue.yml` reports from a job on -`ubuntu-latest` after `queue-build.yml` builds the group on the `rust2-queue` runner. Hosted -capacity is shared by every moq-dev repository, so when moq's and rind's runs fill it, the -group sits with a passed build until the queue's response window drops it. On 2026-11-12, -[#709](https://github.com/moq-dev/rust2/pull/709)'s group (run 43171064245) built in 14 -minutes and then waited for that runner for over 1h45m, while moq-dev/rind had 78 runs and -moq-dev/moq 63 queued; run 43095195569 from 2026-11-11 was still queued too. - -Make the required context come from the self-hosted build or from nothing that queues on a -hosted runner, keeping what queue.yml's comments guard: only `queue-build.yml` at `main` -reaches the `rust2-queue` runner group, a pull request still satisfies the requirement -without building, and a failed or cancelled build fails the group. Recommendation: require -the build's own context (`Queue build / Build`) instead of `Queue`, if a pull request's -skipped run of it satisfies the ruleset as the skipped `Queue` job does; changing `main`'s -ruleset is a maintainer step, so the PR gives its exact change. Check moq's and rind's queues -for the same job and report them as follow-ups for their trees. - -Public API: none.