Skip to content

feat(init): integrate native iOS setup - #490

Closed
seanperez29 wants to merge 4 commits into
sean/ios-native-reconciliationfrom
sean/ios-native-init-integration
Closed

seanperez29 wants to merge 4 commits into
sean/ios-native-reconciliationfrom
sean/ios-native-init-integration

Conversation

@seanperez29

@seanperez29 seanperez29 commented Sep 22, 2026 •

Copy link
Copy Markdown

Summary

  • expose native iOS setup through the normal clerk init framework-detection and application-linking flow
  • coordinate local planning, user approval, transactional project changes, remote reconciliation, and final verification
  • add dry-run, target selection, App ID Prefix resolution, optional AuthView setup, and optional Sign in with Apple setup
  • keep agent mode deterministic while supporting the ordinary no-argument interactive experience
  • add compiled-CLI, fixture, integration, and end-to-end coverage for the public workflow
  • offer a target picker for interactive init and dry runs when several apps exist; carry the chosen target through planning and scaffolding, with cancellation before setup or authentication

Scope

This is the public integration layer connecting authentication and application selection to the local and remote capabilities in the preceding PRs.

It does not add Doctor diagnostics, macOS support, or Xcode JSON project-format support; those are isolated in later stack layers. Dry-run remains local and read-only, and local and remote mutations retain separate planning, approval, and verification boundaries.

A sole app target remains automatic. Explicit --target bypasses the picker. Agent mode, --yes, JSON output, and redirected input/output preserve the existing ambiguity response; none guesses a target. The picker uses exhaustive discovery and retains all later safety checks, including refusals for colliding target IDs across copied projects.

Validation

Current head: 50464d8360933608167d8bc6652d86c6a9e91662.

  • Formatting, lint, typechecking, git diff --check, and all 3,903 unit tests passed.
  • Integrated head 2aed604b passed all 4,315 unit tests and compilation. All seven updated branch heads passed local checks independently; feat(init): add iOS project inspection foundations #431 and feat(init): add transactional native iOS mutation engines #453 are unchanged.
  • Forty new regressions cover prepared-domain validation, source ownership, atomic retry records, prefix casing, entitlement ownership, JSON document/package ambiguity, platform drift, and equivalent file paths.
  • All 36 PBX/JSON corpus scenarios passed dry run, apply, unchanged rerun, and read-only Doctor assertions; all 40 unsigned simulator/macOS builds passed. The two custom-runtime existing-domain cases explicitly verify the dirty-file guard before rerunning unchanged with --allow-dirty.
  • Toolchains: Xcode 26.5 (17F42) for PBX and Xcode 27.2 beta (27B5019j) for JSON. Corpus APIs used local GET-only stubs; no live backend writes were performed.
  • Credential-backed E2E could not start because the current 1Password account cannot access the AI Enablement vault. It remains an outstanding release check, not a passing or failing test. GitHub CI was not queried or awaited; signed-device Apple sign-in was not rerun.
  • Detailed local evidence: clerk-cli-real-xcode-corpus/reports/2026-09-25-coderabbit-five.md. Prior conditional SwiftUI-root and signing-output validation is recorded in the earlier reports.

Stack

  1. feat(init): add iOS project inspection foundations #431 — native Apple project inspection foundations
  2. feat(init): add transactional native iOS mutation engines #453 — transactional local mutation engines
  3. feat(init): compose native iOS local setup #489 — native iOS local setup orchestration
  4. feat(init): reconcile native iOS backend configuration #454 — native iOS backend reconciliation
  5. feat(init): integrate native iOS setup #490 — public native iOS init integration
  6. feat(doctor): add native iOS diagnostics #455 — native iOS Doctor diagnostics
  7. feat(native): add macOS setup and diagnostics #486 — macOS setup and diagnostics
  8. feat(init): support Xcode JSON project format #488 — Xcode JSON project format
  9. fix(init): improve established Apple app setup and interactive flow #493 — established app operation gates and neutral entitlement ownership

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: c8f7badb-e096-42dd-8fa3-9f430f76df41

📥 Commits

Reviewing files that changed from the base of the PR and between 9cddf69 and 1eb63b9.

📒 Files selected for processing (32)
  • .changeset/ios-native-init-integration.md
  • packages/cli-core/src/cli-program.ts
  • packages/cli-core/src/commands/init/README.md
  • packages/cli-core/src/commands/init/frameworks/ios.test.ts
  • packages/cli-core/src/commands/init/frameworks/ios.ts
  • packages/cli-core/src/commands/init/frameworks/types.ts
  • packages/cli-core/src/commands/init/index-ios.test.ts
  • packages/cli-core/src/commands/init/index.test.ts
  • packages/cli-core/src/commands/init/index.ts
  • packages/cli-core/src/commands/init/ios/apply-cli-runtime.test.ts
  • packages/cli-core/src/commands/init/ios/apply-cli.test-helpers.ts
  • packages/cli-core/src/commands/init/ios/apply-cli.test.ts
  • packages/cli-core/src/commands/init/ios/compiled-cli.test.ts
  • packages/cli-core/src/commands/init/ios/coordinator.ts
  • packages/cli-core/src/commands/init/ios/dry-run.test.ts
  • packages/cli-core/src/commands/init/ios/target-picker.test.ts
  • packages/cli-core/src/commands/init/ios/target-picker.ts
  • packages/cli-core/src/commands/init/strategy.test.ts
  • packages/cli-core/src/commands/link/index.test.ts
  • packages/cli-core/src/commands/link/index.ts
  • packages/cli-core/src/lib/app-picker.ts
  • packages/cli-core/src/lib/framework.ts
  • packages/cli-core/src/lib/telemetry.ts
  • packages/cli-core/src/test/integration/agent-mode.test.ts
  • packages/cli-core/src/test/lib/init-harness.ts
  • test/e2e/fixtures/ios/MyApp.xcodeproj/project.pbxproj
  • test/e2e/fixtures/ios/MyApp/ContentView.swift
  • test/e2e/fixtures/ios/MyApp/MyApp.entitlements
  • test/e2e/fixtures/ios/MyApp/MyAppApp.swift
  • test/e2e/fixtures/ios/README.md
  • test/e2e/lib/fixture-setup.ts
  • test/e2e/native-init.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/javascript (auto-detected)

Included review availability: 6 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

clerk init now supports native iOS project inspection and setup, including read-only dry runs, target selection, Xcode package and Swift configuration, and optional prebuilt Auth UI or Sign in with Apple. The flow validates authentication and application links before remote setup, and uses local and remote setup phases. The change also updates application-linking controls, iOS guidance, tests, and end-to-end fixtures.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Suggested reviewers: rafa-thayto

Merge Risk: ⚪ Minimal · up to 1eb63

Native iOS setup is now part of clerk init, with dry-run, target selection, and optional Apple and prebuilt UI setup. It has extensive test coverage, and no concrete defect is known at the current head. The change appears ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 63 functions across 27 files. (5 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: integrating native iOS setup into init.
Description check ✅ Passed The description directly explains the native iOS init integration, its capabilities, scope, and validation.
Full details: Docstring Coverage

Explanation

Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 63 functions across 27 files. (5 skipped: 5 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

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

@changeset-bot

changeset-bot Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: edb8770

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
clerk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@seanperez29
seanperez29 added this pull request to stack #491 September 22, 2026 17:34
@seanperez29
seanperez29 force-pushed the sean/ios-native-init-integration branch from cfe9197 to 4ceeeb9 Compare September 23, 2026 21:55
@seanperez29
seanperez29 force-pushed the sean/ios-native-init-integration branch 2 times, most recently from 0f90f05 to 156fc13 Compare September 24, 2026 19:23
@seanperez29
seanperez29 force-pushed the sean/ios-native-init-integration branch from 156fc13 to 07f468f Compare September 24, 2026 20:29
@seanperez29
seanperez29 force-pushed the sean/ios-native-init-integration branch from 07f468f to 4abec31 Compare September 24, 2026 20:52
@seanperez29
seanperez29 force-pushed the sean/ios-native-init-integration branch from 4abec31 to b0e0057 Compare September 24, 2026 21:38
@seanperez29
seanperez29 force-pushed the sean/ios-native-init-integration branch 2 times, most recently from 8f9f4a2 to 90df31e Compare September 24, 2026 23:21
@seanperez29
seanperez29 force-pushed the sean/ios-native-init-integration branch from 90df31e to 1eb63b9 Compare September 25, 2026 00:15
@seanperez29
seanperez29 marked this pull request as ready for review September 25, 2026 15:10
@seanperez29
seanperez29 force-pushed the sean/ios-native-init-integration branch from 1eb63b9 to edb8770 Compare September 25, 2026 15:46
@seanperez29
seanperez29 force-pushed the sean/ios-native-init-integration branch from edb8770 to 50464d8 Compare September 25, 2026 16:46
@seanperez29 seanperez29 closed this Oct 2, 2026
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