This is the guide to conducting a Bazel release. This is especially relevant for release managers, but will be of interest to anyone who is curious about the release process.
For future reference and release managers - the release manager playbook should be treated like an IKEA manual. That means: Do not try to be smart, optimize / skip / reorder steps, otherwise chaos will ensue. Just follow it and the end result will be.. well, a usable piece of furniture, or a Bazel release (depending on the manual).
Like aviation and workplace safety regulations, the playbook is written in the tears and blood of broken Bazelisks, pipelines, releases and Git branches. Assume that every step is exactly there for a reason, even if it might not be obvious. If you follow them to the letter, they are not error prone. Errors have only happened in the past, when a release manager thought it's ok to follow them by spirit instead. ;)
-- @philwo
These steps only have to be performed once, ever.
release-X.Y.Z (the .Z part is important). Cherry-pick PRs will be sent against this branch.X.Y.Z where Z>0), the base commit should simply be X.Y.(Z-1).X.Y.0 where Y>0), the base commit should typically be X.(Y-1).<current max Z>.X.0.0), the base commit is some “healthy” commit on the main branch.* @your-github-username and submit it directly.The Bazel X.Y.Z release branch (release-X.Y.Z [link]) is open for business. Please send cherry-pick PRs against this branch if you'd like your change to be in X.Y.Z. Please follow the release tracking issue [link] for updates.While the release is active, you should make sure to do the following:
@bazel-io fork X.Y.Z and a copy of the issue will be added to the “X.Y.Z release blockers” milestone; if not, explain why in a comment, and remove the “potential release blocker” label.Create a branch (via the GitHub UI or via the command line) named release-X.Y.ZrcN at the appropriate commit.
release-X.Y.Z, without the rcN part).Check BuildKite results at https://buildkite.com/bazel-trusted/bazel-release. You should see the release-X.Y.ZrcN branch here and a new build running for your release.
Check the postsubmit test run for the release branch to ensure that all tests on all platforms pass with the version you're about to release.
release-X.Y.ZrcN branch in the list. A build should automatically run. Make sure that it passes.When it all looks good, go back to the job in the release pipeline, click “Deploy release artifacts” for the deployment step.
If that worked, click on the “Generate announcement mail text” step to unblock it. If it's the first release candidate, prepare the release announcement (see next section).
Copy & paste the generated text into a new e-mail and send it. If you're creating a new release candidate, reply to the previous e-mail to keep all the information in one thread.
https://docs.google.com/document/d/1wDvulLlj4NAlPZamdlEVFORks3YXJonCjyuQMUQEmB0/viewTrigger a new pipeline in BuildKite to test the release candidate with all the downstream projects.
Look for failing projects in red.
Compare the results with the latest Bazel release:
If a project is failing with release candidate but not with the latest Bazel release, then there's probably a regression in the candidate. Ask the Bazel sheriff if the problem is already noticed. If not, find out the culprit, file an issue at https://github.com/bazelbuild/bazel/issues and mark it as release blocker.
If a project is failing with both release candidate and the latest Bazel release, it could be a breakage from the project itself. Go through the build history (eg. TensorFlow_serving) to confirm this, then file an issue to their owners.
File bugs (TODO: how to find the owner/project link?)
Once issues are fixed, create a new candidate with the relevant cherry-picks.
The release manager is responsible for the draft release announcement.
Once the first candidate is available:
After a few days of iteration:
Push the final release (do not cancel midway) by running the following commands in a Bazel git repo on a Linux machine:
git fetch origin release-X.Y.ZrcN git checkout release-X.Y.ZrcN scripts/release/release.sh release
Warning: If this process is interrupted for any reason, please check the following before running:
release-X.Y.ZrcN and master branch are restored to the previous clean state (without addtional release commits).git tag -d X.Y.Z), otherwise rerun will cause an error that complains the tag already exists.A CI job is uploading the release artifacts to GitHub. Look for the release workflow on https://buildkite.com/bazel-trusted/bazel-release/. Unblock the steps.
Ensure all binaries were uploaded to GitHub properly.
https://storage.googleapis.com/bazel/$RELEASE_NUMBER/release/index.html.Update the release bug:
Publish versioned documentation
Fetch the git tag for the release: git fetch --tags
Do a checkout to that tag: git checkout X.Y.Z
$ git checkout X.Y.Z Note: checking out 'X.Y.Z'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b <new-branch-name> HEAD is now at defd737761 Release X.Y.Z (yyyy-mm-dd)
Install gsutil and ensure you have access to the bazel-public GCP project.
Run scripts/docs/generate_versioned_docs.sh. If you get interrupted, it is safe to re-run the script. This script will build the web assets for the documentation, generate a tarball from them, and push the tarball to Google Cloud Storage.
Ping @fweikert to update the documentation site.
Merge the blog post pull request.
Update the release page to replace the generated notes with a link to the blog post.
Close the release-tracking bug.
Please ping @meteorcloudy to copy the release binary to their internal mirror.
Homebrew is a package manager for OS X. This section assumes that you are on a Mac OS machine with homebrew installed.
To update the bazel recipe on Homebrew, you can send a pull request to https://github.com/Homebrew/homebrew-core/blob/master/Formula/bazel.rb.
Example: https://github.com/Homebrew/homebrew-core/pull/57966
However, usually the Homebrew community takes care of this reasonably quickly, so feel free to skip this step, if you aren't familiar with it.
As of November 2016, this is done by an external contributor, @petemounce on GitHub. Ping him when there's a new release coming out.
As of February 2019, this is done by an external contributor, @excitoon on GitHub. Ping him when there's a new release coming out.
This is done by an external contributor, @vbatts on GitHub. Ping him when there's a new release coming out.