Skip to content

[breaking change] update to new SpeziStudy release#34

Closed
lukaskollmer wants to merge 1 commit into
mainfrom
lukas/spezistudy-update
Closed

[breaking change] update to new SpeziStudy release#34
lukaskollmer wants to merge 1 commit into
mainfrom
lukas/spezistudy-update

Conversation

@lukaskollmer

Copy link
Copy Markdown
Collaborator

[breaking change] update to new SpeziStudy release

Note this is a breaking change so we'll need to coordinate the release with a corresponding MHC app release

⚙️ Release Notes

  • updates SpeziStudy to 0.2.x release

📚 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:

@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Package.swift updates SwiftPM dependencies (SpeziStudy to a commit revision, SpeziFoundation to 2.7.7) and removes MainActor isolation settings from both targets. Study.swift imports SpeziLocalization and refactors metadata to use localized dictionaries, increments study revision to 41, and removes the enrollmentConditions field.

Changes

Study Definition Localization and Configuration

Layer / File(s) Summary
Dependency constraints and concurrency isolation
Package.swift
SwiftPM dependencies updated: SpeziStudy pinned to a specific commit revision, SpeziFoundation upgraded to 2.7.7. MainActor concurrency isolation removed from MHCStudyDefinitionExporter and MHCStudyDefinitionExporterCLI target declarations.
Study definition localization
Sources/MHCStudyDefinitionExporter/Study.swift
SpeziLocalization imported. Study definition mhcStudyDefinition incremented to revision 41 with localized dictionary metadata for title, shortTitle, explanationText, and shortExplanationText. Previously present enrollmentConditions: .none removed from metadata.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • PSchmiedmayer
  • PaulGoldschmidt
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly describes the main change: updating to a new SpeziStudy release while marking it as a breaking change.
Description check ✅ Passed The description is directly related to the changeset, explaining the SpeziStudy update, its breaking nature, and coordination requirements with the MHC app.
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/spezistudy-update

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 and usage tips.

@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

🧹 Nitpick comments (1)
Sources/MHCStudyDefinitionExporter/Study.swift (1)

45-51: ⚡ Quick win

Localization fallback for UK (en-GB) users
SpeziLocalization falls back across English region variants, so UK users should still receive the shared English copy even though title, shortTitle, and shortExplanationText are keyed only by .enUS (in Sources/MHCStudyDefinitionExporter/Study.swift:45-51). No coverage must-fix needed; using a language-neutral English key would just be a stylistic improvement.

🤖 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 45 - 51, The
localization entries for title, shortTitle, and shortExplanationText use the
region-specific key .enUS which relies on fallback behavior for UK users; change
these to the language-neutral English key (e.g., use the non-region English
localization key your localization API provides) so title, shortTitle, and
shortExplanationText are keyed by plain English rather than .enUS (update the
mappings in the Study struct where title, shortTitle, and shortExplanationText
are defined).
🤖 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 30-32: The Package.swift currently pins SpeziStudy using a
specific commit via .package(..., revision: "e11803b...") which prevents
downstream coordinated version resolution; update the SpeziStudy dependency
declaration (the .package entry for "SpeziStudy") to reference a released
version instead (use a semantic version requirement such as from: "X.Y.Z" or
.exact("X.Y.Z") / .upToNextMajor(from: "X.Y.Z") matching your coordinated
release) so SwiftPM can resolve versions correctly for consumers.

---

Nitpick comments:
In `@Sources/MHCStudyDefinitionExporter/Study.swift`:
- Around line 45-51: The localization entries for title, shortTitle, and
shortExplanationText use the region-specific key .enUS which relies on fallback
behavior for UK users; change these to the language-neutral English key (e.g.,
use the non-region English localization key your localization API provides) so
title, shortTitle, and shortExplanationText are keyed by plain English rather
than .enUS (update the mappings in the Study struct where title, shortTitle, and
shortExplanationText are defined).
🪄 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

Run ID: f19cb429-556d-492c-861c-b1999db8bdd3

📥 Commits

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

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

Comment thread Package.swift
Comment on lines +30 to +32
.package(url: "https://github.com/StanfordSpezi/SpeziStudy.git", revision: "e11803b1897930da7c374085606814e82622bdf3"),
.package(url: "https://github.com/StanfordSpezi/SpeziFoundation.git", from: "2.7.7"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.6.2")

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 | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does Swift Package Manager allow a package that is itself published/tagged for versioned consumption to depend on another package via .revision(...), or are revision-based requirements only supported in the root package?

💡 Result:

Yes—any package’s manifest can express a revision-based dependency, not only the root package. In SwiftPM, a dependency requirement can be a Git revision via .revision(_:) (or by using package(url:revision:)). This is encoded in the package’s Package.Dependency.Requirement API and is used when resolving remote dependencies, regardless of whether that manifest belongs to the root package or a dependency in the graph. [1][2][3] Important nuance: if your published/tagged package uses commit-based requirements (including .revision), it cannot be depended upon by packages that use version-based dependency requirements (so you may need to avoid commit-based requirements when you intend others to use version constraints against your package). [1][2] Example from the manifest API: dependencies: [ .package(url: "https://example.com/example-package.git", revision: "<40-char-commit-hash>") ] [1][3]

Citations:


Avoid pinning SpeziStudy with .revision(...) if you’re tagging a coordinated release—prefer the released tag/exact version instead.

SwiftPM allows revision-based dependency requirements in any package manifest, so this won’t inherently prevent versioned consumers from resolving your package. Still, pinning SpeziStudy to a specific commit (as in Package.swift:30-32) removes downstream flexibility to use SpeziStudy version constraints for coordinated updates; using a released tag/exact version is safer for release hygiene.

🤖 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 30 - 32, The Package.swift currently pins
SpeziStudy using a specific commit via .package(..., revision: "e11803b...")
which prevents downstream coordinated version resolution; update the SpeziStudy
dependency declaration (the .package entry for "SpeziStudy") to reference a
released version instead (use a semantic version requirement such as from:
"X.Y.Z" or .exact("X.Y.Z") / .upToNextMajor(from: "X.Y.Z") matching your
coordinated release) so SwiftPM can resolve versions correctly for consumers.

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/StanfordSpezi/SpeziStudy.git", revision: "e11803b1897930da7c374085606814e82622bdf3"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TODO to add a tagged version here.

@PSchmiedmayer

Copy link
Copy Markdown
Collaborator

@lukaskollmer I no longer have owner permissions for the @StanfordBDHG org to either move this repo as planned or add the self-hosted runners temporarily to the org to merge the PR; sorry for the delay here! I will let you know once I get any updates.

@lukaskollmer

Copy link
Copy Markdown
Collaborator Author

superseded by #35

@github-project-automation github-project-automation Bot moved this from In Progress to Done in MyHeart Counts Project Planning Jun 25, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in MyHeart Counts Project Planning Jun 25, 2026
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.

2 participants