Skip to content

Shared Tree: Schema FormatV2 and codecs #24812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 75 commits into from
Jun 17, 2025

Conversation

TommyBrosman
Copy link
Contributor

@TommyBrosman TommyBrosman commented Jun 10, 2025

Adds support for persisting metadata along with the schema.

Changes

  • Add schema FormatV2
    • Node schema persisted metadata
    • Field schema persisted metadata
  • Schema codec for FormatV2
    • Add encodeV2 method to TreeNodeStoredSchema hierarchy
    • Persist node schema metadata in TreeNodeStoredSchema
    • Add support for encoding v2 fields
    • Update the storedSchemaDecodeDispatcher to dispatch on the inner kind union in FormatV2 and pass node schema metadata
    • Create and register schema change codec handling FormatV2
    • Create and register schema codec handling FormatV2
    • Generate new snapshots for schema tests
  • Add a new Shared Tree format version
    • Update enums
    • Generate new snapshots for existing Shared Tree format tests
  • simple-tree changes
    • Persist node metadata in arraySchema, mapSchema, objectSchema
    • Pass metadata to NodeStoredSchema types in toStoredSchema.ts
  • Other tests
    • Update codec.spec to cover FormatV2 as well as FormatV1
    • FormatV2-specific tests
  • API documentation
    • Changeset covering the new APIs
  • Feature flag for enabling Shared Tree Format v5

Notes for reviewers

Todo

TommyBrosman and others added 30 commits May 12, 2025 14:59
- Added in-memory schema format v2.
- Implemented the schema format v2 codec.
- Updated test utils that previously assumed there was only one format.
- Added snapshots for many of the v2 tests.
…ion as a parameter.

- Fixed naming of schema index formats.
- Changed schemaChangeFormat to be schema format-agnostic.
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
… we want something more intuitive (e.g., minimum client version).

- Split the encode method for TreeNodeStoredSchema.
…cVersion.

- Changed schema-stored/FormatV2 to only define the new elements.
- Updated all instantiations of TreeFieldStoredSchema so that persistedMetadata is specified.
- HACK: importCompressed needs to handle both schema formats. A few of the roundtrip JSON tests are failing.
Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
- Made importCompressed always use a v1 schema when encoding.
- Added better test data to one of the codec tests for the v2 schema format.
@TommyBrosman TommyBrosman enabled auto-merge (squash) June 16, 2025 21:05
@alexvy86
Copy link
Contributor

/azp run Build - client packages

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

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

Approving for docs. Left a few comments on the changeset but can be addressed in a follow-up PR.

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  225443 links
    1710 destination URLs
    1941 URLs ignored
       0 warnings
       0 errors


Copy link
Contributor

@rohandubal rohandubal left a comment

Choose a reason for hiding this comment

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

Reviewed the delta since previous approval; merge from main and a doc update.

@TommyBrosman TommyBrosman merged commit 3f81ab5 into microsoft:main Jun 17, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: tree area: dds Issues related to distributed data structures area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch changeset-present public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants