Skip to content

ci: purge the agent-device apple-runner artifact before iOS retry attempts - #96

Merged
thiagobrez merged 4 commits into
mainfrom
ci/issue-76-purge-apple-runner-before-retry
Sep 6, 2026
Merged

thiagobrez merged 4 commits into
mainfrom
ci/issue-76-purge-apple-runner-before-retry

Conversation

@thiagobrez

Copy link
Copy Markdown
Owner

Closes #76 (CI overhaul 9/9, plan #59, map #53).

What

In scripts/run-device-contract-job.mjs, iOS device-contract jobs now delete ~/.agent-device/apple-runner (with a log line) at the top of the retry iteration — which is only reachable after an exit-75/signal infrastructure failure — so attempt 2 rebuilds the runner from scratch instead of restoring the same broken artifact.

Per #56 research (flake 3), the restored runner artifact can fail with dyld: Library not loaded: libcurl.4.dylib because the cache key omits the macOS host build, and the rebuild fallback only fires on retriable health failures — so the dyld failure is a hard error today. The upstream cache-key report is filed separately.

Acceptance criteria

  • Attempt 2 of an iOS device-contract job starts with no ~/.agent-device/apple-runner directory, visible in the attempt log via the Purging … line.
  • First attempts still restore/reuse the cached runner artifact (the purge only runs when index > 1).
  • Exit protocol unchanged: contract failures still never retry (and therefore never purge).

Tests

New script-execution test in src/__tests__/issue39-device-contract.test.ts runs the real job script against stub child scripts in a temp workspace with an overridden HOME, asserting: iOS retry purges and logs; first attempt keeps the cache; contract failure (exit 1) never retries or purges; Android retries leave the artifact untouched. Full suite, typecheck and lint pass.

🤖 Generated with Claude Code

thiagobrez and others added 2 commits September 5, 2026 22:09
…empts (#76)

The restored runner artifact can fail hard (dyld: libcurl.4.dylib) because
the cache key omits the macOS host build. Remove ~/.agent-device/apple-runner
before attempt 2 of iOS device-contract jobs so retries rebuild the runner
from scratch; first attempts keep the cached fast path and contract failures
still never retry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@thiagobrez

Copy link
Copy Markdown
Owner Author

No changeset needed

1 similar comment
@thiagobrez

Copy link
Copy Markdown
Owner Author

No changeset needed

@thiagobrez

Copy link
Copy Markdown
Owner Author

No changeset needed

Skipping the install step on a Pods cache hit let the React Native CLI
reinstall pods mid-build with the runner image's unpinned system
CocoaPods, which fails when that executable is older than the one that
generated Podfile.lock. The pinned install is nearly a no-op on a warm
cache and reconciles a stale cached Pods directory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@thiagobrez

Copy link
Copy Markdown
Owner Author

No changeset needed

@thiagobrez
thiagobrez merged commit f3b11c7 into main Sep 6, 2026
8 of 9 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.

CI overhaul (9/9): purge the agent-device runner-artifact cache before retry attempts

1 participant