You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add swoopmist export --snapshot for the release-data snapshot - #46
Depends on SwoopKit 1.0.0-beta.2 (brightdigit/SwoopKit#3), which moved ReleaseDataSnapshot and JSONEncoder.iso8601PrettySorted into SwoopKit.
Package U.3 of Stewed's v1.0.0-beta.1 plan, part of brightdigit/Stewed#194 (drop StewedTools).
What
swoopmist export --snapshot <output.json> writes SwoopKit's ReleaseDataSnapshot, the file Stewed bundles as Resources/release-data-snapshot.json. It keeps every guarantee of StewedTools' release-data-snapshot:
Only SDKVersion, XcodeVersion and SimulatorRuntime, each through queryAllRecords, which pages.
Every record maps with from(recordInfo:). The export fails if a type is empty or any record doesn't map, and names the records that didn't.
Records are sorted by record name, fetchedAt is whole seconds, and the JSON is SwoopKit's JSONEncoder.iso8601PrettySorted plus a trailing newline.
Read-only: it only queries.
Development by default. Production needs --allow-production. That's a command-line flag only, with no SWOOP_* variable, so a leftover environment variable can't turn it on.
--output, --pretty, --signed-only and --no-betas don't apply to a snapshot, so they're refused rather than ignored.
The logic is in the library (ReleaseDataSnapshotExport, SyncEngine.exportSnapshot(fetchedAt:)), so it's tested without CloudKit. SnapshotExportCommand in the CLI only handles the configuration and the file.
with SwoopMistKit's environment loaded (CLOUDKIT_KEY_ID, CLOUDKIT_PRIVATE_KEY_PATH or CLOUDKIT_PRIVATE_KEY; CLOUDKIT_ENVIRONMENT unset or development).
Byte identity with StewedTools
Tests/SwoopMistKitTests/Fixtures/release-data-snapshot-stewedtools.json was written by StewedTools' own records() and write() code, copied verbatim into a throwaway harness built against SwoopMistKit 1.0.0-alpha.3, SwoopCloudKit 1.0.0-beta.1 and MistKit 1.0.0-beta.6, with only the CloudKit query swapped for SnapshotFixture's records. Those records come out of query order, with millisecond dates, INT64 booleans, references, a missing isPrerelease, escaped characters and sdkBuildNumbersText. The tests check:
export --snapshot's bytes equal that file exactly;
SwoopKit's encoder gives the same bytes as SwoopCloudKit 1.0.0-beta.1's encoder settings;
write(_:to:) puts the same bytes on disk.
There's no live Development comparison. No SwoopMistKit or Stewed .env with Development credentials was available locally. Production was never touched.
Already fixed: SwoopMistKitService.queryAllRecords calls MistKit 1.0.0-beta.6's queryAllRecords, which follows continuation markers. MistKit's QueryPagination tests cover that, and both export and export --snapshot use it. This PR adds a regression test showing that the snapshot export keeps all 450 records it's given for one type.
swift test: 318 tests pass against SwoopKit 1.0.0-beta.2 (Package.resolved pins it). New suites:
Release-Data Snapshot Export: byte identity, the encoder, writing, only three types queried and nothing written, sorting, whole seconds, more than 200 records.
Release-Data Snapshot Export Failures: an empty type, an unmapped record, a failed query.
Release-Data Snapshot Export Validation: Development, Production refused or allowed, conflicting options.
Snapshot Export Flags: --snapshot, --allow-production, and SWOOP_EXPORT_ALLOW_PRODUCTION being ignored.
make docs passes. make lint adds no new warnings in the changed files.
Writes SDKVersion, XcodeVersion and SimulatorRuntime as SwoopKit's
ReleaseDataSnapshot, byte for byte what Stewed's StewedTools
`release-data-snapshot` wrote, so Stewed can drop StewedTools
(brightdigit/Stewed#194).
- Queries only those three types with queryAllRecords (paged), maps every
record with from(recordInfo:), and fails on an empty type or an
unmapped record.
- Sorted by record name, whole-second fetchedAt, SwoopKit's
JSONEncoder.iso8601PrettySorted plus a trailing newline.
- Read-only. Development unless --allow-production is passed, which is a
flag only, with no environment variable.
- A fixture JSON written by StewedTools' own code over fixed records
proves byte identity.
Needs SwoopKit 1.0.0-beta.2 (brightdigit/SwoopKit#3) for
ReleaseDataSnapshot.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3TXo46UssMPhwYSboRtyK
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
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 34d8938b-06a5-42f1-ae8b-7b8c32755d1c
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
No actionable comments were generated in the recent review.
Walkthrough
Adds swoopmist export --snapshot to fetch SDK version, Xcode version, and simulator runtime records, then write them as a JSON snapshot. The workflow validates options and environment access, reports errors, and includes tests for record mapping, output, and configuration.
Changes: Release-data snapshot export
Layer / File(s)
Summary
Snapshot data pipeline Sources/SwoopMistKit/Snapshot/*, Sources/SwoopMistKit/CloudKit/SyncEngine+Snapshot.swift, Tests/SwoopMistKitTests/Snapshot/*, Tests/SwoopMistKit/Fixtures/*, Package.swift
Adds a SyncEngine snapshot API. The exporter queries and sorts records, rejects empty or unmappable results, truncates fetchedAt to whole seconds, encodes sorted ISO-8601 JSON with a trailing newline, and writes atomically. Tests cover byte identity, record ordering, query failures, output, and timestamps.
Adds --snapshot and CLI-only --allow-production configuration. Snapshot validation rejects conflicting export options and Production access unless enabled. The CLI routes snapshot requests to the new command, which authenticates, fetches, writes, and reports snapshot details. Documentation describes the command and its constraints.
sequenceDiagram
participant SnapshotExportCommand
participant SyncEngine
participant ReleaseDataSnapshotExport
participant CloudKit
participant SnapshotFile
SnapshotExportCommand->>SyncEngine: exportSnapshot(fetchedAt:)
SyncEngine->>ReleaseDataSnapshotExport: snapshot(from:fetchedAt:)
ReleaseDataSnapshotExport->>CloudKit: query all records for three record types
CloudKit-->>ReleaseDataSnapshotExport: return records
ReleaseDataSnapshotExport-->>SyncEngine: return ReleaseDataSnapshot
SyncEngine-->>SnapshotExportCommand: return snapshot
SnapshotExportCommand->>SnapshotFile: write snapshot and report size
Loading
Merge Risk: Minimal · up to 1c641 · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
[#17] Issue #17 asks that the export retrieve all records per type. Its Phase 2 change is in BushelCloud's SyncEngine+Export.swift, which is outside this repository. This PR does not change BushelClou…
Confirm at the reviewed head that SwoopMistKitService.queryAllRecords follows continuation markers, and that a test covers paging through that path. State whether the BushelCloud export change in #17 is tracked in another issue or pull requ…
Passed checks: 3 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "Add swoopmist export --snapshot for the release-data snapshot" matches the main change. The PR adds the export --snapshot option to the swoopmist CLI, which writes SwoopKit's ReleaseDataS…
Out of Scope Changes check
The changed files support the snapshot export feature in #17's context or the stated PR scope. These files include the new ReleaseDataSnapshotExport, validation, and SnapshotExportError sources; SyncE…
Full details: Title check
Explanation
The title "Add swoopmist export --snapshot for the release-data snapshot" matches the main change. The PR adds the export --snapshot option to the swoopmist CLI, which writes SwoopKit's ReleaseDataSnapshot. The title names the command and the snapshot feature. It does not mention the read-only Development default or the --allow-production flag, but it does not need to cover every detail.
Full details: Out of Scope Changes check
Explanation
The changed files support the snapshot export feature in #17's context or the stated PR scope. These files include the new ReleaseDataSnapshotExport, validation, and SnapshotExportError sources; SyncEngine.exportSnapshot; ExportConfiguration and configuration key additions for --snapshot and --allow-production; SnapshotExportCommand and its wiring in ExportCommand; the Package.swift SwoopKit minimum bump to 1.0.0-beta.2; the fixtures and tests for these sources; and documentation in README, AGENTS.md, the DocC pages, and the memory notes. The memory notes and AGENTS.md are documentation for the same feature. No change in the summary is unrelated to the snapshot export.
Full details: Linked Issues check
Explanation
[#17] Issue #17 asks that the export retrieve all records per type. Its Phase 2 change is in BushelCloud's SyncEngine+Export.swift, which is outside this repository. This PR does not change BushelCloud. The PR states that SwoopMistKitService.queryAllRecords already calls MistKit 1.0.0-beta.6 queryAllRecords, which follows continuation markers. The reviewed change summary does not show that service method, so its paging behavior at the reviewed head is not verified here. The new test in ReleaseDataSnapshotExportTests covers 450 XcodeVersion records through FixtureRecordService. That test checks that the export keeps records the service returns. It does not test paging inside the service. The PR also covers only SDKVersion, XcodeVersion, and SimulatorRuntime. It does not cover the RestoreImage, XcodeVersion, and SwiftVersion types named in the issue.
Resolution
Confirm at the reviewed head that SwoopMistKitService.queryAllRecords follows continuation markers, and that a test covers paging through that path. State whether the BushelCloud export change in #17 is tracked in another issue or pull request. Without that evidence, this assessment cannot pass.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
* Add swoopmist export --snapshot for the release-data snapshot (#46)
* Add `swoopmist export --snapshot` for the release-data snapshot
Writes SDKVersion, XcodeVersion and SimulatorRuntime as SwoopKit's
ReleaseDataSnapshot, byte for byte what Stewed's StewedTools
`release-data-snapshot` wrote, so Stewed can drop StewedTools
(brightdigit/Stewed#194).
- Queries only those three types with queryAllRecords (paged), maps every
record with from(recordInfo:), and fails on an empty type or an
unmapped record.
- Sorted by record name, whole-second fetchedAt, SwoopKit's
JSONEncoder.iso8601PrettySorted plus a trailing newline.
- Read-only. Development unless --allow-production is passed, which is a
flag only, with no environment variable.
- A fixture JSON written by StewedTools' own code over fixed records
proves byte identity.
Needs SwoopKit 1.0.0-beta.2 (brightdigit/SwoopKit#3) for
ReleaseDataSnapshot.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3TXo46UssMPhwYSboRtyK
* Resolve SwoopKit 1.0.0-beta.2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3TXo46UssMPhwYSboRtyK
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Count SDK versions and runtimes in the sync action's summaries (#47)
The sync and export summaries only counted restore images, Xcode and
Swift versions, so SDKVersion and SimulatorRuntime (added in #44) never
showed up. Add both, plus the SDKVersion records the sync deletes.
Also drop the stale "limited to 200 records per type" notes: MistKit
1.0.0-beta.6's queryAllRecords follows continuation markers (#17).
Claude-Session: https://claude.ai/code/session_01V3TXo46UssMPhwYSboRtyK
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Add 1.0.0-beta.4 release notes
Covers #46 (export --snapshot) and #47 (sync action summaries).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3TXo46UssMPhwYSboRtyK
* Call the release 1.0.0-alpha.4
The next version is 1.0.0-alpha.4, not 1.0.0-beta.4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3TXo46UssMPhwYSboRtyK
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on SwoopKit 1.0.0-beta.2 (brightdigit/SwoopKit#3), which moved
ReleaseDataSnapshotandJSONEncoder.iso8601PrettySortedinto SwoopKit.Package U.3 of Stewed's v1.0.0-beta.1 plan, part of brightdigit/Stewed#194 (drop StewedTools).
What
swoopmist export --snapshot <output.json>writes SwoopKit'sReleaseDataSnapshot, the file Stewed bundles asResources/release-data-snapshot.json. It keeps every guarantee of StewedTools'release-data-snapshot:SDKVersion,XcodeVersionandSimulatorRuntime, each throughqueryAllRecords, which pages.from(recordInfo:). The export fails if a type is empty or any record doesn't map, and names the records that didn't.fetchedAtis whole seconds, and the JSON is SwoopKit'sJSONEncoder.iso8601PrettySortedplus a trailing newline.--allow-production. That's a command-line flag only, with noSWOOP_*variable, so a leftover environment variable can't turn it on.--output,--pretty,--signed-onlyand--no-betasdon't apply to a snapshot, so they're refused rather than ignored.The logic is in the library (
ReleaseDataSnapshotExport,SyncEngine.exportSnapshot(fetchedAt:)), so it's tested without CloudKit.SnapshotExportCommandin the CLI only handles the configuration and the file.Stewed's
make release-data-snapshotcan then run:swoopmist export --snapshot Resources/release-data-snapshot.jsonwith SwoopMistKit's environment loaded (
CLOUDKIT_KEY_ID,CLOUDKIT_PRIVATE_KEY_PATHorCLOUDKIT_PRIVATE_KEY;CLOUDKIT_ENVIRONMENTunset ordevelopment).Byte identity with StewedTools
Tests/SwoopMistKitTests/Fixtures/release-data-snapshot-stewedtools.jsonwas written by StewedTools' ownrecords()andwrite()code, copied verbatim into a throwaway harness built against SwoopMistKit 1.0.0-alpha.3, SwoopCloudKit 1.0.0-beta.1 and MistKit 1.0.0-beta.6, with only the CloudKit query swapped forSnapshotFixture's records. Those records come out of query order, with millisecond dates,INT64booleans, references, a missingisPrerelease, escaped characters andsdkBuildNumbersText. The tests check:export --snapshot's bytes equal that file exactly;write(_:to:)puts the same bytes on disk.There's no live Development comparison. No SwoopMistKit or Stewed
.envwith Development credentials was available locally. Production was never touched.#17: the 200-record cap
Already fixed:
SwoopMistKitService.queryAllRecordscalls MistKit 1.0.0-beta.6'squeryAllRecords, which follows continuation markers. MistKit's QueryPagination tests cover that, and bothexportandexport --snapshotuse it. This PR adds a regression test showing that the snapshot export keeps all 450 records it's given for one type.Closes #17
Tests
swift test: 318 tests pass against SwoopKit 1.0.0-beta.2 (Package.resolvedpins it). New suites:--snapshot,--allow-production, andSWOOP_EXPORT_ALLOW_PRODUCTIONbeing ignored.make docspasses.make lintadds no new warnings in the changed files.🤖 Generated with Claude Code
https://claude.ai/code/session_01V3TXo46UssMPhwYSboRtyK
Summary by CodeRabbit
--allow-productionto enable it in other environments.