ci: move to changesets for releases#4003
Conversation
🦋 Changeset detectedLatest commit: c124629 The changes in this PR will be included in the next version bump. This PR includes changesets to release 76 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5bb59ff to
4766a83
Compare
This commit implements a hybrid approach that mirrors rnx-kit's changesets workflow while keeping Azure Pipelines for NPM publishing. Architecture: - GitHub Actions: Version bump PR creation using @changesets/action - Azure Pipelines: NPM publishing (compliance-friendly) - GitHub App token: Bypasses org PR restrictions (like rnx-kit) Changes: - Add changesets dependencies (@changesets/cli, @changesets/changelog-github) - Create .changeset/config.json (mirrors rnx-kit configuration) - Create GitHub Actions workflow for version bumps - Update Azure Pipelines to use 'changeset publish' - Add comprehensive setup documentation Key features: - Uses official @changesets/action (battle-tested) - Preserves dependency-profiles postbump hook - Maintains Azure KeyVault integration for NPM token - Keeps all 1ESPT compliance and security measures - No prepublish hook needed (packages have proper exports field) Setup required: 1. Configure GitHub App (react-native-sdk-bot or new app) 2. Add APP_ID variable and PRIVATE_KEY secret 3. See CHANGESETS_SETUP.md for detailed instructions References: - rnx-kit workflow pattern - Plan: /Users/sanajmi/.claude/plans/stateless-jumping-unicorn.md Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add two layers of changeset validation: 1. Changeset Bot (already installed): - Automatically comments on PRs - Provides immediate visual feedback - Shows status: '⚠️ No Changeset' or '✅ Changeset detected' 2. GitHub Actions PR validation (new): - Enforces changesets in CI/CD - Fails PR checks if no changeset present - Automatically skips for version bump PRs - Shows helpful error message with instructions Changes: - Add .github/workflows/pr-validation.yml - Add 'checkchange:changeset' script to package.json - Update CHANGESETS_SETUP.md with validation details Both mechanisms work together to ensure all PRs include changesets while providing clear feedback to developers. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Co-authored-by: Tommy Nguyen <[email protected]>
c0f8466 to
6d00718
Compare
…/fluentui-react-native into changesets-hybrid-mirrornx-kit
There was a problem hiding this comment.
Could this not have been a bash script? Seems simpler than having a JS script that just mimics it.
There was a problem hiding this comment.
It was originally one. I've been trying to write scripts in typescript as much as I can. Then I discovered zx and tried that. I can take it back to bash though
There was a problem hiding this comment.
Actually, I see a bunch of other scripts are in our other scripts folder, like so:
"check-publishing": "node ./scripts/src/cli.mjs check-publishing",
I wonder if I should just move my scripts there and use our task runner that @JasonVMo introduced
| const files = fs.readdirSync(CHANGESETS_DIR); | ||
| const changesetFiles = files | ||
| .filter(file => file.endsWith('.md') && file !== 'README.md') | ||
| .map(file => path.join(CHANGESETS_DIR, file)); |
There was a problem hiding this comment.
Can we parse the JSON output of changeset --since origin/main --output bumps.json instead?
There was a problem hiding this comment.
That's a better idea
| commit: 'chore(release): version packages' | ||
| title: 'chore(release): version packages' |
There was a problem hiding this comment.
I don't think you need to set this. The default is already correct.
There was a problem hiding this comment.
Looking at their website:
https://github.com/changesets/action/tree/v1/
commit - The commit message to use. Default to Version Packages
title - The pull request title. Default to Version Packages
so I guess it's what format we want. We don't enforce conventional commits in the repo yet... but, I'd like to? I'll think about it
There was a problem hiding this comment.
Related:
version - The command to update version, edit CHANGELOG, read and delete changesets. Default to changeset version if not provided
I could make a small script to run changeset version && update-dependency-profiles && yarn install --immutable. Right now the dep profile bump is handled as a separate step in CI. Do you haave opinions on what may be clearer? Use default param + extra CI step vs small script to run the version command + our post hook?
Co-authored-by: Tommy Nguyen <[email protected]>
Co-authored-by: Tommy Nguyen <[email protected]>
Co-authored-by: Tommy Nguyen <[email protected]>

The current release uses beachball, which requires a CI workflow (in Azure Pipelines) that on every commit to main:
This workflow has two main issues:
The fix is to use the Changesets flow, as used by rnx-kit.
The new workflow is as follows:
Developers in FURN still use the familiar change files, but now:
Note:
I tried replicating this flow in beachball to keep our existing tool, buuuut that was a lot of AI generated code to copy something that already works and is battle tested. And AI code also makes it easy to switch tools. And Github Actions > Azure Pipelines for open soure stuff, so I vastly prefer this flow.
Description of changes
beachball check-change)Verification
I added some new checks, but as with all CI, got to merge and fix after bc it's hard to test.
Pull request checklist
This PR has considered (when applicable):