@azure/communication-react is the primary NPM package released from this repository. Along with the NPM package, we also update the documentation hosted on storybook.
This repository follows a green-trunk development model. All development happens on the main
branch. Releasing a new version of the package involves three distinct steps:
- Create a git branch to release the package. This step is mostly automated via GitHub workflows.
- Prepare the branch for release. This step involves API approvals, string translations, bug bashes etc and tends to last 1-2 weeks.
- Release the package to NPM for release branch. This step is mostly automated via GitHub workflows.
This document applies to beta and stable releases. Alpha releases are created nightly through a separate light-weight mechanism.
This document applies to normal releases, off of main
. For hotfixing a prior release on NPM, see documentation on creating hotfixes.
- Step 0.1: Create a Thread in the WebUI channel to Track Release Progress
- Step 0.2: Pre-Release ChangeLog and Update Feature List
- Step 0.3: ARB Review of any Changes to Public SDK API and/or Rest APi (Required for Stable | Recommended for Beta)
- Step 0.4: Create an Async Bug Bash Meeting
- Step 0.5: Create a Change Log Grooming Meeting
- Step 0.6: Ensure strings are Updated on Main
- Step 1.1: Create a Pre-release Branch
- Step 1.2: Groom changelog
- Step 1.3: Create Release branch
- Step 1.4: (Beta Only): Update the UI Snapshot
- Step 1.5: (Beta Only): Notify the Release Thread About api.md Update and UI Snapshot Update
- Step 2.1: Bug Bash
- Step 2.2: Storybook Bug Bash
- Step 2.3: Fetch, Merge and Cherry-pick Translated Strings
- Step 3.1: Pre-release Checklist
- Step 3.2: Publish to NPM (Pair up with a teammate)
- Step 3.3: (Beta Only): Deploy Storybook
- Step 3.4: Clean up and Merge Pre-Release Branch Back to Main
- Step 3.5: Post-release Checklist
Create a release thread in the WebUI channel and keep it up to date so the whole team knows where we are at.
Ask feature owners to create a PR to add a pre-release changelog and remove the feature from the in-progress-feature/feature list.
For all the features that are going into this release, ask the feature owners to:
- Move feature to beta or stable as appropriate in the feature list
- Create a change log summarizing the feature and set the change type as 'prerelease' if the feature is going into beta, or 'minor' if the feature is going into stable.
Step 0.3: ARB Review of any Changes to Public SDK API and/or Rest APi (Required for Stable | Recommended for Beta)
- Create an APIView showing changes.
- Create a post in
Language - JavaScript - Reviews
channel with APIView link to request review.- Use a previous review request as an example.
- See the internal documentation for how to reach out to the API stewardship board.
- Follow up after 24-48 hours if you have not received a response.
Ex.
Setup a meeting with the feature owners to groom the changelog together.
- String translation take up to 5 working days to complete. Any PR changing strings needs to be complete 5 working days before release.
- Ensure any strings PRs are merged into
main
Both beta and stable releases follow a two-step workflow, aided by GitHub actions.
We want to create a pre-release branch because this branch will act as a place to perform actions like bumping package versions, grooming the changelog, and performing string translations. This branch will be the place that the release branch is created from before it is merged back into main.
Use the create-prerelease-branch GitHub action to trigger the release preparation workflow.
- Options for this workflow:
- Branch - This is the branch that the release will be created from. Default option is from
main
. - Note: Get current version from communication-react package.json.
- Use this version as the basis for making your decision in the next step.
- Bump Type - This is the type of release that will be created, the options for this are:
beta-release-major
- Choose this option when you want to release from1.2.0 -> 2.0.0-beta.1
beta-release-minor
- Choose this option when you want to release from1.2.0 -> 1.3.0-beta.1
or1.2.0-beta.3 -> 1.3.0-beta.1
beta-release-patch
- Choose this option when you want to release from1.2.0 -> 1.2.1-beta.1
or1.2.0-beta.3 -> 1.2.1-beta.1
beta-release-beta
- Choose this option when you want to update only beta version to release from1.2.0.beta.1 -> 1.2.0-beta.2
stable-major
- This option is best for when you want to release from1.2.0 -> 2.0.0
stable-minor
- This option is best for when you want to release from1.2.0 -> 1.3.0
stable-patch
- Choose this option when you want to release from1.2.0 -> 1.2.1
stable-remove-beta-suffix
- Choose this option when you want to release from1.2.0-beta.3 -> 1.2.0
- Branch - This is the branch that the release will be created from. Default option is from
This section describes what the workflow above does. Understanding the workflow actions is useful in case the workflow fails.
- Create a
prerelease/<release-tag>
branch, bump the package version for@azure/communication-react
as appropriate and collect all change files into a changelog. - Creates another branch for manually summarizing the changes collected in the changelog.
For example, when creating a release off of main
tagged 3.3.0
, the following branches are created
graph LR
main[branch: main]
prerelease[branch: prerelease/3.3.0<br/>- bump version to 3.3.0<br/>- collect changelog]
main -->|Create Branch| prerelease
prerelease -->|Create Branch| pr
Once this workflow is done you will need to go to the new branch when making a PR and manually create a change file stating that the versions of the packages have been bumped.
- Previous step's workflow creates a
groom-changelog/<release-tag>
branch. - Follow steps to groom changelog.
- Remove the
GROOMME.md
file created from previous workflow to signify that the changelog has been manually groomed. - Create PR to merge grooming branch into pre-release branch (
prerelease/<release-tag>
). - Merge this PR before going to
Step 1.3: Create release branch
.
Use the create-release-branch github action to trigger the release branch creation workflow.
- Options for GH Action:
- Pre-release branch - This is the pre-release branch that was created in the previous workflow. This action should be only done after the changelog is groomed and merged back into the pre-release branch to avoid cherry-picking.
After finishing creating a release branch, follow these steps to create a UI snapshot PR (generate beta-release only snapshot diff from main branch):
- Create a new branch based on the release branch you just created in Step 1.2
- Use the update-snapshots github action to trigger the update snapshots workflow.
- Wait for snapshot update
- Once the snapshot update is finished, you might or might not see changes for the UI snapshot, if there are any updates, open a PR to merge that new branch back to the release branch
- Merge the PR if everything looks fine, or notify the feature owner if something looks not 100% correct.
Once the release branch has been created, we must make sure that the package we eventually off of the release branch is high quality. Towards this:
- Set up a bug bash with the team to shake out any issues. See internal documentation for setting up a bug bash.
- Triage bugs found via bug bash and manage merging of fixes into the release branch, as described in the section below.
While the release branch is active, some changes might be merged into the branch (for bug fixes, or features deemed necessary for the release). PRs into the release branch should follow this process when possible:
- First land the change as a PR into
main
. - Then, cherry-pick the change as a separate PR onto the release branch.
- Do not merge changes into the prerelease branch created in Step #1. They may get merged after the release branch is created, and not make it into the release at all.
- The release branch is never merged back into
main
, so any changes directly into the release branch will be lost onmain
(and future releases).
This process has the following benefits:
- The release branch never diverges off of
main
. In theory, it is possible to abandon the release branch at any point and create a new one off ofmain
without losing work. - All PR reviews happen on
main
, and the cherry-pick PR simply requires a sign-off.
We must ensure that our documentation is of high quality. To achieve this, we need to thoroughly test the Storybook pages:
- Set up a bug bash with the team to shake out any issues. See internal documentation for setting up a bug bash.
- Triage bugs found via bug bash and manage merging of fixes into the release branch, as described in the section below.
Fetch translated strings again for main to make sure any other string updates that have occurred since the start of the release process are included. If there are any strings updated, cherry-pick the changes to the release branch.
You are now ready to publish the package!
Releasing to NPM is an irreversible action.
Run through the checklist of pre-release actions
Rule of two: It is recommended to pair up with a team member for this last step to reduce the chances of human error.
- Run the Publish npm packages" GitHub action off the release branch.
- This deployment must then be approved by one of the repo administrators:
- Wait for the action to complete successfully then verify on https://www.npmjs.com/ that the package(s) published successfully.
Deploy the hosted storybook documentation using the "Release branch - Publish Storybook" GitHub action.
- Once everything is deployed and published on npm, delete the release branch from Git Hub.
- Make a PR to merge the pre-release branch into main.
Run through the checklist of post-release actions
Update the hero samples to use the newly released stable package. See instructions for updating hero samples.
Samples should be updated within a week of the package release.
There is a separate process for releasing a hotfix. See documentation on creating hotfixes.
Alpha releases are created nightly using the .github/workflows/nightly-ci.yml GitHub action.
Alpha releases can also be created manually by running .github/workflows/alpha-release.yml GitHub action.
They use Beachball's canary
CLI command to temporarily set all package versions to <version>-alpha-yyyymmddHHMM, then package up the npm packages and upload the packages to the azure release pipeline.
To ensure our packages are part of the @azure
organization our packages are published using Azure's publishing pipeline.
This requires us to first upload the tarball of the package we wish to publish to their blob storage, then trigger their release pipeline. This can be done manually or by GitHub actions.
Currently, alpha package releases are entirely done through GitHub actions (see Nightly and Manual GitHub workflow for more details). This requires the use of internal keys and tokens. For more information on these, or how to update them, see: Updating npm publishing credentials.