Skip to content

Fix CI scheme selection and stabilize hosted UI tests#1

Merged
PSchmiedmayer merged 18 commits into
mainfrom
fix/ci
Jul 13, 2026
Merged

Fix CI scheme selection and stabilize hosted UI tests#1
PSchmiedmayer merged 18 commits into
mainfrom
fix/ci

Conversation

@PSchmiedmayer

@PSchmiedmayer PSchmiedmayer commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

♻️ Current situation & Problem

The initial main workflow 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

  • Explicitly select the NutriSight scheme for GitHub Actions build and CodeQL jobs.
  • Explicitly select the NutriSight scheme in Fastlane test, CodeQL, and build lanes.
  • Remove outdated scheme metadata.
  • Stabilize the nutrition-results UI test by waiting for the close button.
  • Add build-status and REUSE-compliance badges to the README.

📚 Documentation

The README now displays the build status for main and the repository’s REUSE compliance status.

✅ Testing

  • SwiftLint strict validation: 0 violations.
  • REUSE compliance: 123/123 files compliant.
  • Fastfile Ruby syntax validation passed.
  • Xcode scheme-management plist validation passed.
  • GitHub Actions workflow validation passed.
  • CI-equivalent build completed successfully.
  • All unit tests and four existing UI tests passed in the full run.
  • The previously failing end-to-end capture, analysis, Health save, and restart UI test passed after the synchronization fix.

Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@PSchmiedmayer PSchmiedmayer self-assigned this Jul 13, 2026
Copilot AI review requested due to automatic review settings July 13, 2026 04:16
@PSchmiedmayer PSchmiedmayer added the enhancement New feature or request label Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The project now explicitly selects the NutriSight scheme in GitHub Actions and Fastlane. CodeQL execution is disabled, and coverage uses the build artifact output. Simulated-glasses launches can prepare the device, provide bundled fallback capture data, and recover camera streams after timeouts. UI tests use shared retrying helpers and wait for result controls. The obsolete mock-device package is removed from UI tests, and the README adds status badges.

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 accurately summarizes the main changes to CI scheme selection and UI test stabilization.
Description check ✅ Passed The description is clearly related to the changeset and matches the workflow, test, and README updates.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 NutriSight scheme 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.

Comment thread README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 799617a and 5501075.

📒 Files selected for processing (3)
  • .github/workflows/build-and-test.yml
  • NutriSight.xcodeproj/xcuserdata/paulschmiedmayer.xcuserdatad/xcschemes/xcschememanagement.plist
  • NutriSightUITests/NutriSightUITests.swift
💤 Files with no reviewable changes (1)
  • NutriSight.xcodeproj/xcuserdata/paulschmiedmayer.xcuserdatad/xcschemes/xcschememanagement.plist

Comment thread .github/workflows/build-and-test.yml
Comment thread NutriSightUITests/NutriSightUITests.swift Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5501075 and 2175070.

📒 Files selected for processing (3)
  • NutriSight/Wearables/WearablesCoordinator+Camera.swift
  • NutriSight/Wearables/WearablesCoordinator.swift
  • NutriSightUITests/NutriSightUITests.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • NutriSightUITests/NutriSightUITests.swift

Comment thread NutriSight/Wearables/WearablesCoordinator.swift Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2175070 and a79b4c7.

📒 Files selected for processing (7)
  • .github/workflows/build-and-test.yml
  • NutriSight.xcodeproj/project.pbxproj
  • NutriSight/App/LaunchConfiguration.swift
  • NutriSight/Wearables/WearablesBootstrap.swift
  • NutriSight/Wearables/WearablesCoordinator+Camera.swift
  • NutriSight/Wearables/WearablesCoordinator.swift
  • NutriSightUITests/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

Comment thread NutriSight/Wearables/WearablesBootstrap.swift
Comment thread NutriSight/Wearables/WearablesCoordinator.swift Outdated
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

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 ☂️

PSchmiedmayer added a commit to SchmiedmayerLab/.github that referenced this pull request Jul 13, 2026
### ♻️ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/build-and-test.yml (1)

26-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Pin the reusable workflows more tightly

Using @v0.2 instead of @v0.2.4 makes 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

📥 Commits

Reviewing files that changed from the base of the PR and between a79b4c7 and ac9dcc2.

📒 Files selected for processing (4)
  • .github/workflows/build-and-test.yml
  • NutriSight/Wearables/WearablesBootstrap.swift
  • NutriSight/Wearables/WearablesCoordinator.swift
  • NutriSightUITests/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

@PSchmiedmayer PSchmiedmayer changed the title Update CI and Fix Setup Fix CI scheme selection and stabilize hosted UI tests Jul 13, 2026
@PSchmiedmayer
PSchmiedmayer merged commit d461f5b into main Jul 13, 2026
7 checks passed
@PSchmiedmayer
PSchmiedmayer deleted the fix/ci branch July 13, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants