Skip to content

(compat) Add new interface for layer incompatibility to make it simpler for consumption#25706

Merged
agarwal-navin merged 11 commits intomicrosoft:mainfrom
agarwal-navin:layerCompatError
Oct 24, 2025
Merged

(compat) Add new interface for layer incompatibility to make it simpler for consumption#25706
agarwal-navin merged 11 commits intomicrosoft:mainfrom
agarwal-navin:layerCompatError

Conversation

@agarwal-navin
Copy link
Contributor

@agarwal-navin agarwal-navin commented Oct 16, 2025

Also a new @alpha interface ILayerIncompatibilityError of error type FluidErrorTypes.usageError. It has properties that consumers can use to get additional details about the incompatiblity. When layer incompatibility is detected, this error will be thrown. The properties have comments that explain what these properties are for.

Also, added a telemetry called LayerIncompatibilityError which will be logged everytime layer incompatibility is detected.

AB#43990

Copilot AI review requested due to automatic review settings October 16, 2025 16:59
@github-actions github-actions bot added area: loader Loader related issues area: runtime Runtime related issues labels Oct 16, 2025
@github-actions github-actions bot added the base: main PRs targeted against main branch label Oct 16, 2025
Copy link
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

Updates layer compatibility validation to produce more user-friendly errors and richer telemetry.

  • Introduces validateLayerCompatibility helper that centralizes logic, adds structured core properties (layer, incompatibleLayer, versions, diff) and detailed JSON errorDetails.
  • Exposes versions directly on telemetry properties and adds new telemetry event LayerIncompatibilityError.
  • Updates tests and layer type definitions (introducing FluidLayer union with lowercase layer identifiers).

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/utils/telemetry-utils/src/layerCompatError.ts Adds shared validation helper that throws UsageError, logs telemetry, and computes diff plus property sets.
packages/utils/telemetry-utils/src/index.ts Re-exports new validateLayerCompatibility API.
packages/runtime/datastore/src/test/dataStoreLayerCompatValidation.spec.ts Adjusts tests to new telemetry property names and casing.
packages/runtime/datastore/src/dataStoreRuntime.ts Moves runtime compatibility validation after logger setup, passes logger.
packages/runtime/datastore/src/dataStoreLayerCompatState.ts Refactors to use centralized helper with lowercase layer identifiers.
packages/runtime/container-runtime/src/test/runtimeLayerCompatValidation.spec.ts Updates tests to new property names/casing and passes logger.
packages/runtime/container-runtime/src/runtimeLayerCompatState.ts Refactors validation functions to use helper and require logger.
packages/runtime/container-runtime/src/dataStoreContext.ts Passes logger into validation call.
packages/runtime/container-runtime/src/containerRuntime.ts Defers loader compatibility check until logger is available.
packages/loader/container-loader/src/test/loaderLayerCompatValidation.spec.ts Updates tests to new property names/casing and logger usage.
packages/loader/container-loader/src/loaderLayerCompatState.ts Refactors runtime/driver validation to use helper; adds logger parameter.
packages/loader/container-loader/src/container.ts Passes logger into validation calls.
packages/common/client-utils/src/layerCompat.ts Introduces FluidLayer type with lowercase identifiers.
packages/common/client-utils/src/indexNode.ts Exports FluidLayer type.
packages/common/client-utils/src/indexBrowser.ts Exports FluidLayer type.

Copy link
Contributor

@scottn12 scottn12 left a comment

Choose a reason for hiding this comment

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

Looks good!

@github-actions github-actions bot added the area: tests Tests to add, test infrastructure improvements, etc label Oct 16, 2025
Copy link
Member

@markfields markfields left a comment

Choose a reason for hiding this comment

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

Looks good overall, left a few optional questions/comments.

@agarwal-navin agarwal-navin requested a review from a team as a code owner October 23, 2025 00:36
@github-actions github-actions bot added the public api change Changes to a public API label Oct 23, 2025
@agarwal-navin agarwal-navin changed the title (compat) Add new error type for layer incomatibility to make it easier to consume (compat) Add new interface for layer incomatibility to make it simpler for consumption Oct 23, 2025
@github-actions
Copy link
Contributor

🔗 Found some broken links! 💔

Run a link check locally to find them. See
https://github.com/microsoft/FluidFramework/wiki/Checking-for-broken-links-in-the-documentation for more information.

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

 ELIFECYCLE  Command failed with exit code 1.

compatibilityRequirementsInMonths:
compatDetailsLayer1.generation -
compatSupportRequirementsLayer1.minSupportedGeneration,
actualDifferenceInMonths:
Copy link
Member

Choose a reason for hiding this comment

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

Have we started bumping generation each month yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not yet.

Copy link
Member

Choose a reason for hiding this comment

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

So won't this be kind of misleading? minSupportedGeneration is presumably 0, and compatDetailsLayer1.generation is presumably 1. So this will report a compat requirement of 1 month. Maybe I'm wrong in my assumptions though.

It's ok if it's a little wonky at first while getting this off the ground anyway, IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the current state, this error won't be thrown because everything is compatible. It will start throwing when we update the generation and the minSupportedGeneration.

Copy link
Member

@markfields markfields left a comment

Choose a reason for hiding this comment

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

left a bunch of comments on the diff since I last reviewed, hopefully they show up properly for you.

@github-actions github-actions bot removed the public api change Changes to a public API label Oct 23, 2025
@agarwal-navin agarwal-navin removed the request for review from a team October 23, 2025 21:38
Copy link
Member

@markfields markfields left a comment

Choose a reason for hiding this comment

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

👏

@agarwal-navin agarwal-navin merged commit d5af295 into microsoft:main Oct 24, 2025
45 checks passed
@agarwal-navin agarwal-navin deleted the layerCompatError branch October 24, 2025 17:36
@agarwal-navin agarwal-navin changed the title (compat) Add new interface for layer incomatibility to make it simpler for consumption (compat) Add new interface for layer incompatibility to make it simpler for consumption Oct 30, 2025
agarwal-navin added a commit that referenced this pull request Nov 3, 2025
Follow up to #25706.

Added a new error type `layerIncompatibilityError` which will be used
when a layer incompatibility is detected between Fluid layers. This will
help applications detect when an error is because of layer
incompatibility and take appropriate steps.

The new error type is added as an legacy / alpha API. Since the
`FluidErrorTypes` type is legacy / beta, added a `FluidErrorTypesAlpha`
type where new error types will be added to stage them. Once the
breaking change window has passed, error types will be moved to
`FluidErrorTypes`.


[AB#51811](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/51811)
anthony-murphy-agent pushed a commit to anthony-murphy-agent/FluidFramework that referenced this pull request Jan 14, 2026
…r for consumption (microsoft#25706)

Also a new `@alpha` interface `ILayerIncompatibilityError` of error type
`FluidErrorTypes.usageError`. It has properties that consumers can use
to get additional details about the incompatiblity. When layer
incompatibility is detected, this error will be thrown. The properties
have comments that explain what these properties are for.

Also, added a telemetry called `LayerIncompatibilityError` which will be
logged everytime layer incompatibility is detected.


[AB#43990](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/43990)
anthony-murphy-agent pushed a commit to anthony-murphy-agent/FluidFramework that referenced this pull request Jan 14, 2026
…osoft#25784)

Follow up to microsoft#25706.

Added a new error type `layerIncompatibilityError` which will be used
when a layer incompatibility is detected between Fluid layers. This will
help applications detect when an error is because of layer
incompatibility and take appropriate steps.

The new error type is added as an legacy / alpha API. Since the
`FluidErrorTypes` type is legacy / beta, added a `FluidErrorTypesAlpha`
type where new error types will be added to stage them. Once the
breaking change window has passed, error types will be moved to
`FluidErrorTypes`.


[AB#51811](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/51811)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: loader Loader related issues area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants