Skip to content

[DO NOT MERGE]: Test branch for Data Migration crew#25253

Closed
markfields wants to merge 25 commits intomainfrom
test/data-migration
Closed

[DO NOT MERGE]: Test branch for Data Migration crew#25253
markfields wants to merge 25 commits intomainfrom
test/data-migration

Conversation

@markfields
Copy link
Member

Staging / Discussion area for FF changes required for data migration. Focusing on migrating DataObject to use/support SharedTree as root instead of SharedDirectory

@github-actions github-actions bot added base: main PRs targeted against main branch area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: runtime Runtime related issues public api change Changes to a public API labels Aug 19, 2025
kian-thompson and others added 9 commits August 25, 2025 14:30
This PR is a combination of multiple different prototypes
…upports multiple internal Fluid Data Models (#25382)

Main idea - the MigrationDataObject separates the external data
interface (i.e. getting/setting arbitrary keys, maybe a SharedTree
instance) from the internal fluid data model used to implement it (i.e.
which DDSes are actually there in the Runtime).

To do this it takes in a `TUniversalView` type parameter (the external
data interface), and a list of one or more "Model Descriptors" which can
identify whether the DataStoreRuntime matches that model (similar to
`refreshRoot` in the base branch), as well as how to initialize a new
DataObject with that model. Each Model Descriptor yields a model that
fits into `TUniversalView`.

The simplest way to specify `TUniversalView` is to just union all the
individual model types. (The example below makes a different choice)

### Updating DataObject and TreeDataObject

This PR also illustrates updating DataObject and TreeDataObject to use
MigrationDataObject. We could deprecate those if we get
MigrationDataObject to a place we like, and existing subclasses of
DataObject could switch to MigrationDataObject directly. Then they'd be
ready if/when a migration is needed. Maybe we simply put the new
capabilities on PureDataObject instead of introducing a new class.

### Example

See `demo.ts`.

The Model Descriptor for the classic "root SharedDirectory" DataObject
checks for a channel with ID "root" that's a SharedDirectory, whereas
the Descriptor for the "root SharedTree" DataObject checks for
"root-tree" channel that's a SharedTree.

The `TUniversalView` here is this abstraction, taken from the prototype
component code:

```typescript
  readonly getArbitraryKey: (key: string) => string | boolean | undefined;
  readonly setArbitraryKey: (key: string, value: string | boolean) => void;
  readonly deleteArbitraryKey: (key: string) => void;
  readonly getRoot: () => {
    isDirectory: true,
    root: ISharedDirectory
  } | {
    isDirectory: false,
    root: ITree,
  };
```

## Reviewer Guidance

There are plenty of todos and some gaps. Some listed below. Any and all
feedback is welcome, but focusing on higher-level is more helpful in the
short term.

### Gaps / open questions 
- We need something like an "evacuateModel" function on ModelDescriptor
to clean up unreferenced channels after migration
- API / experience around how you'd roll out a new ModelDescriptor and
stage the migration is not fleshed out.
- Reminder this is targeting a WIP feature branch, so the rest of the
migration flow is PoC quality as well

Thanks for taking a look!
Fix build issues with MigrationDataObject prototype, by switching an API
from alpha to beta, and switching to a type export.
Add missing API file.
@github-actions github-actions bot added the area: tests Tests to add, test infrastructure improvements, etc label Sep 11, 2025
@github-actions github-actions bot added the area: examples Changes that focus on our examples label Sep 11, 2025
markfields and others added 11 commits September 11, 2025 21:27
Too much monkeying around wtih constructors!
…Object (#25545)

## Description

We're moving nearly all the migration logic into the
`MigrationDataObject` itself, to avoid having the Factory need to know
information from Instance(s) (see old `observeCreateDataObject`).

Additionally, try out a compositional approach to adding in the
Migration bits needed by the factory rather than extending
PureDataObjectFactory.
@github-actions
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:
  236987 links
    1726 destination URLs
    1962 URLs ignored
       0 warnings
       0 errors


@microsoft-github-policy-service
Copy link
Contributor

This PR has been automatically marked as stale because it has had no activity for 60 days. It will be closed if no further activity occurs within 8 days of this comment. Thank you for your contributions to Fluid Framework!

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

Labels

area: examples Changes that focus on our examples area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch public api change Changes to a public API status: stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants