Skip to content

ci: fall back to hosted runners when queue host is offline - #4751

Merged
zackees merged 2 commits into
masterfrom
ci/mq-runner-dynamic-fallback
Nov 12, 2026
Merged

zackees merged 2 commits into
masterfrom
ci/mq-runner-dynamic-fallback

Conversation

@zackees

@zackees zackees commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

When MQ_RUNNER_LABELS is configured but the self-hosted queue machine is offline, the static runs-on expressions leave merge-queue jobs waiting indefinitely. A short hosted select-mq-runner job now queries the repository runners API and selects those labels only when an online runner carries every label. Missing MQ_RUNNER_STATUS_TOKEN, malformed configuration, API errors, and no matching online runner produce a warning and preserve each job’s existing hosted fallback. Busy online runners remain eligible.

The selected JSON is shared with the existing Build and Format reusable workflows through optional string inputs; their other callers default to an empty selection. All existing MQ runner expressions, including the Linux matrix expression, consume this result. Required job names, lane selection, native coverage, and PR/push/schedule/release hosted labels are unchanged. Probe setup failures are tolerated at step level and warn without changing CI Gate’s failure policy.

The documentation describes the fine-grained status PAT with repository Administration: read permission and the intended NixOS netbooted Dell PowerEdge running jobs in its Ubuntu container image / FHS environment. Selection is an availability snapshot, so a host disappearing after the probe can still delay jobs. No runner registration, variables, or secrets are changed by this PR. CI changes are exempt from the features ledger under coordination.md.

RED commit 4a264aa records the failing tests: uv run --no-project -m unittest discover -s ci -p test_select_mq_runner.py exited 1 because the selector did not exist; the corresponding test_ci_scope.py command exited 1 with five failures and one error for the static expressions/missing selector job. The separate GREEN implementation makes all 16 selector tests and all 59 CI scope tests pass. The lane-proof and Tier 2 fanout regression suites also pass. The new selector test is wired into ./lint by its existing discovery of every ci/test_*.py. All HTTP behavior in these tests uses a fake HTTP layer, with no credentials or runner needed. Rust/C differential and protocol tiers do not apply to this CI-only change.

A local pre-push review found the initial job-level error handling could still fail the gate; the final implementation uses guarded steps with continue-on-error and has regression assertions for that correction. The single required SOLDR_PORCELAIN=0 ./lint run used a 1,200-second deadline and exited 1 on two workflow-policy assertions: ci-pre must remain the first job and setup-uv must declare the master-only save-cache guard. Both were corrected in ci.yml. The affected suites then passed (11 test_ci_pre tests, 47 test_ci_toml tests), and all 59 CI scope tests passed again. Every other self-test reported passing in that full run. Full lint was not repeated, per the maintainer’s one-run constraint; it stopped before its later Rust formatting/clippy checks. ./push subsequently succeeded with prooft attestations for Rust formatting, host clippy, and Dylint. Hosted PR CI remains the merge gate.

Refs #4005.

The push helper opened this PR as a draft because repository backpressure was closed: it reported the oldest queued run waiting 1,535 minutes for a runner. The worker has not overridden that admission guard.

The requested gh pr merge 4751 --auto --match-head-commit d68867c4529d92ff1a7b6d3c51a96f110b1b6460 exited 1: GitHub refused auto-merge because the PR is a draft. Admission remains blocked; the manager can decide when to mark it ready and arm auto-merge.

Probe matching online repository runners with an optional status token, then share the selection with Build and Format. Keep hosted runner labels and required check names unchanged. Refs #4005.

Ci-Attestation: {"at":1794521677,"gate":"rust/all/fmt","host":"linux-x86_64","key":"","lane":"lint","parents":["4a264aa4cd203372c83b30a5a010fef2e368654c"],"secs":288,"stamp":"2c5844cbff0548cc216f7f6ab50c5967","tree":"6a7a692c954b4679a571042fe53cfdac06a48dda","v":1,"via":"run"}
Ci-Attestation: {"at":1794521677,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"","lane":"lint","parents":["4a264aa4cd203372c83b30a5a010fef2e368654c"],"secs":288,"stamp":"60ef7f8475a792103973750570284554","tree":"6a7a692c954b4679a571042fe53cfdac06a48dda","v":1,"via":"run"}
Ci-Attestation: {"at":1794521677,"gate":"rust/x86_64-unknown-linux-gnu/dylint","host":"linux-x86_64","key":"","lane":"dylint","parents":["4a264aa4cd203372c83b30a5a010fef2e368654c"],"secs":288,"stamp":"e9c24f965a9de0f8fd0b5d59a051792b","tree":"6a7a692c954b4679a571042fe53cfdac06a48dda","v":1,"via":"run"}
@zackees
zackees marked this pull request as ready for review November 12, 2026 22:24
@zackees
zackees enabled auto-merge November 12, 2026 22:24
@zackees
zackees added this pull request to the merge queue Nov 12, 2026
Merged via the queue into master with commit 5f8235d Nov 12, 2026
43 checks passed
@zackees
zackees deleted the ci/mq-runner-dynamic-fallback branch November 12, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant