Docs: error handling, configuration, records, and limits articles#364
Conversation
Adds four DocC articles to close out the open documentation gaps tracked by parent issue #361: - HandlingErrors.md — three-layer error model (construction, token, request) with retry/recovery guidance. - ConfiguringMistKit.md — container/environment/transport/logging inputs; defers credential construction to AuthenticationAndDatabases. - WorkingWithRecords.md — CRUD, batch, lookup, and sync-via-token walks. - CloudKitLimitsAndPerformance.md — pagination guard, batch sizing, asset upload transport split, rate limits. Also adds inline `# Example` blocks to createRecord, updateRecord (CloudKitService+WriteOperations.swift) and lookupRecords (CloudKitService+LookupOperations.swift) to match the existing example style on queryRecords. modifyRecords and deleteRecord examples live in the WorkingWithRecords article rather than inline to keep the write- operations file under the file_length cap. Updates Documentation.md Topics to surface the new articles and adds an Error Handling group covering the typed error and reason enums. Migration guide (mentioned in #160) is deferred — MistKit is at 1.0.0-beta.x with no stable predecessor; that article should land alongside a future release transition. Closes #115 Closes #116 Closes #160 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Code Review — PR 364: Docs articles (error handling, configuration, records, limits)OverviewAdds four DocC articles (HandlingErrors.md, ConfiguringMistKit.md, WorkingWithRecords.md, CloudKitLimitsAndPerformance.md) plus inline examples on createRecord, updateRecord, lookupRecords. Closes #115, #116, #160. Strengths
Issues Found1. Incorrect DocC symbol path for fetchAllRecordChanges (WorkingWithRecords.md) In the Topics section of WorkingWithRecords.md, the link is: But the actual method signature (CloudKitService+SyncOperations.swift:156) is: public func fetchAllRecordChanges(
zoneID: ZoneID? = nil,
syncToken: String? = nil,
resultsLimit: Int? = nil,
maxPages: Int = 1_000,
database: Database
)The correct DocC path should be: DocC will emit an unresolved-symbol warning for the incorrect path and the link won't render. This also means the CI DocC build step (unchecked in the test plan) needs to pass before merging to catch this. 2. Two parallel PRs (#362 and #364) for the same content The description acknowledges this — one targets main, one targets v1.0.0-beta.2. Close whichever is not the intended target before merging. 3. CI DocC build step unchecked The "CI DocC build step verifies cross-links" item is unchecked. Issue #1 above will surface as a broken link in that step. Worth resolving before merging. Minor Observations
SummaryThe articles are high quality and fill real documentation gaps. One actionable fix before merging: correct the Review generated with Claude Code |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1.0.0-beta.2 #364 +/- ##
================================================
Coverage ? 69.35%
================================================
Files ? 113
Lines ? 2630
Branches ? 0
================================================
Hits ? 1824
Misses ? 806
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Adds four DocC articles to close out the open documentation gaps tracked by parent #361:
HandlingErrors.md— three-layer error model (construction, token, request) with retry/recovery guidance. CoversCloudKitError,TokenManagerError,TokenStorageError,CredentialsValidationError, and the four*Reasonenums.ConfiguringMistKit.md— container, environment, transport, and logging inputs. Explicitly defers credential construction toAuthenticationAndDatabases.mdto avoid duplication. Notes there is noMistKitConfigurationtype (issue Add comprehensive configuration documentation #116's terminology) — configuration is what you pass toCloudKitService.init.WorkingWithRecords.md— CRUD, batchedmodifyRecords, lookup, and sync-via-change-token walks.CloudKitLimitsAndPerformance.md— pagination guard (maxPages: 1_000+ stuck-marker detection), batch sizing, asset upload transport split (URLSession.sharedvs configuredClientTransport, with the 421 Misdirected Request rationale), CloudKit rate limits.Also adds inline
# Exampleblocks tocreateRecord,updateRecord(CloudKitService+WriteOperations.swift) andlookupRecords(CloudKitService+LookupOperations.swift) to match the existing example style onqueryRecords.modifyRecordsanddeleteRecordexamples live in the article rather than inline to keep the write-operations file under thefile_lengthcap.Updates
Documentation.mdTopics:<doc:HandlingErrors>under Getting Started / Error Handling.### Error Handlinggroup covering the typed error and reason enums.Base branch note
This PR targets
v1.0.0-beta.2— thev1.0.0-beta.1branch you mentioned no longer exists upstream (it was replaced byv1.0.0-beta.1-backupand the activev1.0.0-beta.2). Retarget if you want it against a different base.A parallel PR (#362) targets
mainwith the same content. Pick whichever base is right and close the other.Out of scope (deliberate)
MistKitConfigurationtype referenced in Add comprehensive configuration documentation #116 — does not exist; the new article documents the actual init-driven configuration model.type_contents_orderwarning onCloudKitService+WriteOperations.swift— already present on thev1.0.0-beta.2base; out of scope for a docs PR.Test plan
swift build— DocC catalog parses, articles compile against beta.2swift test— 449 tests pass; no regressions from inline doc edits./Scripts/lint.sh— swift-format, swiftlint, periphery clean (only pre-existingtype_contents_orderwarning remains)<doc:>cross-links andTypereferences resolveCloses #115
Closes #116
Closes #160
🤖 Generated with Claude Code