Fix CI scheme selection and stabilize hosted UI tests#1
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe project now explicitly selects the Sequence Diagram(s)sequenceDiagram
participant NutriSightUITests
participant NutriSightApp
participant WearablesCoordinator
NutriSightUITests->>NutriSightApp: launch with --prepare-simulated-glasses
NutriSightUITests->>NutriSightApp: captureMeal(...)
NutriSightApp->>WearablesCoordinator: capturePhoto(...)
WearablesCoordinator-->>NutriSightApp: fallback image data or captureTimedOut
NutriSightApp-->>NutriSightUITests: analysis and result controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
Pull request overview
This PR aims to make CI and local automation more deterministic by explicitly selecting the NutriSight Xcode scheme across GitHub Actions and Fastlane, removing/adjusting outdated Xcode scheme metadata, and stabilizing a flaky UI test. It also updates the README with CI and REUSE compliance badges.
Changes:
- Explicitly set the
NutriSightscheme in GitHub Actions reusable workflow calls and in Fastlane lanes. - Stabilize the nutrition-results UI test by waiting for the close button to appear.
- Add build-status and REUSE-compliance badges to the README.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds CI and REUSE compliance badges to the project header. |
| NutriSightUITests/NutriSightUITests.swift | Reduces UI test flakiness by waiting for a key UI element before proceeding. |
| NutriSight.xcodeproj/xcuserdata/paulschmiedmayer.xcuserdatad/xcschemes/xcschememanagement.plist | Updates scheme management metadata (but is in user-scoped xcuserdata). |
| fastlane/Fastfile | Pins Fastlane build/test/codeql lanes to the NutriSight scheme. |
| .github/workflows/build-and-test.yml | Pins CI build and CodeQL jobs to the NutriSight scheme. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build-and-test.yml:
- Around line 33-42: Add an automated reminder or tracking mechanism near the
disabled codeql job in the build workflow, referencing the upstream CodeQL issue
and the existing re-enable condition. Preserve the current workaround while
ensuring the team is prompted to restore the codeql job once the upstream fix is
available.
In `@NutriSightUITests/NutriSightUITests.swift`:
- Around line 216-233: Update the captureMeal retry loop to replace the hard
XCTAssertTrue check for the analysis-progress element with a guard that
continues to the next attempt when it does not appear within the timeout.
Preserve the existing successful result check and retry behavior.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4c313d8c-76ee-4bc9-a388-52a69c65637e
📒 Files selected for processing (3)
.github/workflows/build-and-test.ymlNutriSight.xcodeproj/xcuserdata/paulschmiedmayer.xcuserdatad/xcschemes/xcschememanagement.plistNutriSightUITests/NutriSightUITests.swift
💤 Files with no reviewable changes (1)
- NutriSight.xcodeproj/xcuserdata/paulschmiedmayer.xcuserdatad/xcschemes/xcschememanagement.plist
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@NutriSight/Wearables/WearablesCoordinator.swift`:
- Around line 235-236: In the timeout handling flow, update the capture
continuation only after recoverCameraAfterCaptureTimeout() completes, so retries
cannot run while camera recovery is in flight. Preserve the existing
WearablesCameraError.captureTimedOut result and recovery behavior, changing the
ordering around continuation.resume and recoverCameraAfterCaptureTimeout.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 17e5178a-aef4-4583-aeca-9760b297fb38
📒 Files selected for processing (3)
NutriSight/Wearables/WearablesCoordinator+Camera.swiftNutriSight/Wearables/WearablesCoordinator.swiftNutriSightUITests/NutriSightUITests.swift
🚧 Files skipped from review as they are similar to previous changes (1)
- NutriSightUITests/NutriSightUITests.swift
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@NutriSight/Wearables/WearablesBootstrap.swift`:
- Around line 50-53: Update the initialization flow around configuredSource and
prepareSimulatedGlasses() so the source is committed only after
simulated-glasses preparation completes successfully. Move the configuredSource
assignment after the preparation block, or clear it in the failure path,
ensuring a later retry does not return early after preparation throws.
In `@NutriSight/Wearables/WearablesCoordinator.swift`:
- Around line 237-239: Update the simulatedCaptureFallbackData branch in the
capture flow to call recoverCameraAfterCaptureTimeout() before resuming the
continuation and returning fallback data. Preserve the existing fallback result
while ensuring the camera stream is recovered before the next UI-test retry.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bdef85d8-4c2b-4f2a-a8e0-400cee2d6389
📒 Files selected for processing (7)
.github/workflows/build-and-test.ymlNutriSight.xcodeproj/project.pbxprojNutriSight/App/LaunchConfiguration.swiftNutriSight/Wearables/WearablesBootstrap.swiftNutriSight/Wearables/WearablesCoordinator+Camera.swiftNutriSight/Wearables/WearablesCoordinator.swiftNutriSightUITests/NutriSightUITests.swift
💤 Files with no reviewable changes (1)
- NutriSight.xcodeproj/project.pbxproj
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/workflows/build-and-test.yml
- NutriSightUITests/NutriSightUITests.swift
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
### ♻️ Current situation & Problem SchmiedmayerLab/NutriSight#1 exposed a layout mismatch in the reusable coverage workflow. A single artifact is extracted directly into the download destination, while multiple artifacts retain artifact-named wrapper directories. The workflow assumed only the wrapped layout, so a valid xcresult could not be found. The reusable build workflow inferred its result bundle and artifact names correctly, but did not expose them to downstream jobs. Callers therefore had to duplicate an inferred name when invoking the coverage workflow. ### ⚙️ Release Notes - Normalize single and multiple xcresult artifact layouts before conversion. - Support both direct and wrapped lcov artifact layouts. - Validate downloaded coverage inputs and report clear errors for invalid bundles. - Expose resolved result_bundle and artifact_name outputs from the reusable xcodebuild workflow. ### 📚 Documentation The coverage workflow now documents the single-artifact extraction behavior inline and stages downloads outside the checked-out repository. Callers can pass the build output to coverage through needs.<job>.outputs.artifact_name while existing literal names and glob patterns remain supported. ### ✅ Testing - Ran actionlint across all reusable workflows. - Ran yamllint, REUSE validation, and whitespace checks. - Verified the single-artifact path with the NutriSight xcresult; xccov read 78.11% coverage. - Verified that two wrapped xcresult bundles merge into a readable result. - Verified direct and wrapped lcov path resolution. - Passed end-to-end consumer validation in SchmiedmayerLab/NutriSight#1 against commit 5251e4c, including Codecov upload: https://github.com/SchmiedmayerLab/NutriSight/actions/runs/29235977361 ### Code of Conduct & Contributing Guidelines By creating and submitting this pull request, I agree to follow the Code of Conduct and Contributing Guidelines. - [x] I agree to follow the Code of Conduct and Contributing Guidelines.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build-and-test.yml (1)
26-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePin the reusable workflows more tightly
Using
@v0.2instead of@v0.2.4makes CI track future patch releases and can change behavior without a code change. If that’s intentional, document it; otherwise pin to a fixed tag or commit SHA.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/build-and-test.yml around lines 26 - 32, Update the reusable workflow references for swiftlint and periphery, along with the nearby reuse workflow reference, to use fixed tags such as v0.2.4 or immutable commit SHAs instead of the floating v0.2 tag. Keep the workflow behavior unchanged apart from making these dependency versions deterministic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/build-and-test.yml:
- Around line 26-32: Update the reusable workflow references for swiftlint and
periphery, along with the nearby reuse workflow reference, to use fixed tags
such as v0.2.4 or immutable commit SHAs instead of the floating v0.2 tag. Keep
the workflow behavior unchanged apart from making these dependency versions
deterministic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1f3b4334-d296-4249-b7f3-8a579076602b
📒 Files selected for processing (4)
.github/workflows/build-and-test.ymlNutriSight/Wearables/WearablesBootstrap.swiftNutriSight/Wearables/WearablesCoordinator.swiftNutriSightUITests/NutriSightUITests.swift
🚧 Files skipped from review as they are similar to previous changes (3)
- NutriSight/Wearables/WearablesCoordinator.swift
- NutriSight/Wearables/WearablesBootstrap.swift
- NutriSightUITests/NutriSightUITests.swift
♻️ Current situation & Problem
The initial
mainworkflow did not complete successfully. Scheme selection was implicit in GitHub Actions and Fastlane, while tracked Xcode metadata still referenced an outdated scheme.A full local CI-equivalent run also exposed a timing race in the nutrition-results UI test.
⚙️ Release Notes
NutriSightscheme for GitHub Actions build and CodeQL jobs.NutriSightscheme in Fastlane test, CodeQL, and build lanes.📚 Documentation
The README now displays the build status for
mainand the repository’s REUSE compliance status.✅ Testing
Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: