From 4413d9400c652c9660fa6664320ae9e71a4e023f Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Tue, 22 Oct 2024 12:25:53 -0700 Subject: [PATCH 1/3] doc how to create release branch for patch release --- DEVELOPING.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/DEVELOPING.md b/DEVELOPING.md index 0601be5478..349d980e8c 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -20,6 +20,8 @@ Start from a clean checkout at `main`. Before running through the release it's good to run the build and the tests locally, and make sure CI is passing. You can also test-drive the commit in an existing Bazel workspace to sanity check functionality. +### Releasing from HEAD + #### Steps 1. [Determine the next semantic version number](#determining-semantic-version) 1. Create a tag and push, e.g. `git tag 0.5.0 upstream/main && git push upstream --tags` @@ -38,9 +40,31 @@ To find if there were any features added or incompatible changes made, review the commit history. This can be done using github by going to the url: `https://github.com/bazelbuild/rules_python/compare/...main`. +### Patch release with cherry picks + +If a patch release from head would contain changes that aren't appropriate for +a patch release, then the patch release needs to be based on the original +release tag and the patch changes cherry-picked into it. + +In this example, release `0.37.0` is being patched to create release `0.37.1`. +The fix being included is commit `deadbeef`. + +1. `git checkout -b release/0.37 0.37.0` +1. `git push upstream release/0.37` +1. `git cherry-pick deadbeef` +1. Fix merge conflicts, if any. If `MODULE.bazel.lock` conflicts occur, then + run `tools/private/update_bzlmod_lockfiles.sh` +1. `git cherry-pick --continue` (if applicable) +1. `git push upstream` + +If multiple commits need to be applied, repeat the `git cherry-pick` step for +each. + +Once the release branch is in the desired state, use `git tag` to tag it, as +done with a release from head. Release automation will do the rest. + #### After release creation in Github -1. Ping @philwo to get the new release added to mirror.bazel.build. See [this comment on issue #400](https://github.com/bazelbuild/rules_python/issues/400#issuecomment-779159530) for more context. 1. Announce the release in the #python channel in the Bazel slack (bazelbuild.slack.com). ## Secrets From e9dca20480d2310e923148b3c96cd9d289250d4c Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Tue, 22 Oct 2024 21:33:21 -0700 Subject: [PATCH 2/3] Update DEVELOPING.md Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com> --- DEVELOPING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVELOPING.md b/DEVELOPING.md index 349d980e8c..de1cc20987 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -53,7 +53,7 @@ The fix being included is commit `deadbeef`. 1. `git push upstream release/0.37` 1. `git cherry-pick deadbeef` 1. Fix merge conflicts, if any. If `MODULE.bazel.lock` conflicts occur, then - run `tools/private/update_bzlmod_lockfiles.sh` + run `pre-commit run update-bzlmod-lockfiles -a` 1. `git cherry-pick --continue` (if applicable) 1. `git push upstream` From 9974f4fff18ecead3a9b851a3e56232ad3d433df Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Wed, 23 Oct 2024 09:56:34 -0700 Subject: [PATCH 3/3] add -x to cherry pick --- DEVELOPING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVELOPING.md b/DEVELOPING.md index de1cc20987..f1bd337fa2 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -51,7 +51,7 @@ The fix being included is commit `deadbeef`. 1. `git checkout -b release/0.37 0.37.0` 1. `git push upstream release/0.37` -1. `git cherry-pick deadbeef` +1. `git cherry-pick -x deadbeef` 1. Fix merge conflicts, if any. If `MODULE.bazel.lock` conflicts occur, then run `pre-commit run update-bzlmod-lockfiles -a` 1. `git cherry-pick --continue` (if applicable)