Skip to content

Conversation

@agarwal-navin
Copy link
Contributor

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

Description

Each layer within a client (Loader, Driver, Runtime and Datastore) has a generation property which should be incremented monthly. It provides a simple way to determine if two layers are compatible with each other by comparing their generations since layer compatibility is expressed in number of months. For example, between the Runtime and Datastore layers, we support a 3 months compatibility. So, they are compatible if the difference in their generation is <3. See #22877 for more details on how this will work.

This change adds an automated way to increment the generation of these layers for simplicity and consistency. Here is how it works:

  • A new PackageCommand called UpdateGenerationCommand is added. The flub command flub generate:layerCompatGeneration can be run this command for a package.
  • Added a new node to package.json file called fluidCompatMetadata which will contain the generation information as per the last update. It is of type IFluidCompatibilityMetadata and contains the last generation, last release date and last release package version.
  • If the command is run for the first time in a package, it will auto-generate fluidCompatMetadata and add it to the package.json file. It will also auto-generate a filed called layerGenerationState.ts under the .src directory.
  • If the command is run subsequently, it will read fluidCompatMetadata from package.json and update the generation (if needed) as follows:
    • If the package version has changed, i.e., a new release has happened, it will update the generation to New generation = Old generation + no. of months since last release.
    • An important requirement is that in between two subsequent releases, the generation should not be incremented by more than the minimum compat window between 2 layers across all layers boundaries. For example, say compat window between Loader / Runtime is 12 months but between Runtime / Datastore it is only 3 months. Then between 2 subsequent releases, generation should not increment by more than 2. If that happens, it doesn't give customers enough time to upgrade their packages and saturate a release before upgrading to the next one. Layer compatiility will break as soon they upgrade.
    • So, the logic for new generation is updated to: New generation = Old generation + min (no. of months since last release, min. compat window between layers across all layer boundaries).
  • The flub generate:layerGeneration command will be added to the scripts in client-utils's package.json file in a subsequent PR. The generation information for all the layers will be present in this package. The associated chagnes to the build system to run this command on releases will also be added in a subsequent PR.

AB#51926

@github-actions github-actions bot added area: build Build related issues base: main PRs targeted against main branch labels Oct 10, 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

This PR adds automated layer generation updates to the FluidFramework release process. The layer generation system provides compatibility tracking between different client layers (Loader, Driver, Runtime, Datastore) by incrementing a generation number monthly.

  • Adds automated generation update logic during minor/major releases
  • Creates auto-generated layerGeneration.ts file to track current generation and release date
  • Implements logic to calculate new generation based on months elapsed with compatibility window constraints

Reviewed Changes

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

File Description
FluidRelease.fsl Adds DoLayerGenerationUpdate step to release workflow after DoReleaseGroupBump
fluidReleaseStateHandler.ts Registers the new doLayerGenerationUpdate handler in the state machine
doFunctions.ts Implements the core layer generation update logic with file I/O and date calculations

@agarwal-navin agarwal-navin changed the title (layer compat) All logic to auto update layer compat generation during release (compat) All logic to auto update layer compat generation during release Oct 10, 2025
@agarwal-navin agarwal-navin changed the title (compat) All logic to auto update layer compat generation during release (compat) Add logic to auto update layer compat generation during release Oct 13, 2025
@agarwal-navin agarwal-navin changed the title (compat) Add logic to auto update layer compat generation during release (compat) Add PackageCommand to auto update layer compat generation Oct 30, 2025
@agarwal-navin agarwal-navin changed the title (compat) Add PackageCommand to auto update layer compat generation (compat) Add PackageCommand to auto update layer compatibility generation Oct 30, 2025
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.

LGTM!

@tylerbutler
Copy link
Member

Build break can be fixed by running Pnpm format in the common/build/Eslint config fluid directory.

@agarwal-navin agarwal-navin merged commit 91504ef into microsoft:main Nov 5, 2025
69 checks passed
@agarwal-navin agarwal-navin deleted the incrementGeneration branch November 5, 2025 19:15
agarwal-navin added a commit that referenced this pull request Nov 12, 2025
…eration (#25835)

#25670 added a command
(`fluid generate layerCompatGeneration`) that will auto-generate the
layer compatibility generation for packages that support it.

This change leverages that as follows:
- Added `layerGeneration:gen` script to `client-utils`'s package.json
file which will run the above command.
- Ran the script to generate the layer compatibility generation for the
`client-utils` package. It auto-added `layerCompatMetadata` to its
package.json and auto-generated a `layerGenerationState.ts` file which
contains the generation value. The generation is set to 2 since that is
the current generation (hard coded in different layers).
agarwal-navin added a commit that referenced this pull request Nov 21, 2025
…d during release (#25873)

Added a new check function that will run during a release. For minor and
patch releases, it will check the generation for layer compat has been
updated before releasing and bumping versions. The check function runs
the `pnpm run -r layerGeneration:gen` command and if there are any
changes, prompts to commit them before proceeding with the release. This
is similar to how type tests and release notes are updated.

Follow up to #25670 and
#25835.


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

Labels

area: build Build related issues base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants