fix(ci): bootstrap generated Xcode project in CI - #1
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughCentralizes Xcode project generation via a new Changes
Sequence Diagram(s)sequenceDiagram
participant CI as GitHub Actions
participant Script as ensure_xcode_project.sh
participant XcodeGen as xcodegen
participant XcodeBuild as xcodebuild
participant SimCtl as simctl
participant Periphery as periphery
CI->>Script: invoke ensure_xcode_project.sh
Script->>XcodeGen: run xcodegen generate (if needed) --> rgba(100,150,255,0.5)
Script-->>CI: exit success
CI->>XcodeBuild: xcodebuild -showdestinations (if project present)
alt xcodebuild returns UUID
XcodeBuild-->>CI: destination UUID
else fallback
CI->>SimCtl: simctl list devices available
SimCtl-->>CI: destination UUID
end
CI->>Periphery: run periphery / xcodebuild with resolved destination
Periphery-->>CI: scan results
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
apps/ios/Tests/OnboardingPerformanceRemediationTests.swift (1)
99-101: Make the new helper-signature assertion whitespace-tolerant.Line 101 currently depends on exact newline/indentation (
"@MainActor\n private ..."), so harmless formatting changes can break the test. Prefer a regex (or split token assertions) so this checks structure rather than spacing.Suggested change
- XCTAssertTrue( - backgroundSource.contains( - "@MainActor\n private func requestGrainImage(for size: CGSize) async")) + XCTAssertTrue( + backgroundSource.range( + of: #"@MainActor\s+private func requestGrainImage\(for size: CGSize\) async"#, + options: .regularExpression + ) != nil + )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/ios/Tests/OnboardingPerformanceRemediationTests.swift` around lines 99 - 101, The test currently asserts exact whitespace for the helper signature by checking backgroundSource.contains("@MainActor\n private func requestGrainImage(for size: CGSize) async"); change this to a whitespace-tolerant check, e.g. use backgroundSource.range(of: "@MainActor\\s*private func requestGrainImage\\(for size: CGSize\\)\\s*async", options: .regularExpression) != nil (or use NSRegularExpression) so the assertion targets the structure of requestGrainImage(for:) rather than exact newlines/indentation.apps/ios/Tests/GeminiLiveTutorialFlowTests.swift (1)
36-38: Strengthen source-inspection assertions to verify branch structure, not just token presenceThese checks are directionally correct, but plain
containscan pass even when logic is moved outside the recipe-promotion path. Consider asserting a scoped regex pattern forhandleRecipeSelection(_:)so the test verifies control-flow intent too.Suggested test-hardening diff
XCTAssertTrue(source.contains("liveAssistantCoordinator.storeRecipeMatch")) - XCTAssertTrue(source.contains("context.completeObjective()")) - XCTAssertTrue(source.contains("didPromoteRecipeMatchLesson = true")) - XCTAssertTrue(source.contains("selectedRecipe = scored")) + let promotionPattern = #""" + if let context = tutorialFlowContext, + \s*context.activeQuest == \.pickRecipeMatch, + \s*!didPromoteRecipeMatchLesson + \s*\{ + \s*storeRecipeForAssistant\(scored\) + \s*didPromoteRecipeMatchLesson = true + \s*context.completeObjective\(\) + \s*return + \s*\} + """# + XCTAssertNotNil(source.range(of: promotionPattern, options: .regularExpression)) + XCTAssertTrue(source.contains("selectedRecipe = scored"))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/ios/Tests/GeminiLiveTutorialFlowTests.swift` around lines 36 - 38, The assertions currently only check token presence in `source` and can be fooled if the tokens are moved out of the recipe-promotion branch; update the test to assert a scoped pattern for `handleRecipeSelection(_:)` instead: locate the function body for `handleRecipeSelection(_:)` in `source` and use a regex that matches the function signature and its braces, then assert that within that body the sequence (or presence) of `context.completeObjective()`, `didPromoteRecipeMatchLesson = true`, and `selectedRecipe = scored` appears in the intended order (or at least all three) so the test verifies the branch/control-flow rather than global token presence.apps/ios/DesignSystem/Components/FLCaptureSessionCoordinator.swift (1)
122-159: Consider a brief comment explaining the dual state reset.Both calls at lines 123-128 (before async) and 153-158 (after cleanup) set identical values. This is intentional for determinism—the first provides immediate UI feedback, the second ensures final consistency. A short comment on the first call (e.g.,
// Reset published state immediately for deterministic UI update) would clarify this to future readers.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/ios/DesignSystem/Components/FLCaptureSessionCoordinator.swift` around lines 122 - 159, Add a brief inline comment above the first call to updatePublishedState in shutdownSession to explain the intentional dual state reset: note that the first call provides immediate UI feedback/deterministic update while the second (inside sessionQueue.async after cleanup) ensures final consistency; place the comment near the first updatePublishedState call and reference shutdownSession and sessionQueue.async so future readers understand the purpose of both resets.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/ensure_xcode_project.sh`:
- Around line 5-12: The script allows overriding PROJECT_PATH/project_spec but
only checks required_outputs once; after the project generation step you must
re-validate that each required output (the entries in required_outputs, e.g.,
"$project_path/project.pbxproj", "$repo_root/Xcode/FridgeLuck-Info.plist",
"$repo_root/Xcode/FridgeLuck.entitlements") exists and exit non-zero if any are
missing. Update ensure_xcode_project.sh to run the same existence checks for
required_outputs immediately after the generation command (the block that
creates the Xcode project) and return a clear error message referencing
project_path when a file is absent so downstream xcodebuild won’t run on an
incomplete project.
---
Nitpick comments:
In `@apps/ios/DesignSystem/Components/FLCaptureSessionCoordinator.swift`:
- Around line 122-159: Add a brief inline comment above the first call to
updatePublishedState in shutdownSession to explain the intentional dual state
reset: note that the first call provides immediate UI feedback/deterministic
update while the second (inside sessionQueue.async after cleanup) ensures final
consistency; place the comment near the first updatePublishedState call and
reference shutdownSession and sessionQueue.async so future readers understand
the purpose of both resets.
In `@apps/ios/Tests/GeminiLiveTutorialFlowTests.swift`:
- Around line 36-38: The assertions currently only check token presence in
`source` and can be fooled if the tokens are moved out of the recipe-promotion
branch; update the test to assert a scoped pattern for
`handleRecipeSelection(_:)` instead: locate the function body for
`handleRecipeSelection(_:)` in `source` and use a regex that matches the
function signature and its braces, then assert that within that body the
sequence (or presence) of `context.completeObjective()`,
`didPromoteRecipeMatchLesson = true`, and `selectedRecipe = scored` appears in
the intended order (or at least all three) so the test verifies the
branch/control-flow rather than global token presence.
In `@apps/ios/Tests/OnboardingPerformanceRemediationTests.swift`:
- Around line 99-101: The test currently asserts exact whitespace for the helper
signature by checking backgroundSource.contains("@MainActor\n private func
requestGrainImage(for size: CGSize) async"); change this to a
whitespace-tolerant check, e.g. use backgroundSource.range(of:
"@MainActor\\s*private func requestGrainImage\\(for size: CGSize\\)\\s*async",
options: .regularExpression) != nil (or use NSRegularExpression) so the
assertion targets the structure of requestGrainImage(for:) rather than exact
newlines/indentation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 32a7cb44-2a9d-40f1-ac17-f7c358a4553a
📒 Files selected for processing (11)
.github/workflows/ios-ci.ymlapps/ios/DesignSystem/Components/FLCaptureSessionCoordinator.swiftapps/ios/Tests/CaptureLifecycleRegressionTests.swiftapps/ios/Tests/GeminiLiveTutorialFlowTests.swiftapps/ios/Tests/OnboardingPerformanceRemediationTests.swiftscripts/ensure_xcode_project.shscripts/open_ios_project.shscripts/resolve_ios_sim_destination.shscripts/run_ios_tests.shscripts/run_periphery_scan.shscripts/verify_healthkit_entitlement.sh
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Verification
Summary by CodeRabbit
Chores
Refactor
Tests