Skip to content

screencapture grant: bash on ad-hoc roles + retry transient skips (RELOPS-2454) - #78

Merged
rcurranmoz merged 2 commits into
mainfrom
relops-2454-grant-unsigned-retry
Sep 24, 2026
Merged

rcurranmoz merged 2 commits into
mainfrom
relops-2454-grant-unsigned-retry

Conversation

@rcurranmoz

Copy link
Copy Markdown
Collaborator

Two fixes so the Screen Recording grant step works for provision and reprovision on every m4 role.

1. Ad-hoc worker binaries no longer hard-fail the step

Roles without taskcluster_signed_binaries run ad-hoc worker builds. That covers everything except gecko_t_osx_1500_m4 and gecko_t_osx_2600_m4, and includes gecko_t_osx_1500_m4_staging. The payload treated ad-hoc binaries as fail, so every staging reprovision ended in ReprovisionError at the last step, before /bin/bash (added in #77) was granted.

A grant for an ad-hoc worker binary is useless, since Identifier=a.out never satisfies a code requirement. So the payload now skips only the worker binaries and still adds and verifies /bin/bash, which the failure-screenshot LaunchAgent needs whatever the worker's signing.

2. Transient skips are retried before the host is handed back

The step runs right after the bootstrap sentinel, when cltbld's autologin session may not own the console yet. Before, that exit-3 skip was accepted on the first attempt, so the host went back to service with no grant and nothing retried it.

  • "no console session" and "running a task" are now retried up to 10 × 30s.
  • SIP off is permanent, so it still returns immediately.

Tests

  • 4 new tests: transient skip retried until granted, permanent skip not retried, retry budget exhausted, and the unsigned path in the payload.
  • 282 pass with op stripped from PATH, matching CI; ruff is clean.
  • Checked by hand: the ${arr[@]+...} empty-array guard on the macOS /bin/bash 3.2.57 under set -u, and the AppleScript argv switch (0 → no worker checkboxes, 1 → both).

Validation plan

Reprovision one staging host (m4-112/113) after merge. Expected: the step logs "granting /bin/bash only" and ends with /bin/bash 2/…/0, the first run of #77's "+" flow inside a real reprovision. Companion detector change: ronin_puppet#1426.

🤖 Generated with Claude Code

rcurranmoz and others added 2 commits September 24, 2026 08:06
… back

The step runs right after the bootstrap sentinel, when cltbld's autologin
session may not own the console yet. That exit-3 skip used to be accepted on
the first try, returning the host to service with no Screen Recording grant
and nothing retrying it. Retry "no console session" and "running a task" for
up to 10 x 30s first; permanent skips (SIP off) still return immediately.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-hoc

Roles without taskcluster_signed_binaries -- gecko_t_osx_1500_m4_staging among
them -- run ad-hoc worker builds, and the payload treated that as a hard fail.
Every staging reprovision therefore ended in ReprovisionError at the last step,
before /bin/bash (the failure-screenshot LaunchAgent) was granted.

Ad-hoc worker grants really are useless (Identifier=a.out never satisfies a code
requirement), so skip only the worker binaries: empty CLIENTS, tell the
AppleScript not to tick them, and still add + verify /bin/bash. The
empty-array loops use ${arr[@]+...} so they stay legal under bash 3.2 set -u.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rcurranmoz
rcurranmoz requested a review from a team as a code owner September 24, 2026 12:13
@rcurranmoz
rcurranmoz merged commit 5961098 into main Sep 24, 2026
3 checks passed
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