Skip to content

fix(ci): recover Watch runtime deletion before screenshots - #179146

Closed
steipete wants to merge 2 commits into
mainfrom
ci/watch-runtime-repair-reclaim
Closed

steipete wants to merge 2 commits into
mainfrom
ci/watch-runtime-repair-reclaim

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes iOS screenshot CI stopping after the phone and tablet captures when Watch runtime deletion exits 30 because its MobileAsset was not reclaimed. Failing job and diagnostic.

User Impact

CI can finish repairing the unavailable Watch runtime before capture. There is no app behavior change, migration, or configuration change; failed boots and captures still stop the lane.

Why This Change Was Made

The repair path from #178818 aborted before downloading a replacement. On a failed delete, it now follows Apple's diagnostic once: scan-and-mount, re-list images for the same runtime identifier, and delete the re-registered images. A second deletion failure remains fatal with a clear error. Existing image diagnostics and mounted-runtime verification remain intact.

Fastlane's sh(..., error_callback:) handles only command failure, without a broad exception rescue. Its semantics were verified against the pinned Fastlane 2.241.0 implementation.

CC @joshavant, author of the unavailable-runtime repair in #178818.

Evidence

  • Regression coverage extends owns one simulator at a time and cleans up failed captures while reusing the screenshot build with unavailable-delete-recovered and unavailable-delete-failure. It checks new image IDs, multiple matching images, exclusion of unrelated runtime images, successful capture, and fatal failure after one recovery attempt.
  • PR CI is the test gate and covers the Fastlane regression suite and applicable native iOS checks. Local tests, typechecks, and live simulator proof were intentionally skipped per maintainer policy; an iOS screenshot job skipped by CI scope is acceptable.
  • Local lint passed: ruby -c apps/ios/fastlane/Fastfile, changed-file oxlint using the core config, oxfmt, and git diff --check. The repository has no RuboCop configuration.
  • Independent Codex P2 autoreview: scoped-clean, no accepted/actionable findings; no tests or project code executed by review.
  • Simplification kept the repair in its existing owner. Exact numstat: production +13/-1 (net +12), tests +41/-5 (net +36), docs +0/-0. The small production increase implements the bounded recovery; no unrelated deletion was added to meet a line quota.
  • Exact-head CI passed on 249a0bf01f281b0d495618145309dfc510b726a4, including changed-node tests, native iOS screenshot capture, screenshot-evidence validation, and the final CI gate. All 44 non-skipped checks passed; no retries were needed.
  • The hosted capture encountered an unavailable Watch runtime and successfully repaired it, but its initial delete succeeded. The two deterministic regression cases cover the exit-30 recovery and fatal second-delete branch.

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 21, 2026 06:30
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-21T06:30:49.431607Z 249a0bf Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR retries Watch runtime deletion once after scanning and re-registering matching runtime images.

Example: watchOS 27.0 deletion exits 30 because its MobileAsset was not reclaimed after eight phone and tablet screenshots.

  • Before: Runtime repair stops before downloading a replacement or capturing the Watch screenshot.
  • After: CI scans and mounts runtimes, deletes the newly registered matching images, downloads the replacement, and continues if verification succeeds.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused maintainer-owned repair with distinct regression scenarios, successful exact-head native CI, and no actionable finding.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; exact-head native screenshot capture and evidence validation passed, while the new recovery branch has deterministic fixture coverage and raw-log inspection was blocked by the review environment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Screenshot CI can finish phone and tablet capture, then stop while repairing the Watch runtime.
Reason: The maintainer-authored direction addresses an observed automation failure without app behavior, configuration, or public API changes.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this maintainer-authored PR repairs a current screenshot automation failure, with no actionable correctness or security finding and green exact-head CI; another open PR addresses the same failure.

Priority: P2
Reviewed head: 249a0bf01f281b0d495618145309dfc510b726a4
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Which overlapping Watch runtime deletion repair should land?
  • Recommendation: Retain this PR: Use the small Fastlane callback repair with green exact-head native CI and reconcile the overlapping submission.
  • Why: This PR and fix(ios): recover partial Watch runtime deletion during screenshots #179148 change the same failure boundary, and neither discussion records a choice between them.

Before merge

  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Tests

  • Missing end-to-end proof: Native screenshot CI passed, but the new partial-deletion branch is fixture-covered rather than established by an inspected native recovery trace; a base-red/head-green execution was not supplied for this PR.
Agent review details

How this fits together

The iOS Fastlane screenshot lanes consume Xcode simulator inventory and built apps, repair unavailable Watch runtimes in CI, and emit screenshots and capture diagnostics.

flowchart TD
  A[Screenshot lane] --> B[Watch runtime admission]
  B --> C[Existing runtime repair]
  C --> D[Delete registered image]
  D --> E[Scan and retry after failure]
  E --> F[Download and verify runtime]
  F --> G[Create simulator and capture Watch]
Loading

Technical review

Best possible solution:

Land one bounded recovery implementation in the existing Fastlane owner while preserving targeted deletion, runtime verification, and terminal capture failures.

Do we have a high-confidence way to reproduce the issue?

Current-main source and the pinned Fastlane contract establish that a nonzero runtime deletion aborts before replacement download; the reported failing native job is confirmed, but its raw diagnostic was unavailable and no target code was executed.

Is this the best way to solve the issue?

The patch is a small complete repair using the existing owner, with refreshed identifiers and a bounded retry rather than a parallel provisioning path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 97a111c6da0a.

Provenance checked

  • Watch runtime deletion and replacement keeps the original intent (07563dc: Provision Watch simulators and replace stale runtime images before screenshot capture.)
  • Shared runtime admission and screenshot lifecycle fixture keeps the original intent (598e945: Consolidate missing-runtime and creation-time recovery under one CI-only repair while preserving terminal boot and capture failures.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 07563dc adds apps/ios/fastlane/Fastfile:266 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 07563dc3b761; files: apps/ios/fastlane/Fastfile)
  • Josh Avant: Raw commit 598e945 adds apps/ios/fastlane/Fastfile:317 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 598e945b9ff5; files: apps/ios/fastlane/Fastfile)

PR surface

Source +12, Tests +36. Total +48 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 13 1 +12
Tests 1 41 5 +36
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 54 6 +48

Review metrics

Metric Value Why it matters
Production versus test changes Production +13/-1; tests +41/-5 The small production increase implements one bounded recovery in the existing owner; test growth covers successful recovery and terminal retry failure.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The failure interrupts native screenshot automation, with limited impact outside CI and release tooling.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 21, 2026, 2:52 AM ET / 06:52 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Closing in favor of #179148 from @joshavant, which fixes the same Watch runtime partial-deletion failure (exit 30 from simctl runtime delete) in the repair path they own. It is also narrower, since it only matches that specific error.

@steipete steipete closed this Oct 21, 2026
@steipete
steipete deleted the ci/watch-runtime-repair-reclaim branch October 21, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant