Add documented request options to query/modify/changes (#383 #384 #385)#412
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: 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1.0.0-beta.3 #412 +/- ##
=================================================
+ Coverage 73.85% 74.93% +1.08%
=================================================
Files 156 158 +2
Lines 3698 3727 +29
=================================================
+ Hits 2731 2793 +62
+ Misses 967 934 -33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code ReviewSummary: Adds the documented-but-missing request-body options across three endpoints ( Strengths
Observations / Potential Issues
The doc says "limit the fields returned in the modify response." This could be misread as filtering which fields are written. Suggest sharpening the wording to: "Limits the record fields returned in the modify response (does not affect which fields are saved)."
Using Test: _ = try? await service.queryRecords(…, zoneWide: true, …)The Missing coverage: The tests verify that File organizationThe Overall: Clean feature addition, well within the codebase's conventions. The zoneID interaction and desiredKeys doc wording are the only items worth a follow-up. LGTM with those addressed. |
#385) Epic #409. Adds the documented-but-missing request-body options across three record endpoints (openapi.yaml + regenerated MistKitOpenAPI) and surfaces them through CloudKitService: - records/query (#383): zoneWide, numbersAsStrings → queryRecords(_:…) - records/modify (#384): zoneID, desiredKeys, numbersAsStrings → modifyRecords(_:…) - records/changes (#385): desiredKeys, desiredRecordTypes → fetchRecordChanges / fetchAllRecordChanges All new parameters are optional (default nil) so existing call sites are unchanged; nil omits the field and preserves CloudKit's default behavior. Added CloudKitServiceTests.RequestOptions asserting each option serializes into the request body via the recording MockTransport. To stay under the 225-line file_length warning, split the two deprecated queryRecords overloads into CloudKitService+Operations+Deprecated.swift and the create/update/delete convenience wrappers into CloudKitService+RecordWriteConvenience.swift (pure moves, consistent with the existing focused-extension layout). Out of scope (flagged in #385): live-response confirmation of RecordResponse pluginFields/zoneID and AssetUploadResponse wrappingKey. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e924ce0 to
1e41177
Compare
ReviewReviewed the diff ( OverallClean, well-scoped addition. All new parameters ( The generated Minor observations (non-blocking)
Security / correctnessNo injection or unsafe-serialization concerns — all new values flow through the generated Note: I wasn't able to execute |
Wire the documented request options (#383/#384/#385) through the demo so they can be exercised end-to-end: - query: add --zone-wide / --numbers-as-strings and pass --fields as desiredKeys; migrate QueryCommand off the deprecated queryRecords(recordType:...) overload to the Query primitive (the only one that exposes zoneWide/numbersAsStrings). - modify: add --zone / --fields / --numbers-as-strings, threading zoneID, desiredKeys and numbersAsStrings into modifyRecords. - fetch-changes: add --fields / --record-types, threading desiredKeys and desiredRecordTypes into fetchRecordChanges and fetchAllRecordChanges. Add optionalBool / commaSeparatedList config readers, ConfigKeys entries, and config-parsing tests for the new options. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review: Add documented request options to query/modify/changes (#383 #384 #385)Reviewed the full diff (openapi.yaml, generated Code quality / best practices
Potential bugs / edge cases
Performance
Security
Test coverage
Nice, tightly-scoped PR. Nothing above blocks merging — the empty-string |
codecov/patch on #412 flagged Sources/MistKit gaps (Examples/ is ignored). The relocated CloudKitService+RecordWriteConvenience.swift was at 32.5% and the new Deprecated.swift's [RecordInfo] query overload was uncovered. Add MockTransport-based tests (reusing the shared Rereference fixtures): createRecord/updateRecord happy path + empty-response invalidResponse path, deleteRecord acknowledgement, and the deprecated queryRecords(recordType:database:) -> [RecordInfo] overload. Both files now report 100% line coverage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review: #412 — Request options for query/modify/changesReviewed the diff against Nice catches
Minor issues
Security / correctnessNo concerns — all new fields ( Test coverageGood: request-body serialization is directly asserted via |
Review: PR #412 — Add documented request options to query/modify/changesThis PR threads three previously-undocumented-in-code CloudKit request-body options ( Findings (most severe first):
No blocking correctness issues in the core request-serialization/openapi wiring — the two file-split refactors are byte-for-byte behavior-preserving, and openapi.yaml ↔ generated |
The MistDemo integration suites exercised query/modify/changes with the new request options left at their defaults, so the parameters added in #383/#384/#385 were only ever tested via MockTransport, never live. Add three phases that drive the options end-to-end and assert their effect where observable at the domain layer: - QueryRequestOptionsPhase (queryRecords): desiredKeys/zoneWide/numbersAsStrings; asserts desiredKeys filters returned fields. - ModifyRequestOptionsPhase (modifyRecords): zoneID/desiredKeys/numbersAsStrings; forceUpdate merge keeps `index` server-side, so desiredKeys:["title"] omitting it is the assertion. - ChangesRequestOptionsPhase (fetchRecordChanges): desiredKeys/desiredRecordTypes. CloudKit only tracks changes in custom zones, so the phase provisions its own zone, writes records, fetches the feed, asserts both options, then tears the zone down (best-effort on the failure path). Query/modify phases join both PublicDatabaseTest and PrivateDatabaseTest; the changes phase is private-only (custom zones are private/shared). zoneWide and numbersAsStrings are exercised but not asserted — CloudKit does not echo them in a distinguishable domain form. Verified live against a real container: test-public 15/15 and test-private 22/22 pass, with the changes phase fetching 2 changes and honoring both options. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review: Add documented request options to query/modify/changes (#383 #384 #385)Solid, well-scoped PR: A few things worth a look before merge:
Nothing structural — these are all worth a look but don't block the core feature addition, which is clean and well-tested for the request-serialization surface it targets. 🤖 Generated with Claude Code |
Epic #409.
Adds the documented-but-missing request-body options across three record endpoints (
openapi.yaml+ regeneratedMistKitOpenAPI) and surfaces them throughCloudKitService:zoneWide,numbersAsStrings→queryRecords(_:…)zoneID,desiredKeys,numbersAsStrings→modifyRecords(_:…)desiredKeys,desiredRecordTypes→fetchRecordChanges/fetchAllRecordChangesAll new parameters are optional (default
nil) → existing call sites unchanged;nilomits the field and preserves CloudKit's default behavior.Added
CloudKitServiceTests.RequestOptionsasserting each option serializes into the request body via the recordingMockTransport. To stay under the 225-linefile_lengthwarning, split the deprecatedqueryRecordsoverloads intoCloudKitService+Operations+Deprecated.swiftand the create/update/delete wrappers intoCloudKitService+RecordWriteConvenience.swift(pure moves).Out of scope (flagged in #385): live-response confirmation of
RecordResponsepluginFields/zoneIDandAssetUploadResponsewrappingKey.Closes #383, closes #384, closes #385.
Verification
swift build, fullswift test(541 pass), swift-format + swiftlint--strictclean. Request-body serialization unit-tested; live round-trip of zoneWide/numbersAsStrings deferred.