Skip to content

Update integration test CloudKit record type to "Note"#373

Merged
leogdion merged 1 commit into
v1.0.0-beta.2from
claude/zealous-lovelace-VnPSo
May 21, 2026
Merged

Update integration test CloudKit record type to "Note"#373
leogdion merged 1 commit into
v1.0.0-beta.2from
claude/zealous-lovelace-VnPSo

Conversation

@leogdion
Copy link
Copy Markdown
Member

Summary

Updates the CloudKit record type used in integration tests from a generic test identifier to the standard "Note" record type.

Changes

  • Changed IntegrationTestData.recordType from "MistKitIntegrationTest" to "Note" in Examples/MistDemo/Sources/MistDemoKit/Integration/IntegrationTestData.swift

Details

This change aligns the integration test data with a more realistic CloudKit schema by using the standard "Note" record type instead of a custom test-specific identifier. This allows integration tests to work with actual CloudKit record types and better reflects real-world usage patterns in the MistDemo application.

https://claude.ai/code/session_01EvLrWZwcSs1MjiCrUx8KjU

The live MistDemo integration tests targeted a CloudKit record type
"MistKitIntegrationTest" that is not defined in the container schema,
causing CI failures. The deployed schema only defines a Note record type
with title/index/image fields, which the phases already populate.

https://claude.ai/code/session_01EvLrWZwcSs1MjiCrUx8KjU
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d3bd85ca-b914-4ea5-a731-57f62b62a9ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/zealous-lovelace-VnPSo

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.

@leogdion leogdion marked this pull request as ready for review May 21, 2026 19:34
@leogdion leogdion merged commit 4d142af into v1.0.0-beta.2 May 21, 2026
66 of 68 checks passed
@leogdion leogdion deleted the claude/zealous-lovelace-VnPSo branch May 21, 2026 19:34
@claude
Copy link
Copy Markdown

claude Bot commented May 21, 2026

Code Review

Summary

This is a minimal, targeted fix: "MistKitIntegrationTest" was used as the CloudKit record type, but Examples/MistDemo/schema.ckdb only defines RECORD TYPE Note. CloudKit rejects operations against undefined record types, which explains the CI failures described in the commit message. The fix is correct.


What's Good

  • Single-responsibility change — one line, no collateral edits.
  • Schema alignmentNote has title (STRING), index (INT64), and image (ASSET) in schema.ckdb, which is exactly what CreateRecordsPhase writes. All field references remain valid.
  • Safe cleanupCleanupPhase only deletes records by the exact names the test created (mistkit-test-<uuid>), not all Note records. No risk of accidentally deleting pre-existing data.
  • Query phase is count-agnosticQueryRecordsPhase does not assert a fixed count, so pre-existing Note records in the container won't cause spurious failures.

Concern: ModifyRecordsPhase uses forceReplace with only title

ModifyRecordsPhase (line 48–56) builds operations with operationType: .forceReplace but supplies only the title field:

RecordOperation(
    operationType: .forceReplace,
    recordType: IntegrationTestData.recordType,
    recordName: recordName,
    fields: [
        "title": .string("Updated Record \(offset + 1)")
    ]
)

In CloudKit, forceReplace replaces the entire record with only the provided fields. After this phase, the modified records will be missing index and image. This is pre-existing behavior — not introduced by this PR — but it becomes more visible now that the record type has a real schema with defined fields.

Risk: Any phase that runs after ModifyRecordsPhase and looks up one of the modified records expecting index or image to be populated could surface unexpected nil values. A quick scan shows LookupRecordsPhase doesn't assert on field values, so there's no immediate breakage. But it's worth tracking — if a field-value assertion is added in a future phase, this silent data loss will bite.

Suggestion (not a blocker): Consider switching forceReplaceforceUpdate in ModifyRecordsPhase so only the title field is patched without erasing others, or include index in the update fields to keep the record consistent.


Minor

The PR description says the change is "to use a more realistic CloudKit schema." The commit message is more precise: the old record type caused CI failures because it was never defined in the deployed schema. Prefer the commit message framing for accuracy.


Verdict

Approve with the one pre-existing concern noted above. The fix is correct, the change is minimal, and the Note schema is the right target type. The forceReplace/partial-field issue in ModifyRecordsPhase is worth a follow-up but should not block this PR.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v1.0.0-beta.2@4ccdee2). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             v1.0.0-beta.2     #373   +/-   ##
================================================
  Coverage                 ?   66.94%           
================================================
  Files                    ?      132           
  Lines                    ?     2971           
  Branches                 ?        0           
================================================
  Hits                     ?     1989           
  Misses                   ?      982           
  Partials                 ?        0           
Flag Coverage Δ
mistdemo-spm-macos 11.54% <ø> (?)
mistdemo-swift-6.2-jammy 11.54% <ø> (?)
mistdemo-swift-6.2-noble 11.54% <ø> (?)
mistdemo-swift-6.3-jammy 11.54% <ø> (?)
mistdemo-swift-6.3-noble 11.54% <ø> (?)
spm 68.10% <ø> (?)
swift-6.1-jammy 68.00% <ø> (?)
swift-6.1-noble 68.14% <ø> (?)
swift-6.2-jammy 68.00% <ø> (?)
swift-6.2-noble 68.03% <ø> (?)
swift-6.3-jammy 67.92% <ø> (?)
swift-6.3-noble 67.96% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants