-
Notifications
You must be signed in to change notification settings - Fork 562
(compat) Update client-utils to auto generate layer compatibility generation #25835
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) Update client-utils to auto generate layer compatibility generation #25835
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 layer compatibility generation tracking infrastructure to the codebase. The changes enable automatic generation and updating of layer generation files based on package versions and release dates, with the goal of tracking compatibility across different Fluid layers over time.
- Adds
layerGenerationState.tsfile to@fluid-internal/client-utilspackage with generation value of 2 - Introduces
layerGeneration:gennpm script and build configuration to auto-generate generation state files - Updates version setting logic to regenerate layer generation files alongside package version files
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/common/client-utils/src/layerGenerationState.ts | New auto-generated file defining generation constant (value: 2) for layer compatibility tracking |
| packages/common/client-utils/package.json | Adds layerGeneration:gen script and fluidCompatMetadata with generation 2, release date, and package version |
| fluidBuild.config.cjs | Adds layerGeneration:gen task configuration and includes it as a dependency of build:docs |
| build-tools/packages/build-cli/src/library/package.ts | Updates setVersion function to run layerGeneration:gen script during version updates |
| * Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
| * Licensed under the MIT License. | ||
| * | ||
| * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
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.
Policy check is failing because this line ends with a full stop.
@scottn12 @tylerbutler Not sure if this is intentional but either way, this will need a build-tools change.
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.
You can add an ignore for the policy in the root fluidBuild.config.cjs
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.
Adding layerGenerationState.ts to policy:handlerExclusions seems to fix the problem. However, I think it might be better to just update the code that generates the file to not have a full stop. What do you think?
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.
Do both. Use a workaround for now, fix build-tools, then integrate the fix and remove the workaround. Assuming you're blocked. If not, you can fix it first.
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.
Good point. I manually removed the . as a workaround. I should wait to check this PR in until the release happens though. Otherwise, this file might be regenerated and the changes to the build process won't be in creating confusion.
9a92cdb to
06a94c1
Compare
…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)
#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:
layerGeneration:genscript toclient-utils's package.json file which will run the above command.client-utilspackage. It auto-addedlayerCompatMetadatato its package.json and auto-generated alayerGenerationState.tsfile which contains the generation value. The generation is set to 2 since that is the current generation (hard coded in different layers).AB#51927