Skip to content

ci: self-heal resolve clears whole .ci-source-packages on incomplete artifacts - #6403

Merged
lawrencecchen merged 1 commit into
mainfrom
fix-resolve-selfheal
Jun 18, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
fix-resolve-selfheal

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes intermittent 'no XCFramework found (Sparkle/Sentry)' on main: incomplete restored Swift-package cache passed the old loose verify, and clearing only artifacts didn't re-materialize them. Now verifies the exact required frameworks and clears the whole .ci-source-packages on miss so the retry does a full clean resolve.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

Low Risk
Workflow-only change to cache validation and cleanup; no app, auth, or release logic touched.

Overview
Tightens the Swift package resolve self-heal step used after restoring .ci-source-packages in the macOS CI jobs (tests, tests-build-and-lag, ui-regressions).

After xcodebuild -resolvePackageDependencies, the post-resolve check now requires exact Sparkle and Sentry binary paths (Sparkle.xcframework and Sentry/Sentry.xcframework) instead of a loose glob for any Sentry xcframework under sentry-cocoa. That closes the gap where a partial or stale cache could still pass verification and later fail with missing XCFramework errors.

When verification fails, the retry path deletes the entire .ci-source-packages directory (not only artifacts/), so the next attempt does a full clean resolve instead of leaving a partial tree that Xcode would not fully repopulate.

Reviewed by Cursor Bugbot for commit 9cb3f84. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Prevents intermittent "no XCFramework found" CI failures by validating the exact Sparkle and Sentry artifacts and, if missing, clearing the entire .ci-source-packages to force a clean SwiftPM resolve.

  • Bug Fixes
    • Verify artifacts/sparkle/Sparkle/Sparkle.xcframework and artifacts/sentry-cocoa/Sentry/Sentry.xcframework instead of using a loose wildcard match.
    • On a miss, remove the whole .ci-source-packages directory (not just artifacts) so the retry re-materializes all required binaries.

Written for commit 9cb3f84. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Improved CI pipeline reliability by strengthening package dependency cache validation and recovery mechanisms. The build system now explicitly verifies that required dependencies are properly obtained and automatically detects and clears corrupted cache entries, retrying the resolution process. This prevents intermittent build failures and enhances overall development workflow stability and consistency.

…ust artifacts

The prior self-heal removed only .ci-source-packages/artifacts and retried
-resolvePackageDependencies, but resolve does NOT re-materialize artifacts into
a partially-populated tree (verified: rm artifacts + resolve leaves them
missing). And the verify matched any sentry-cocoa/*/*.xcframework, so an
incomplete cache (missing the specific sentry-cocoa/Sentry/Sentry.xcframework
the build links) passed spuriously and then failed the build.

Verify the exact required frameworks (sparkle/Sparkle + sentry-cocoa/Sentry);
on miss, clear the whole .ci-source-packages so the retry does a full clean
resolve, which reliably produces the complete artifact set.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 18, 2026 10:56pm
cmux-staging Building Building Preview, Comment Jun 18, 2026 10:56pm

@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Three CI job sections in .github/workflows/ci.yml update the Swift package resolution stale-cache guard to use explicit -d existence checks for both Sparkle.xcframework and Sentry.xcframework artifacts, and widen the cleanup target from the artifacts/ subdirectory to the entire .ci-source-packages directory before retrying.

Changes

CI Swift Package Cache Guard

Layer / File(s) Summary
Stale-cache guard: explicit artifact checks and wider cleanup
.github/workflows/ci.yml
All three job sections (tests, secondary job, UI regressions) replace glob-based Sentry artifact detection with explicit -d checks for artifacts/sparkle/Sparkle/Sparkle.xcframework and artifacts/sentry-cocoa/Sentry/Sentry.xcframework. On missing artifacts, rm -rf "$SOURCE_PACKAGES_DIR" now clears the entire cache directory instead of only artifacts/.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • manaflow-ai/cmux#6243: Previously introduced the same post-xcodebuild -resolvePackageDependencies cache-healing guard pattern for Sparkle and Sentry .xcframework artifacts that this PR now refines.

Poem

🐇 A cache gone stale is a terrible sight,
So I check for each framework with -d just right.
If Sparkle or Sentry have vanished away,
I'll wipe the whole folder without more delay.
Retry, rebuild — the packages gleam!
Clean caches forever, a rabbit's sweet dream. ✨


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux Swiftui State Layout ❌ Error PR introduces new ObservableObject with multiple @Published properties in ProjectPanel.swift for panel state management, violating the rule that new cmux-owned SwiftUI state should use @Observable... Replace ProjectPanel's ObservableObject/Published pattern with @Observable macro to align with modern SwiftUI state management patterns per swiftui-state-layout.md rules.
Description check ⚠️ Warning PR description is vague and lacks proper structure per template; missing Testing, Demo Video, Review Trigger, and Checklist sections entirely. Add complete sections: Testing (how tested and verified), Demo Video (if applicable), Review Trigger comment block, and Checklist items to match repository template requirements.
✅ Passed checks (20 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: tightening cache verification and switching from partial to complete directory cleanup in CI self-heal logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PR contains only YAML workflow changes to .github/workflows/ci.yml with no Swift code modifications; actor isolation check applies only to Swift production/test code changes.
Cmux Swift Blocking Runtime ✅ Passed PR contains only CI workflow YAML changes in .github/workflows/ci.yml, no production Swift code. Custom check applies to production Swift changes, not CI configuration.
Cmux Expensive Synchronous Load ✅ Passed All RestorableAgentSessionIndex.load() calls are properly guarded: either as cold-cache fallbacks (??operator, allowed) or in SharedLiveAgentIndex's Task.detached loader (cache's own background tas...
Cmux Cache Substitution Correctness ✅ Passed Check is not applicable: PR modifies only CI workflow YAML (.github/workflows/ci.yml), not production Swift/TypeScript/JavaScript code. The check specifically targets production code cache substitu...
Cmux No Hacky Sleeps ✅ Passed GitHub Actions workflow YAML is explicitly out of scope per runtime-no-hacky-sleeps.md. The PR only modifies .github/workflows/ci.yml with no changes to covered runtime scripts (TypeScript, JavaScr...
Cmux Algorithmic Complexity ✅ Passed PR changes are CI configuration only (.github/workflows/ci.yml), not production code. Algorithmic complexity rule applies to production code iterating over user data. Changes add O(1) file checks a...
Cmux Swift Concurrency ✅ Passed The PR modifies only .github/workflows/ci.yml (a YAML workflow file), not Swift code. The custom check applies to "cmux-owned Swift code" and flags Swift concurrency patterns.
Cmux Swift @Concurrent ✅ Passed This PR contains only YAML workflow file changes to .github/workflows/ci.yml (shell scripts for CI/CD). The custom check applies only to "Swift changes" per swift-concurrent-annotation.md, and no...
Cmux Swift File And Package Boundaries ✅ Passed PR modifies only .github/workflows/ci.yml (YAML workflow file), not Swift source code. The check for Swift file/package boundaries is not applicable to CI configuration changes.
Cmux Swiftpm Lockfiles ✅ Passed PR includes 78 new Package.swift files; 12 with external dependencies have Package.resolved, 66 have only internal dependencies (no Package.resolved required). Root Xcode Package.resolved included...
Cmux Swift Logging ✅ Passed PR contains only GitHub Actions workflow YAML changes (no Swift code), so the Swift logging check does not apply to this CI configuration update.
Cmux User-Facing Error Privacy ✅ Passed PR modifies only CI workflow logging (not user-facing); error messages are visible to CI engineers only, not end users, and fall under the allowed exception for developer-only operational context.
Cmux Full Internationalization ✅ Passed CI workflow diagnostic messages are operational debug logs not shown to end users, explicitly allowed exceptions per full-internationalization.md. No user-facing text, app UI, web UI, or localizati...
Cmux Architecture Rethink ✅ Passed PR modifies only .github/workflows/ci.yml (CI configuration), not Swift source code. The architectural rethink rule applies only to Swift code changes; this is a build infrastructure fix unrelate...
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed This PR's substantive changes are to CI workflow YAML (.github/workflows/ci.yml), not Swift window code. The check for auxiliary window close shortcuts is not applicable to non-window Swift changes...
Cmux Source Artifacts ✅ Passed PR modifies only .github/workflows/ci.yml (workflow config file, intentional source control). No cache artifacts, generated logs, build output, or temporary directories are added to source control....
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-resolve-selfheal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR tightens the self-heal logic in the "Resolve Swift packages" retry loop across all three CI jobs. It replaces a wildcard ls -d glob for Sentry's XCFramework with an exact [ -d ] path check, and widens the stale-cache cleanup from rm -rf \"$SOURCE_PACKAGES_DIR/artifacts\" to rm -rf \"$SOURCE_PACKAGES_DIR\" so that a retry performs a full clean resolve instead of re-entering a partial tree that xcodebuild won't complete.

  • Verify check tightened: Sentry artifact now checked at the known exact path sentry-cocoa/Sentry/Sentry.xcframework rather than a glob that could match unrelated frameworks at the same depth.
  • Wider cleanup: Removing the whole .ci-source-packages dir (not just artifacts/) on a stale-cache miss ensures the subsequent xcodebuild -resolvePackageDependencies starts from a clean state and actually materializes the binary artifacts.

Confidence Score: 4/5

Safe to merge; the change correctly fixes the intermittent artifact-missing failure on main and is consistently applied across all three jobs.

After rm -rf SOURCE_PACKAGES_DIR the directory is gone, but mkdir -p only runs once before the loop. The next xcodebuild -clonedSourcePackagesDirPath call lands on a path that no longer exists. xcodebuild almost certainly creates it, but the intent is clearer and safer with an explicit mkdir -p immediately after the rm -rf. This pattern repeats in all three jobs.

.github/workflows/ci.yml — the three Resolve Swift packages blocks all share the same missing mkdir -p after rm -rf SOURCE_PACKAGES_DIR.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Tightens XCFramework verification (exact path for Sentry instead of a wildcard glob) and widens the cleanup from only artifacts/ to the whole .ci-source-packages directory so a retry does a full clean resolve; applied identically to all three jobs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Start: attempt 1..3] --> B[xcodebuild -resolvePackageDependencies]
    B -->|non-zero exit| F{attempt == 3?}
    B -->|exit 0| C{Check Sparkle.xcframework present?}
    C -->|yes| D{Check Sentry/Sentry.xcframework present?}
    D -->|yes| E[exit 0 success]
    D -->|no| G[rm -rf SOURCE_PACKAGES_DIR whole dir]
    C -->|no| G
    G --> F
    F -->|yes| H[exit 1 failure]
    F -->|no| I[sleep attempt x 5s]
    I --> A
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Start: attempt 1..3] --> B[xcodebuild -resolvePackageDependencies]
    B -->|non-zero exit| F{attempt == 3?}
    B -->|exit 0| C{Check Sparkle.xcframework present?}
    C -->|yes| D{Check Sentry/Sentry.xcframework present?}
    D -->|yes| E[exit 0 success]
    D -->|no| G[rm -rf SOURCE_PACKAGES_DIR whole dir]
    C -->|no| G
    G --> F
    F -->|yes| H[exit 1 failure]
    F -->|no| I[sleep attempt x 5s]
    I --> A
Loading

Comments Outside Diff (3)

  1. .github/workflows/ci.yml, line 373-384 (link)

    P2 mkdir -p "$SOURCE_PACKAGES_DIR" runs once before the loop, but the new rm -rf "$SOURCE_PACKAGES_DIR" removes the entire directory. On the next loop iteration xcodebuild is invoked with a path that no longer exists. In practice xcodebuild creates the directory itself, but relying on that undocumented behavior is fragile. Moving mkdir -p inside the loop (or adding it right after the rm -rf) makes the intent explicit and guards against any xcodebuild version that expects the directory to already exist.

  2. .github/workflows/ci.yml, line 798-809 (link)

    P2 Same mkdir -p gap as in the first job: after rm -rf "$SOURCE_PACKAGES_DIR" the directory no longer exists for the next xcodebuild call.

  3. .github/workflows/ci.yml, line 1294-1305 (link)

    P2 Same mkdir -p gap as in the other two jobs: after rm -rf "$SOURCE_PACKAGES_DIR" the directory no longer exists for the next xcodebuild call.

Reviews (1): Last reviewed commit: "ci: self-heal resolve must clear the WHO..." | Re-trigger Greptile

@lawrencecchen
lawrencecchen merged commit 784ed36 into main Jun 18, 2026
21 checks passed
@lawrencecchen
lawrencecchen deleted the fix-resolve-selfheal branch June 18, 2026 23:18
@lawrencecchen
lawrencecchen restored the fix-resolve-selfheal branch July 18, 2026 10:19

This branch was successfully deployed

1 active deployment
Preview – cmux — 9cb3f84c Deployed Jun 18, 2026 by vercel[bot]
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