Improve Warnings and Handle Old API#17
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 is a broad warnings/compatibility cleanup across the Spezi monorepo, including updates to DocC generation, removal of deprecated lifecycle handling in AccessGuards, refinements to UI components (CanvasView/AsyncButton), and multiple test adjustments aligned with new linting rules and APIs.
Changes:
- Adds/updates scripts + CI workflow to build DocC and reduce SwiftPM “unhandled file” warnings by conditionally excluding DocC catalogs in regular builds.
- Updates UI components and APIs (e.g., AccessGuards lifecycle via notifications, CanvasView tool picker synchronization, AsyncButton debounce logic) and expands UI test coverage for debounce behavior.
- Sweeps tests and DocC docs to address warnings (string→Data conversions, task result ignoring, DocC symbol/link fixes), and updates dependency pin for PhoneNumberKit.
Reviewed changes
Copilot reviewed 135 out of 142 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/SpeziViewsTests/UITests/TestAppUITests/SpeziViews/ViewsTests.swift | Adds UI test for AsyncButton debounce and minor formatting cleanups. |
| Tests/SpeziViewsTests/UITests/TestApp/ViewsTests/SpeziViewsTests.swift | Registers new “Async Button Debounce” test view in the test app menu. |
| Tests/SpeziViewsTests/UITests/TestApp/ViewsTests/ButtonTestView.swift | Adds AsyncButtonDebounceTestView fixture for UI testing debounce behavior. |
| Tests/SpeziTests/ModuleTests/ModuleTests.swift | Adjusts preview confirmation usage to avoid unwrap/require patterns. |
| Tests/SpeziTests/CapabilityTests/NotificationsTests.swift | Uses non-optional Data initializer for test device token. |
| Tests/SpeziStudyTests/StudyManagerTests.swift | Adds SwiftLint suppressions and whitespace-only cleanups in long tests. |
| Tests/SpeziStudyTests/StudyDefinitionTests.swift | Uses non-optional Data initializer for JSON fixture input. |
| Tests/SpeziStorageTests/LocalStorageTests.swift | Replaces XCTSpezi import with SpeziTesting. |
| Tests/SpeziSchedulerUITests/SchedulerSampleDataTests.swift | Updates dependency-resolution helper usage; adjusts imports. |
| Tests/SpeziSchedulerTests/Utils/ExampleTaskKey.swift | Adds imports required by updated test utilities. |
| Tests/SpeziSchedulerTests/ScheduleTests.swift | Removes unused XCTSpezi import. |
| Tests/SpeziSchedulerTests/SchedulerTests.swift | Formatting cleanup and string→Data fixture conversions. |
| Tests/SpeziNotificationsTests/SpeziNotificationTests.swift | Uses non-optional Data initializer for test device token. |
| Tests/SpeziLLMTests/OpenAIInferenceTests/LLMOpenAIMockedInferenceTests+Setup.swift | Adds explicit UTF-8 encoding validation helper for mocked responses. |
| Tests/SpeziLLMTests/LLMOpenAIFunctionCallingParameterDSLTests+OptionalTypes.swift | Switches modelType from string literal to typed enum (.gpt4o). |
| Tests/SpeziLLMTests/LLMOpenAIFunctionCallingParameterDSLTests+InvalidParameters.swift | Switches modelType from string literal to typed enum (.gpt4o). |
| Tests/SpeziLLMTests/LLMOpenAIFunctionCallingParameterDSLTests+Enum.swift | Switches modelType from string literal to typed enum (.gpt4o). |
| Tests/SpeziLLMTests/LLMOpenAIFunctionCallingParameterDSLTests+Dictionary.swift | Switches modelType from string literal to typed enum (.gpt4o). |
| Tests/SpeziLLMTests/LLMOpenAIFunctionCallingParameterDSLTests+CustomTypes.swift | Switches modelType from string literal to typed enum (.gpt4o). |
| Tests/SpeziLLMTests/LLMOpenAIFunctionCallingParameterDSLTests+Array.swift | Switches modelType from string literal to typed enum (.gpt4o). |
| Tests/SpeziLLMTests/LLMOpenAIFunctionCallingParameterDSLTests.swift | Switches modelType from string literal to typed enum (.gpt4o). |
| Tests/SpeziLicenseTests/UITests/UITests.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | Updates PhoneNumberKit pin and repo location. |
| Tests/SpeziHealthKitTests/HKUnitTests.swift | Adjusts unit parsing expectations for “cal”. |
| Tests/SpeziFoundationTests/RWLockTests.swift | Assigns detached task results to _ to silence warnings. |
| Tests/SpeziFoundationTests/AnyAsyncSequenceTests.swift | Assigns spawned task result to _ to silence warnings. |
| Tests/SpeziFHIRTests/FHIRAttachment/TextContentExtractorTests.swift | Uses non-optional Data initializer for test content. |
| Tests/SpeziAccessGuardTests/SpeziAccessGuardTests.swift | Adds iOS test verifying AccessGuards observes UIScene notifications. |
| Tests/HealthKitOnFHIRTests/TimeZoneTests.swift | Removes unused timezone offset string computation in tests. |
| Tests/ByteCodingTests/ByteCodableTests.swift | Uses non-optional Data initializer for string fixtures. |
| Sources/XCTSpeziNotifications/XCTSpeziNotifications.docc/XCTSpeziNotifications.md | Fixes DocC symbol paths for XCUIAutomation API and signature changes. |
| Sources/XCTSpeziAccount/XCTSpeziAccount.docc/XCTSpeziAccount.md | Fixes DocC symbol paths for XCUIAutomation API. |
| Sources/XCTRuntimeAssertions/XCTRuntimeAssertions.docc/XCTRuntimeAssertions.md | Updates DocC symbol links (but currently has a duplicated entry). |
| Sources/XCTHealthKit/XCTHealthKitAddSampleInput.swift | Improves parameter documentation. |
| Sources/XCTHealthKit/XCTest+HealthRecord.swift | Updates parameter docs for multiple accounts. |
| Sources/SpeziViews/Views/Text/MarkdownView+ImageProviders.swift | Adds nonisolated init for nested view to address isolation warnings. |
| Sources/SpeziViews/Views/Text/MarkdownView.swift | Refactors initializers to avoid default generic closure warnings; adds EmptyView overloads. |
| Sources/SpeziViews/Views/Sharing/ShareSheetInput.swift | Removes invalid/obsolete DocC initializer reference. |
| Sources/SpeziViews/Views/Drawing/CanvasView.swift | Adds tool picker synchronization control and updates tool-selection handling for newer APIs. |
| Sources/SpeziViews/Views/Button/AsyncButton.swift | Replaces TaskGroup debounce logic with explicit debounce Task lifecycle handling. |
| Sources/SpeziViews/SpeziViews.docc/SpeziViews.md | Removes/adjusts outdated DocC topic entries. |
| Sources/SpeziValidation/Views/VerifiableTextField.swift | Removes default footer closure to avoid warnings; adds EmptyView overload initializers. |
| Sources/SpeziStudyDefinition/StudyDefinition.swift | Updates DocC reference for validate API. |
| Sources/SpeziStudyDefinition/StudyBundle/Validation/StudyBundle+QuestionnaireValidation.swift | Makes dynamicMember subscripts public for DocC/API visibility. |
| Sources/SpeziStudyDefinition/StudyBundle/StudyBundle+FileReference.swift | Updates DocC reference for resolve API signature. |
| Sources/SpeziStudyDefinition/StudyBundle/StudyBundle.swift | Updates DocC topic list for renamed APIs/types. |
| Sources/SpeziStudy/Study Manager/StudyManager+Other.swift | Adds missing import for updated dependencies. |
| Sources/SpeziStudy/Study Manager/StudyManager.swift | Silences unused Task warning and clarifies capture semantics. |
| Sources/SpeziSensorKit/SpeziSensorKit.docc/SpeziSensorKit.md | Updates DocC links for anchored fetching API signature changes. |
| Sources/SpeziSensorKit/SensorKit.swift | Updates DocC links for anchored fetching and anchor reset APIs. |
| Sources/SpeziSensorKit/Sensor/AnySensor+Operations.swift | Removes unnecessary nonisolated(unsafe) shadowing. |
| Sources/SpeziSensorKit/Sensor Reader/AnchoredFetcher+TimeIntervalFetching.swift | Removes nonisolated(unsafe) on stored SRDevice property. |
| Sources/SpeziSensorKit/Sensor Reader/AnchoredFetcher.swift | Removes nonisolated(unsafe) usages around SRDevice iteration. |
| Sources/SpeziScheduler/UserInfo/UserStorageCoding.swift | Updates DocC macro reference for Property storage identifier. |
| Sources/SpeziScheduler/Task/Task.swift | Updates DocC references and removes outdated parameter doc. |
| Sources/SpeziScheduler/Task/Outcome.swift | Updates DocC macro reference for Property storage identifier. |
| Sources/SpeziScheduler/SpeziScheduler.docc/SpeziScheduler.md | Updates DocC links for createOrUpdateTask signature and task id symbol. |
| Sources/SpeziScheduler/Scheduler.swift | Updates DocC links for createOrUpdateTask signature. |
| Sources/SpeziPersonalInfo/Fields/NameFieldRow.swift | Simplifies macOS prompt-label selection logic using a static flag. |
| Sources/SpeziNumerics/MedFloatImpl.swift | Fixes inline DocC formatting for Double. |
| Sources/SpeziLocalStorage/SpeziLocalStorage.docc/SpeziLocalStorage.md | Updates DocC links to renamed LocalStorage APIs. |
| Sources/SpeziLocalStorage/LocalStorageKey.swift | Updates RWLock API usage and DocC symbol suffix reference. |
| Sources/SpeziLocalStorage/LocalStorage.swift | Adds missing parameter docs for encoding/decoding configuration. |
| Sources/SpeziLicense/Views/ContributionsList.swift | Adds parameter documentation for project URL. |
| Sources/SpeziKeychainStorage/KeychainStorage.swift | Removes outdated DocC topic entries. |
| Sources/SpeziKeychainStorage/Credentials/Credentials.swift | Improves UTF-8 decoding safety and removes outdated DocC topic entries. |
| Sources/SpeziHealthKitBulkExport/SpeziHealthKitBulkExport.docc/BulkHealthExporter.md | Updates DocC links for start API signature. |
| Sources/SpeziHealthKitBulkExport/BulkExportSession.swift | Updates DocC topic list for start API signature. |
| Sources/SpeziHealthKit/Sample Types/SampleType.swift | Removes redundant parameter docs. |
| Sources/SpeziHealthKit/Sample Types/AnySampleType.swift | Removes outdated DocC topics/operators. |
| Sources/SpeziHealthKit/Queries/HealthKitStatisticsQuery.swift | Updates DocC references for continuousStatisticsQuery signature. |
| Sources/SpeziHealthKit/HealthKit.swift | Updates DocC topic list for addHealthDataCollector overload naming. |
| Sources/SpeziHealthKit/HealthKit Extensions/HKHealthStore+BackgroundDelivery.swift | Assigns Task result to _ to silence warnings. |
| Sources/SpeziHealthKit/Health Data Collection/HealthDataCollector.swift | Updates DocC references for collector registration APIs. |
| Sources/SpeziFoundation/Misc/Version.swift | Updates doc note to avoid broken symbol link. |
| Sources/SpeziFoundation/LocalPreferences/LocalPreference.swift | Adjusts Observation integration for view-update tracking. |
| Sources/SpeziFirestore/SpeziFirestore.docc/SpeziFirestore.md | Updates DocC links for Firestore setData isolation parameters. |
| Sources/SpeziFHIRHealthKit/FHIRStore+HealthKit.swift | Fixes parameter naming in docs. |
| Sources/SpeziFHIR/FHIRStore.swift | Fixes parameter naming in docs. |
| Sources/SpeziFHIR/FHIRResource/FHIRResource+StringifyAttachment.swift | Fixes spelling/clarity in documentation comment. |
| Sources/SpeziFHIR/FHIRResource/FHIRResource.swift | Refactors JSON stringify to avoid decoding pitfalls. |
| Sources/SpeziDevices/Testing/MockDevice.swift | Assigns Task result to _ to silence warnings. |
| Sources/SpeziDevices/SpeziDevices.docc/SpeziDevices.md | Updates DocC link to renamed HealthKit integration article. |
| Sources/SpeziDevices/SpeziDevices.docc/HealthKit Integration.md | Renames article title to match new link target. |
| Sources/SpeziDevices/Model/PairedDeviceInfo.swift | Adds parameter documentation for variantIdentifier. |
| Sources/SpeziContact/Models/ContactOption.swift | Changes import style for MessageUI (currently unused). |
| Sources/SpeziContact/Contact Views/ContactView.swift | Changes import style for MessageUI (currently unused). |
| Sources/SpeziContact/Contact Views/ContactsList.swift | Fixes parameter name in docs (contact → contacts). |
| Sources/SpeziConsent/Model/ConsentDocument+ExportConfiguration.swift | Refines PaperSize documentation text. |
| Sources/SpeziConsent/Model/ConsentDocument.swift | Updates DocC topics to reflect initializer API surface. |
| Sources/SpeziChat/MessageInputView.swift | Adds catch block to treat speech failures as stopped recording. |
| Sources/SpeziBluetooth/CoreBluetooth/Model/CharacteristicAccesses.swift | Updates generic helper signature and call sites for Void inference. |
| Sources/SpeziBluetooth/CoreBluetooth/Model/BluetoothManagerStorage.swift | Adjusts Task capture list for actor isolation warnings. |
| Sources/SpeziBluetooth/AccessorySetupKit/ASAccessoryEventType+Description.swift | Adds description for new AccessorySetupKit event type. |
| Sources/SpeziBluetooth/AccessorySetupKit/AccessorySetupKit.swift | Handles .accessoryDiscovered by mutating accessories observation key. |
| Sources/SpeziAccountPhoneNumbers/SpeziAccountPhoneNumbers.docc/SpeziAccountPhoneNumbers.md | Updates PhoneNumberKit link and refines topics list. |
| Sources/SpeziAccountPhoneNumbers/PhoneVerificationConstraint.swift | Clarifies parameter docs for verification APIs. |
| Sources/SpeziAccountPhoneNumbers/DataEntry/OTCEntryView.swift | Adds missing Combine import. |
| Sources/SpeziAccount/Views/PasswordResetView.swift | Assigns Task result to _ to silence warnings. |
| Sources/SpeziAccount/Views/DataEntry/GeneralizedDataEntryView.swift | Adds missing SpeziFoundation import. |
| Sources/SpeziAccount/Views/AccountSetup/AccountSetupState.swift | Fixes DocC link formatting for initializer name. |
| Sources/SpeziAccount/ViewModifier/RequiredValidationModifier.swift | Adds missing SpeziFoundation import. |
| Sources/SpeziAccount/SpeziAccount.docc/Setup Guides/Initial Setup.md | Fixes DocC link to correct supports(_:file:line:) symbol. |
| Sources/SpeziAccount/SpeziAccount.docc/AccountKey/Adding new Account Values.md | Updates macro documentation and topic listing. |
| Sources/SpeziAccount/Mock/InMemoryAccountStorageProvider.swift | Assigns Task result to _ to silence warnings. |
| Sources/SpeziAccount/Mock/InMemoryAccountService.swift | Adds nonisolated init for ViewModifier and silences unused Task result warnings. |
| Sources/SpeziAccount/AccountOverview.swift | Adds overload initializer to avoid default generic builder warnings; updates docs. |
| Sources/SpeziAccessGuard/AccessGuards.swift | Moves from deprecated lifecycle hooks to UIScene notifications; adds observer management. |
| Sources/Spezi/Spezi/SpeziPropertyWrapper.swift | Updates existential any usage for retrieveProperties(ofType:). |
| Sources/Spezi/Spezi/Spezi.swift | Marks storage as @ObservationIgnored nonisolated(unsafe) and updates comment. |
| Sources/Spezi/Spezi.docc/Spezi.md | Switches DocC image references to asset names (DocC catalog handling). |
| Sources/Spezi/Spezi.docc/Resources/Validation.png.license | Adds REUSE license sidecar for DocC resource. |
| Sources/Spezi/Spezi.docc/Resources/QuestionnaireOverview.png.license | Adds REUSE license sidecar for DocC resource. |
| Sources/Spezi/Spezi.docc/Resources/PairedDevices.png.license | Adds REUSE license sidecar for DocC resource. |
| Sources/Spezi/Spezi.docc/Resources/Consent1.png.license | Adds REUSE license sidecar for DocC resource. |
| Sources/Spezi/Spezi.docc/Resources/ChatView.png.license | Adds REUSE license sidecar for DocC resource. |
| Sources/Spezi/Spezi.docc/Resources/AccountSetup.png.license | Adds REUSE license sidecar for DocC resource. |
| Sources/Spezi/Spezi.docc/Interactions with Application.md | Removes outdated DocC article. |
| Sources/Spezi/Spezi.docc/Initial Setup.md | Minor wording modernization in docs. |
| Sources/RuntimeAssertionsTesting/RuntimeAssertionsTesting.docc/RuntimeAssertionsTesting.md | Updates DocC symbol links for testing APIs. |
| Sources/HealthKitOnFHIR/HKSampleMapping/HKStateOfMindSampleMapping.swift | Adds missing initializer parameter docs. |
| Sources/HealthKitOnFHIR/HealthKitOnFHIR.docc/HealthKitOnFHIR.md | Updates DocC topics for consolidated FHIRModelsExtensions. |
| Sources/HealthKitOnFHIR/HealthKit Extensions/HKSample+ResourceProxy.swift | Updates DocC links and important-note references to new signatures. |
| Sources/HealthKitOnFHIR/HealthKit Extensions/HKElectrocardiogram+Observation.swift | Updates Doc comment for FHIRExtensionBuilder reference formatting. |
| Sources/HealthKitOnFHIR/HealthKit Extensions/HKCategoryValue+Coding.swift | Moves protocol declaration for better file organization; whitespace cleanup. |
| Sources/FHIRModelsExtensions/Questionnaire+Extensions+UI.swift | Tightens UIKit availability conditions and guards UIKeyboardType import. |
| Sources/FHIRModelsExtensions/FHIR Extension Builder/FHIRExtensionBuilder+AbsoluteTimeRange.swift | Fixes doc spelling/clarity around errors and effective time. |
| Sources/ByteCodingTesting/ByteCodingTesting.docc/ByteCodingTesting.md | Updates DocC symbol links for testIdentity signature changes. |
| Scripts/run-package-tests.sh | Sets SPEZI_EXCLUDE_DOCC_CATALOGS to reduce SwiftPM DocC warnings in tests. |
| Scripts/cleanup-generated-artifacts.sh | Cleans DocC build output folders in CI. |
| Scripts/check-package-traits.py | Sets SPEZI_EXCLUDE_DOCC_CATALOGS by default for SwiftPM checks. |
| Scripts/build-documentation.sh | Adds DocC build/merge/scripted warning-gating workflow for CI. |
| REUSE.toml | Adds .spi.yml to REUSE annotations list. |
| Package.swift | Adds reusable exclude helpers; conditional DocC catalog exclusion; updates PhoneNumberKit dependency; refactors per-target excludes. |
| .swiftlint.yml | Updates rule list and excludes to include new rules and paths. |
| .spi.yml | Adds documentation target list used by DocC build script. |
| .github/workflows/static-analysis.yml | Adds Documentation job running DocC build script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
86a59a9 to
fe3cf9d
Compare
lukaskollmer
left a comment
There was a problem hiding this comment.
looks good; thanks for tackling this @PSchmiedmayer 🚀
| EmptyView() | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
probably shouldn't happen as part of this PR but we should use the current monorepo situation as an opportunity to remove a bunch of deprecated things, now that we can do source-breaking changes as we're still on 0.x
…Docs # Conflicts: # Scripts/cleanup-generated-artifacts.sh # Sources/XCTSpeziNotifications/XCTSpeziNotifications.docc/XCTSpeziNotifications.md # Tests/SpeziNotificationsTests/SpeziNotificationTests.swift
| // Work around https://github.com/swiftlang/swift/issues/81962 by keeping the backing storage out of macro expansion | ||
| // while explicitly preserving observation tracking. |
There was a problem hiding this comment.
tbh IMO having the incorrect warning is an acceptable trade-off for not having to do the observation-tracking manually (more error-prone going forward, simply bc it's code we need to maintain by hand, instead of it being generated for us by the macro), but we can keep it this way if you prefer.
### ♻️ Current situation & Problem @PSchmiedmayer had a stab at various package-wide improvements and fixes in #17, such as addressing warnings, deprecations, etc. this work also partly overlaps with some things addressed in #5 (which probably will end up getting superseded by this PR). this PR picks up these adjustments (which initially were developed against #16), and carries them over into the current #20-based main branch state of the codebase. somewhat complete list of changes: - most of what was covered by #17 - address compiler warnings where possible - address deprecation warnings where possible - note that this PR intentionally does **not** address the firebase `updateEmail(to:)` deprecation, as there currently are some issues around the behaviour of the new API. see also #14 - some testing fixes that were left out of #20 - now that the package's effective availability is iOS 18+, we can remove a bunch of `if #available(iOS 18, *)` checks from all over the codebase - *todo* ### ⚙️ Release Notes *todo* ### 📚 Documentation *todo* ### ✅ Testing *todo* ### Code of Conduct & Contributing Guidelines By creating and submitting this pull request, you agree to follow our [Code of Conduct](https://github.com/SchmiedmayerLab/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/SchmiedmayerLab/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/SchmiedmayerLab/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/SchmiedmayerLab/.github/blob/main/CONTRIBUTING.md).
Improve Warnings and Handle Old API
♻️ Current situation & Problem
This follow-up keeps the warning and documentation cleanup separate from the main old deployment target branch while preserving a clear diff against oldiOSVersion.
It addresses remaining SwiftLint, build, and documentation warning sources around package configuration, DocC catalog handling, deprecated scene lifecycle APIs, and warning-focused test coverage.
⚙️ Release Notes
📚 Documentation
Updates documentation build handling for DocC catalog warnings and fixes a DocC link in SpeziAccountPhoneNumbers. No new public setup flow is required.
✅ Testing
Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: