fix(pick-runner): stop blaming the fleet when the fleet could not be read - #5
Merged
Merged
Conversation
…read
On a repo without GH_APP_CLIENT_ID the validator reported:
'self-hosted,Linux,X64' asks for label(s): self-hosted Linux X64, which no
runner carries.
Three runners carry exactly those labels. The list simply could not be read —
GITHUB_TOKEN gets 403 on /orgs/{org}/actions/runners.
runners=$(gh api ... | jq -s '.' || echo '[]')
A pipeline's exit status is the LAST command's, so jq succeeding masked gh
failing and the || fallback never fired. gh also prints the error body on
failure, which jq -s slurped into a ONE-element array — so the "is it empty"
guard passed and the step went on to check labels against a fleet of one error
object, and blamed the real one.
gh's exit status is now captured separately, and the step refuses to say anything
about labels unless the fleet was actually read. The two causes are reported
distinctly: "could not read the list" versus "the org reports no runners".
This matters more than a wording nit. The whole purpose of this step is to stop a
silent hosted fallback from looking like a busy fleet, and it was doing the
inverse — sending a reader to hunt a labelling problem that does not exist.
Verified against all three paths with a stubbed gh.
Why: a diagnostic that names the wrong cause costs more than no diagnostic.
Refs: DODI-00012
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
azlekov
force-pushed
the
fix/pick-runner-false-fleet-warning
branch
from
August 18, 2026 20:30
b0648c4 to
7e92554
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Caught on
dev-standardsright after it went private, sopick-runnerbegan resolving real self-hosted selectors for the first time.It reported:
Three runners carry exactly those labels. The list could not be read —
GITHUB_TOKENgets 403 on/orgs/{org}/actions/runners, and that repo has noGH_APP_CLIENT_ID.Cause
runners=$(gh api ... | jq -s '.' || echo '[]')A pipeline's exit status is the last command's, so
jqsucceeding maskedghfailing and the||fallback never fired.ghalso prints the error body on failure, whichjq -sslurped into a one-element array — so the emptiness guard passed, and the step checked labels against a fleet consisting of one error object, then blamed the real fleet.Fix
gh's exit status is captured separately, and the step will not say anything about labels unless the fleet was actually read. The two causes now report distinctly.Verified with a stubbed
gh:Why it matters
This step exists so a silent hosted fallback cannot masquerade as a busy fleet. It was doing the inverse — sending a reader to hunt a labelling problem that does not exist.
🤖 Generated with Claude Code