-
Notifications
You must be signed in to change notification settings - Fork 559
(compat) Add PackageCommand to auto update layer compatibility generation #25670
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
(compat) Add PackageCommand to auto update layer compatibility generation #25670
Conversation
There was a problem hiding this 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.tsfile 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 |
052e6df to
61fde3e
Compare
scottn12
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
build-tools/packages/build-cli/src/commands/generate/layerGeneration.ts
Outdated
Show resolved
Hide resolved
build-tools/packages/build-cli/src/commands/generate/layerCompatGeneration.ts
Show resolved
Hide resolved
build-tools/packages/build-cli/src/commands/generate/layerGeneration.ts
Outdated
Show resolved
Hide resolved
build-tools/packages/build-cli/src/commands/generate/layerGeneration.ts
Outdated
Show resolved
Hide resolved
build-tools/packages/build-cli/src/commands/generate/layerGeneration.ts
Outdated
Show resolved
Hide resolved
build-tools/packages/build-cli/src/commands/generate/layerGeneration.ts
Outdated
Show resolved
Hide resolved
build-tools/packages/build-cli/src/commands/generate/layerGeneration.ts
Outdated
Show resolved
Hide resolved
build-tools/packages/build-cli/src/commands/generate/layerGeneration.ts
Outdated
Show resolved
Hide resolved
|
Build break can be fixed by running Pnpm format in the common/build/Eslint config fluid directory. |
…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).
…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)
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:
PackageCommandcalledUpdateGenerationCommandis added. The flub commandflub generate:layerCompatGenerationcan be run this command for a package.fluidCompatMetadatawhich will contain the generation information as per the last update. It is of typeIFluidCompatibilityMetadataand contains the last generation, last release date and last release package version.fluidCompatMetadataand add it to the package.json file. It will also auto-generate a filed calledlayerGenerationState.tsunder the .src directory.fluidCompatMetadatafrom package.json and update the generation (if needed) as follows:New generation = Old generation + no. of months since last release.New generation = Old generation + min (no. of months since last release, min. compat window between layers across all layer boundaries).flub generate:layerGenerationcommand will be added to the scripts inclient-utils'spackage.jsonfile 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