Skip to content

Snapshot codec builders#26590

Merged
CraigMacomber merged 4 commits intomicrosoft:mainfrom
CraigMacomber:CodecSnapshots
Mar 17, 2026
Merged

Snapshot codec builders#26590
CraigMacomber merged 4 commits intomicrosoft:mainfrom
CraigMacomber:CodecSnapshots

Conversation

@CraigMacomber
Copy link
Copy Markdown
Contributor

Description

Add a util for snapshotting the format for all versions of a codec, and use it for a few codecs.

Reviewer Guidance

The review process is outlined on this wiki page.

Copilot AI review requested due to automatic review settings February 28, 2026 04:56
@CraigMacomber CraigMacomber requested a review from a team as a code owner February 28, 2026 04:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a utility to snapshot all supported codec format schemas across versions, and updates several tests/snapshots to use it.

Changes:

  • Introduced snapshotCodecFormats helper for capturing { version, minVersionForCollab, schema } per codec version.
  • Updated/added tests and snapshot outputs to use versioned codec-format snapshots (e.g., Schema, DetachedFieldIndex).
  • Refactored versioned codec builder typing/exports to expose schema for snapshotting.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/dds/tree/src/test/snapshots/snapshotTools.ts Adds snapshotCodecFormats helper to snapshot all codec format versions.
packages/dds/tree/src/test/snapshots/schema.spec.ts Adjusts schema snapshot encoding options (removes minVersionForCollab).
packages/dds/tree/src/test/snapshots/output/files/EncodedFieldBatch.json Updates existing snapshot content to versioned format list.
packages/dds/tree/src/test/snapshots/output/codecFormats/formats_Schema_codec.json Adds snapshot output for Schema codec formats across versions.
packages/dds/tree/src/test/snapshots/output/codecFormats/formats_DetachedFieldIndex_codec.json Adds snapshot output for DetachedFieldIndex codec formats across versions.
packages/dds/tree/src/test/snapshots/index.ts Re-exports snapshotCodecFormats.
packages/dds/tree/src/test/feature-libraries/schema-index/schemaSummarizer.spec.ts Adds a codec format snapshot test for Schema codec builder.
packages/dds/tree/src/test/feature-libraries/chunked-forest/codec/format.spec.ts Removes old single-schema snapshot test file.
packages/dds/tree/src/test/feature-libraries/chunked-forest/codec/codecs.spec.ts Adds codec format snapshot test for fieldBatchCodecBuilder.
packages/dds/tree/src/test/core/tree/detachedFieldIndexCodec.spec.ts Adds codec format snapshot test for DetachedFieldIndex codec builder.
packages/dds/tree/src/core/tree/detachedFieldIndexCodecs.ts Updates build options typing to ICodecOptions and makes fields readonly.
packages/dds/tree/src/codec/versioned/index.ts Removes makeVersionedValidatedCodec export.
packages/dds/tree/src/codec/versioned/codec.ts Refactors versioned codec typing to propagate schema; changes builder generics.
packages/dds/tree/src/codec/index.ts Removes makeVersionedValidatedCodec export from the main codec barrel.

Comment thread packages/dds/tree/src/codec/versioned/codec.ts
Comment thread packages/dds/tree/src/codec/versioned/codec.ts
Comment thread packages/dds/tree/src/codec/versioned/codec.ts
Comment thread packages/dds/tree/src/codec/versioned/index.ts
Comment thread packages/dds/tree/src/codec/index.ts
Comment thread packages/dds/tree/src/test/snapshots/snapshotTools.ts
TContext,
TFormatVersion extends FormatVersion,
TBuildOptions extends CodecWriteOptions,
TBuildOptions extends ICodecOptions = ICodecOptions,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are reordered so cases which only want to specify TBuildOptions (which is the main thing impacting the exposed API) can do so without having to specify default values for the others.

Comment thread packages/dds/tree/src/codec/versioned/codec.ts Outdated
Comment thread packages/dds/tree/src/test/snapshots/snapshotTools.ts Outdated
CraigMacomber and others added 2 commits March 11, 2026 15:34
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
@CraigMacomber CraigMacomber merged commit 462fc94 into microsoft:main Mar 17, 2026
30 checks passed
@CraigMacomber CraigMacomber deleted the CodecSnapshots branch March 17, 2026 16:22
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.

3 participants