Skip to content

fix(pick-runner): stop blaming the fleet when the fleet could not be read - #5

Merged
azlekov merged 1 commit into
mainfrom
fix/pick-runner-false-fleet-warning
Aug 18, 2026
Merged

fix(pick-runner): stop blaming the fleet when the fleet could not be read#5
azlekov merged 1 commit into
mainfrom
fix/pick-runner-false-fleet-warning

Conversation

@azlekov

@azlekov azlekov commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Caught on dev-standards right after it went private, so pick-runner began resolving real self-hosted selectors for the first time.

It 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 could not be read — GITHUB_TOKEN gets 403 on /orgs/{org}/actions/runners, and that repo has no GH_APP_CLIENT_ID.

Cause

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 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:

Case Before After
403 "which no runner carries" — false "NOT validated … says nothing about whether the labels exist"
label genuinely absent correct correct, unchanged
selector matches correct correct, unchanged

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

…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
azlekov force-pushed the fix/pick-runner-false-fleet-warning branch from b0648c4 to 7e92554 Compare August 18, 2026 20:30
@azlekov
azlekov merged commit 80d55aa into main Aug 18, 2026
1 check passed
@azlekov
azlekov deleted the fix/pick-runner-false-fleet-warning branch August 18, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant