Skip to content

[breaking change] update deps#35

Open
lukaskollmer wants to merge 2 commits into
mainfrom
lukas/update-deps
Open

[breaking change] update deps#35
lukaskollmer wants to merge 2 commits into
mainfrom
lukas/update-deps

Conversation

@lukaskollmer

@lukaskollmer lukaskollmer commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

[breaking change] update deps

♻️ Current situation & Problem

updates Spezi to the new repo; as part of this we also update from what used to be SpeziStudy 0.1.x to what used to be SpeziStudy 0.2.x

⚙️ Release Notes

  • updated dependencies to point to new Spezi repo

📚 Documentation

n/a

✅ Testing

n/a

Code of Conduct & Contributing Guidelines

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

Summary by CodeRabbit

  • New Features

    • Added localization support for study metadata and content, enabling multi-language presentation.
  • Chores

    • Updated platform support; visionOS is no longer supported.
    • Updated package dependencies to streamline configuration.
    • Incremented study definition version to 41.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Package.swift removes visionOS support and replaces SpeziStudy, SpeziFoundation, and FHIRModels dependencies with a single pinned Spezi package, updating all target dependency wiring and removing swiftSettings isolation entries. Study.swift imports SpeziLocalization, bumps studyRevision to 41, converts metadata string fields to localized dictionaries, and removes enrollmentConditions: .none.

Changes

Spezi dependency consolidation and localized study metadata

Layer / File(s) Summary
Package manifest: platform and dependency rewire
Package.swift
Removes visionOS(.v2) from platforms; adds Spezi at a pinned revision replacing SpeziStudy, SpeziFoundation, and FHIRModels; rewires all target product references and removes swiftSettings defaultIsolation entries.
Study.swift: SpeziLocalization import and localized metadata
Sources/MHCStudyDefinitionExporter/Study.swift
Imports SpeziLocalization; increments studyRevision to 41; converts title, shortTitle, explanationText, and shortExplanationText to localized dictionary values; removes enrollmentConditions: .none.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions 'breaking change' and 'update deps' which directly aligns with the PR's core objective of updating dependencies (migrating to new Spezi package) and is marked as a breaking change, though it is somewhat terse.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 lukas/update-deps

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

Comment thread Package.swift
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.6.2"),
// not used directly but we need to fix it below 0.9.0 for the time being
.package(url: "https://github.com/apple/FHIRModels.git", .upToNextMinor(from: "0.8.0"))
.package(url: "https://github.com/SchmiedmayerLab/Spezi.git", revision: "d0f1e1cee93392ee7a0d64849a8dbf107d98a39e"),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

TODO update to a tagged release before merging, once SchmiedmayerLab/Spezi#1 is merged

@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 `@Package.swift`:
- Around line 42-47: The MHCStudyDefinitionExporter target's dependencies array
is missing three required Spezi products that are imported by the target. Add
the following three product dependencies to the dependencies array in
Package.swift: .product(name: "SpeziFoundation", package: "Spezi"),
.product(name: "SpeziHealthKit", package: "Spezi"), and .product(name:
"SpeziScheduler", package: "Spezi"). These products must be declared in the same
format as the existing Spezi products in the dependencies list to ensure the
target can access the imported modules and compile successfully.

In `@Sources/MHCStudyDefinitionExporter/Study.swift`:
- Around line 43-49: The explanationText property in the metadata initialization
for the Study definition is set to an empty dictionary, which violates Spezi 0.2
requirements that mandate at least one localization entry in localized
dictionaries. Replace the empty dictionary in explanationText with at least one
language entry following the same pattern as shortExplanationText, using the
format [.enUS: "descriptive text"] to provide localized content for the UI.
🪄 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: 3ae0d055-4064-4b3c-9cab-65c8de1d159f

📥 Commits

Reviewing files that changed from the base of the PR and between 5ccee31 and 08d8df5.

📒 Files selected for processing (2)
  • Package.swift
  • Sources/MHCStudyDefinitionExporter/Study.swift

Comment thread Package.swift
Comment on lines 42 to 47
dependencies: [
"MHCStudyDefinition",
.product(name: "SpeziStudyDefinition", package: "SpeziStudy"),
.product(name: "SpeziStudy", package: "SpeziStudy"),
.product(name: "SpeziLocalization", package: "SpeziFoundation")
.product(name: "SpeziStudyDefinition", package: "Spezi"),
.product(name: "SpeziStudy", package: "Spezi"),
.product(name: "SpeziLocalization", package: "Spezi")
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check imported Spezi modules in the exporter target.
rg -n '^import\s+Spezi' Sources/MHCStudyDefinitionExporter -C1

# Check declared dependencies for MHCStudyDefinitionExporter in Package.swift.
rg -n 'name:\s*"MHCStudyDefinitionExporter"|\.product\(name:\s*"(Spezi[^"]+|ArgumentParser)"' Package.swift -C5

Repository: SchmiedmayerLab/MyHeartCounts-StudyDefinitions

Length of output: 3455


🏁 Script executed:

#!/bin/bash
# Verify exact imports across MHCStudyDefinitionExporter target
echo "=== All Spezi imports in MHCStudyDefinitionExporter target ==="
rg -n 'import Spezi' Sources/MHCStudyDefinitionExporter --no-heading | sort | uniq

# Get the Spezi package revision
echo -e "\n=== Spezi package revision in Package.swift ==="
rg 'revision:|from:' Package.swift | grep -A1 'SchmiedmayerLab/Spezi'

Repository: SchmiedmayerLab/MyHeartCounts-StudyDefinitions

Length of output: 1034


🌐 Web query:

Spezi framework re-exports SpeziFoundation SpeziHealthKit SpeziScheduler dependencies

💡 Result:

The core Spezi framework does not globally re-export SpeziFoundation, SpeziHealthKit, or SpeziScheduler [1]. In the Stanford Spezi ecosystem, Spezi, SpeziFoundation, SpeziHealthKit, and SpeziScheduler are distinct Swift packages [2][3][4][1]. The Spezi framework itself explicitly lists SpeziFoundation as a dependency in its Package.swift file [1], but it does not use the @_exported attribute to re-export it or other modules to its consumers. Individual modules within the ecosystem handle their own imports and exports as needed: - SpeziHealthKit, for example, imports SpeziFoundation and, in some cases, selectively re-exports specific components (such as the ArrayBuilder enum) to make them available to downstream consumers of the HealthKit module [5][6]. - Dependencies between these packages are typically managed through standard Swift Package Manager dependency declarations in each project's Package.swift file [2][1][7][8], rather than through global re-exports from the core Spezi framework. Consumers of these frameworks are expected to import the specific modules they require directly [4].

Citations:


Add missing Spezi package dependencies for MHCStudyDefinitionExporter.

MHCStudyDefinitionExporter imports SpeziFoundation, SpeziHealthKit, and SpeziScheduler, but the target's dependency list (lines 42–47) does not declare these products. These are distinct packages in the Spezi ecosystem that are not re-exported by the currently declared dependencies (SpeziStudyDefinition, SpeziStudy, SpeziLocalization). Add the following to the dependencies:

  • .product(name: "SpeziFoundation", package: "Spezi")
  • .product(name: "SpeziHealthKit", package: "Spezi")
  • .product(name: "SpeziScheduler", package: "Spezi")

This target will fail to compile without these declarations.

🤖 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 `@Package.swift` around lines 42 - 47, The MHCStudyDefinitionExporter target's
dependencies array is missing three required Spezi products that are imported by
the target. Add the following three product dependencies to the dependencies
array in Package.swift: .product(name: "SpeziFoundation", package: "Spezi"),
.product(name: "SpeziHealthKit", package: "Spezi"), and .product(name:
"SpeziScheduler", package: "Spezi"). These products must be declared in the same
format as the existing Spezi products in the dependencies list to ensure the
target can access the imported modules and compile successfully.

Comment on lines 43 to +49
metadata: .init(
id: .mhcStudy,
title: "My Heart Counts",
shortTitle: "MHC",
title: [.enUS: "My Heart Counts"],
shortTitle: [.enUS: "MHC"],
icon: .systemSymbol("cube.transparent"),
explanationText: "",
shortExplanationText: "Improve your cardiovascular health",
explanationText: [:],
shortExplanationText: [.enUS: "Improve your cardiovascular health"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In SpeziStudyDefinition (from the Spezi 0.2 line), what are the requirements/defaults for StudyDefinition metadata fields explanationTextandenrollmentConditions? Is an empty explanationText localization dictionary valid?

💡 Result:

For SpeziStudyDefinition in the Spezi 0.2 line, the study definition metadata fields are: 1) explanationText - In the 0.2.x line, explanationText is represented as a localized dictionary (a mapping from localization keys/locale identifiers to strings), not as a single scalar string. One example study-definition change explicitly mentions “localized dictionary metadata for … explanationText”. [1][2] - The sources found here do not state an explicit validation rule about whether the dictionary may be empty. However, the localization change history indicates the field is expected to be provided via the localized dictionary mechanism. [1][2] 2) enrollmentConditions - In the 0.2.x line referenced in the provided sources, enrollmentConditions was removed from the exported study metadata: a change log states “Previously present enrollmentConditions:.none removed from metadata.” [1] - The follow-up change also states that explicit enrollmentConditions was removed from metadata. [2] Is an empty explanationText localization dictionary valid? - Based on the evidence retrieved, there is no explicit statement in the sources found that confirms whether an empty localization dictionary is considered valid for explanationText in Spezi 0.2. - What can be said with evidence is that in 0.2, explanationText is expected to be supplied using the localized dictionary approach, and enrollmentConditions is not present (it was removed). [1][2] Practical recommendation - Treat an empty explanationText dictionary as likely invalid/unsupported unless you can confirm via the Spezi 0.2 SpeziStudy/SpeziStudyDefinition API docs or unit tests; ensure at least one locale entry is present (e.g., English) so the UI has text to render. (This is a conservative inference given the lack of an explicit “empty dictionary allowed” rule in the sources we found.) [1][2]

Citations:


Add at least one language entry to explanationText.

explanationText: [:] creates an empty localization dictionary. In Spezi 0.2, explanationText must be a localized dictionary, but an empty one provides no text for any language and will fail validation or render no content in the UI. Add at least one language entry (e.g., [.enUS: "..."]). This aligns with the confirmed Spezi 0.2 metadata contract where localization dictionaries require at least one locale entry.

🤖 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 `@Sources/MHCStudyDefinitionExporter/Study.swift` around lines 43 - 49, The
explanationText property in the metadata initialization for the Study definition
is set to an empty dictionary, which violates Spezi 0.2 requirements that
mandate at least one localization entry in localized dictionaries. Replace the
empty dictionary in explanationText with at least one language entry following
the same pattern as shortExplanationText, using the format [.enUS: "descriptive
text"] to provide localized content for the UI.

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

Development

Successfully merging this pull request may close these issues.

1 participant