Docs: error handling, configuration, records, and limits articles#362
Docs: error handling, configuration, records, and limits articles#362leogdion wants to merge 2 commits into
Conversation
#334) Resolves the two open sub-issues under #359. #159 — Every import in Sources/MistKit, Tests, and the three Examples packages (MistDemo, BushelCloud, CelestraCloud) now carries an explicit access modifier. Default is `internal import`; pre-existing `public import` lines (for modules whose types appear in public API signatures) are preserved. `@testable import` is untouched. Sources/MistKitOpenAPI is generated and excluded; its one remaining bare `import HTTPTypes` is tracked in follow-up #360. #334 — Adds `TestPlatform.isFlakyTimeoutSimulator` (visionOS / watchOS simulator AND `CI` env) and a `withKnownIssue(when:isIntermittent:_:)` overload. The six previously-blanket `withKnownIssue(isIntermittent: true)` gates in the withTimeout / withTimeoutAndSignals tests now pass `when: TestPlatform.isFlakyTimeoutSimulator`, so the intermittent allowance applies only on the flaky CI sim runs while every other platform (macOS host, Linux, iOS device, local sim runs) asserts strictly and surfaces real regressions. CLAUDE.md gains an "Import Conventions" section documenting the new rule and the MistKitOpenAPI carve-out. Verified: swift build + swift test green at repo root and each Examples package (454 + 930 + 220 + 115 tests); mise exec -- swiftlint clean; Scripts/lint.sh (build + lint + headers + periphery) clean. Closes #159 Closes #334 Closes #359 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 modifyRecords, createRecord, updateRecord, deleteRecord (CloudKitService+WriteOperations.swift) and lookupRecords (CloudKitService+LookupOperations.swift) to match the existing example style on queryRecords. 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.1 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 skippedToo many files! This PR contains 300 files, which is 150 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (300)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1.0.0-beta.2 #362 +/- ##
================================================
Coverage ? 68.91%
================================================
Files ? 111
Lines ? 2641
Branches ? 0
================================================
Hits ? 1820
Misses ? 821
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:
|
Code Review — PR #362: Docs: error handling, configuration, records, and limits articlesOverall the four articles are well-structured, accurate in the majority of their content, and meaningfully close the gaps from #361. The inline 🔴 Critical1. Broken DocC symbol link —
|
| # | File | Issue |
|---|---|---|
| 1 | WorkingWithRecords.md:142,177 |
Fix DocC link to fetchAllRecordChanges(zoneID:syncToken:resultsLimit:maxPages:database:) |
| 2 | HandlingErrors.md:52-60 |
Fix or remove the unreachable catch let error as TokenManagerError example |
| 3 | HandlingErrors.md:141 |
Initialize lastError before use so the snippet compiles |
🤖 Generated with Claude Code
|
Superseded by #364, which keeps CloudKitService+WriteOperations.swift under the file_length cap. |
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 tomodifyRecords,createRecord,updateRecord,deleteRecord(CloudKitService+WriteOperations.swift) andlookupRecords(CloudKitService+LookupOperations.swift) to match the existing example style onqueryRecords.Updates
Documentation.mdTopics:<doc:HandlingErrors>under Getting Started / Error Handling.### Error Handlinggroup covering the typed error and reason enums.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.Test plan
swift build— DocC catalog parses, articles compileswift test— 454 tests pass; no regressions from inline doc edits./Scripts/lint.sh— swift-format, swiftlint (0 violations across 300 files), periphery (no unused code) all clean<doc:>cross-links andTypereferences resolveCloses #115
Closes #116
Closes #160
🤖 Generated with Claude Code