From de9a05e29c3dc2f4cf9df3314c3abdb4f5de1e7e Mon Sep 17 00:00:00 2001 From: keertk <110264242+keertk@users.noreply.github.com> Date: Wed, 11 Jan 2023 13:48:09 -0800 Subject: [PATCH 01/27] Add more detail to release steps --- docs/release.md | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/docs/release.md b/docs/release.md index 3d61851..264dc05 100644 --- a/docs/release.md +++ b/docs/release.md @@ -12,16 +12,23 @@ more details about how the process works, see [Behind the java_tools release process](behind-the-release.md). 1. Create a new tracking issue for the release in this repository and add the -`release` label. See [#7](https://github.com/bazelbuild/java_tools/issues/7) as +`release` label. See [#59](https://github.com/bazelbuild/java_tools/issues/59) as an example. -2. Trigger a new build of the [`java_tools binaries pipeline`](https://buildkite.com/bazel-trusted/java-tools-binaries-java). +2. Trigger a new build of the [`java_tools binaries pipeline`](https://buildkite.com/bazel-trusted/java-tools-binaries-java). Set the message field to "java_tools release [version] [rc]". See [example](https://buildkite.com/bazel-trusted/java-tools-binaries-java/builds/189). 3. Identify and set the following environment variables: * `COMMIT_HASH` the commit hash where the pipeline was run (see below) - * `NEW_VERSION` the new version number you’re trying to release (e.g. `3.1`) + * `NEW_VERSION` the new version number you’re trying to release (e.g. `11.09`) * `RC` the number of the current release candidate -4. Create a new release candidate by running the command below from the bazel repo: + For example: + ``` + EXPORT COMMIT_HASH=7bd0ab63a8441c3f3d7f495d09ed2bed38762874 + EXPORT NEW_VERSION=11.09 + EXPORT RC=1 + ``` + +4. Create a new release candidate by running the command below from the [bazel](https://github.com/bazelbuild/bazel) repo: ``` src/create_java_tools_release.sh \ @@ -32,12 +39,32 @@ an example. The script will output the sha256sum of the rc artifacts for linux, darwin and windows. + + Sample output: + ``` + $ src/create_java_tools_release.sh --commit_hash 7bd0ab63a8441c3f3d7f495d09ed2bed38762874 --java_tools_version 11.9 --rc 1 --release false + + release_candidates/java/v11.9/java_tools_linux-v11.9-rc1.zip 512582cac5b7ea7974a77b0da4581b21f546c9478f206eedf54687eeac035989 + release_candidates/java/v11.9/java_tools_windows-v11.9-rc1.zip 677ab910046205020fd715489147c2bcfad8a35d9f5d94fdc998d217545bd87a + release_candidates/java/v11.9/java_tools_darwin-v11.9-rc1.zip b9e962c6a836ba1d7573f2473fab3a897c6370d4c2724bde4017b40932ff4fe4 + release_candidates/java/v11.9/java_tools-v11.9-rc1.zip 5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d + ``` -5. Create a new bazel Pull Request that updates the `java_tools` archives (file -[distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl)) -with the new release candidates. -The PR triggers the CI presubmit. +5. Create a new bazel Pull Request that updates the `java_tools` archives (file [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl)) with the new release candidates. The PR triggers the CI presubmit. + * Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl) by updating the `archive`, `sha256`, and `urls` fields for `remote_java_tools` with the correct version, rc, sha256sum, and url (see output from step 4) + + Example: + ``` + "archive": "java_tools-v11.9-rc1.zip", + "sha256": "5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v11.9/java_tools-v11.9-rc1.zip", + ], + ``` + + * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, and `remote_java_tools_darwin` + * See [#16865](https://github.com/bazelbuild/bazel/pull/16865) for reference 6. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Using `pull/PRNUMBER/head` for the branch. From 79270971a8925c076bc7620df4f15b4215b84fd0 Mon Sep 17 00:00:00 2001 From: keertk <110264242+keertk@users.noreply.github.com> Date: Fri, 13 Jan 2023 14:42:25 -0800 Subject: [PATCH 02/27] More details to step 6 + other fixes --- docs/release.md | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/docs/release.md b/docs/release.md index 264dc05..1384b52 100644 --- a/docs/release.md +++ b/docs/release.md @@ -64,22 +64,42 @@ an example. ``` * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, and `remote_java_tools_darwin` - * See [#16865](https://github.com/bazelbuild/bazel/pull/16865) for reference + * See [#16865](https://github.com/bazelbuild/bazel/pull/16865) for reference ([this](https://github.com/bazelbuild/bazel/pull/16865/commits/5e1a96221828b91eef634a2087e63d056fb2b146) commit) -6. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. - Using `pull/PRNUMBER/head` for the branch. +6. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). 1. If the CI finishes successfully: - - create the release artifacts from the - release candidate: - ``` - src/create_java_tools_release.sh \ - --java_tools_version $NEW_VERSION \ - --rc $RC --release true - ``` - - update the urls of the `http_archive`s in the upgrade PR and send it for - review. + - create the release artifacts from the release candidate: + ``` + src/create_java_tools_release.sh \ + --java_tools_version $NEW_VERSION \ + --rc $RC --release true + ``` + The script will output the sha256sum of the rc artifacts for linux, darwin and windows. + + Sample output: + ``` + $ src/create_java_tools_release.sh --commit_hash 7bd0ab63a8441c3f3d7f495d09ed2bed38762874 --java_tools_version 11.9 --rc 1 --release true + + releases/java/v11.9/java_tools_linux-v11.9.zip 512582cac5b7ea7974a77b0da4581b21f546c9478f206eedf54687eeac035989 + releases/java/v11.9/java_tools_windows-v11.9.zip 677ab910046205020fd715489147c2bcfad8a35d9f5d94fdc998d217545bd87a + releases/java/v11.9/java_tools_darwin-v11.9.zip b9e962c6a836ba1d7573f2473fab3a897c6370d4c2724bde4017b40932ff4fe4 + releases/java/v11.9/java_tools-v11.9.zip 5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d + ``` + + - Return to your PR and update the update the `archive`, `sha256`, and `urls` fields again (see step 5 above for reference). See [#16865](https://github.com/bazelbuild/bazel/pull/16865) ([this](https://github.com/bazelbuild/bazel/pull/16865/commits/863b71d654dfefa52f81ed986a83766e3aade2d4) commit). + + Example: + ``` + "archive": "java_tools-v11.9.zip", + "sha256": "5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.9/java_tools-v11.9.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools-v11.9.zip", + ], + ``` + - Send the PR for review and assign `@comius` and `@hvadehra` 2. If the CI finishes unsuccessfully find the reasons why the CI is failing - and file bugs. After the bugs are fixed start all over again creating the + and file bugs. After the bugs are fixed start all over again from step 2 and create the next release candidate. This case is highly unlikely because bazel already tests the `java_tools` built at head. From b9a3fd12cb4ecc5815602bade27794df646643c0 Mon Sep 17 00:00:00 2001 From: keertk <110264242+keertk@users.noreply.github.com> Date: Thu, 19 Jan 2023 10:37:38 -0800 Subject: [PATCH 03/27] Document missing steps in part 6 --- docs/release.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/docs/release.md b/docs/release.md index 1384b52..cce8ae3 100644 --- a/docs/release.md +++ b/docs/release.md @@ -98,7 +98,59 @@ an example. "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools-v11.9.zip", ], ``` - - Send the PR for review and assign `@comius` and `@hvadehra` + - Update the release in the java_tools [releases page](https://github.com/bazelbuild/java_tools/releases) + - Create on "Draft a new release" + - Set tag to java_v[version number], e.g. java_v11.09 + - Set target to master + - Add the name, sha256, and urls to the description + + Example: + ``` + To use this java_tools release, add to your WORKSPACE file the definitions: + + http_archive( + name = "remote_java_tools", + sha256 = "5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d", + urls = [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.9/java_tools-v11.9.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools-v11.9.zip", + ], + ) + + http_archive( + name = "remote_java_tools_linux", + sha256 = "512582cac5b7ea7974a77b0da4581b21f546c9478f206eedf54687eeac035989", + urls = [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.9/java_tools_linux-v11.9.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools_linux-v11.9.zip", + ], + ) + + http_archive( + name = "remote_java_tools_windows", + sha256 = "677ab910046205020fd715489147c2bcfad8a35d9f5d94fdc998d217545bd87a", + urls = [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.9/java_tools_windows-v11.9.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools_windows-v11.9.zip", + ], + ) + + http_archive( + name = "remote_java_tools_darwin", + sha256 = "b9e962c6a836ba1d7573f2473fab3a897c6370d4c2724bde4017b40932ff4fe4", + urls = [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.9/java_tools_darwin-v11.9.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools_darwin-v11.9.zip", + ], + ) + ``` + + - Download the 4 .zip files from mirror.bazel.build/bazel_java_tools/releases + - Set as the latest release + - Refer to [this example](https://github.com/bazelbuild/java_tools/releases/tag/java_v11.9) + + - Update package_version, see [example](https://github.com/bazelbuild/bazel/pull/17203/commits/308ed35f45e82163a84313ef67610a32198f6555) + - After making sure presubmits pass, send the PR for review and assign `@comius` and `@hvadehra` 2. If the CI finishes unsuccessfully find the reasons why the CI is failing and file bugs. After the bugs are fixed start all over again from step 2 and create the next release candidate. This case is highly unlikely because bazel already From 1306ae8cd1791b9fd192c4a6b042083e232922a3 Mon Sep 17 00:00:00 2001 From: keertk <110264242+keertk@users.noreply.github.com> Date: Thu, 19 Jan 2023 10:43:57 -0800 Subject: [PATCH 04/27] Update release.md --- docs/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release.md b/docs/release.md index cce8ae3..3451d61 100644 --- a/docs/release.md +++ b/docs/release.md @@ -145,7 +145,7 @@ an example. ) ``` - - Download the 4 .zip files from mirror.bazel.build/bazel_java_tools/releases + - Download the 4 .zip files from mirror.bazel.build/bazel_java_tools/releases and attach them to the release - Set as the latest release - Refer to [this example](https://github.com/bazelbuild/java_tools/releases/tag/java_v11.9) From 18d9f10719aa672aebafea81a84514f0c9d6ced2 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 3 Feb 2023 08:22:45 -0800 Subject: [PATCH 05/27] Automatic code cleanup. PiperOrigin-RevId: 506908397 Change-Id: I2aa555f421d19a816e8e70f0ffe6ccdde757ded8 --- BUILD | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BUILD b/BUILD index 001dcb9..f92ce7f 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,14 @@ -package(default_visibility = ["//visibility:public"]) +load("//tools/build_defs/license:license.bzl", "license") + +package( + default_applicable_licenses = ["//third_party/bazel_rules/java_tools:license"], + default_visibility = ["//visibility:public"], +) + +license( + name = "license", + package_name = "java_tools", +) licenses(["notice"]) From 5a26527475b1759b2fd2b99904008f931acd3fc9 Mon Sep 17 00:00:00 2001 From: keertk <110264242+keertk@users.noreply.github.com> Date: Tue, 7 Feb 2023 06:37:57 -0800 Subject: [PATCH 06/27] Update with suggested changes --- docs/release.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/release.md b/docs/release.md index 3451d61..71520b3 100644 --- a/docs/release.md +++ b/docs/release.md @@ -22,15 +22,15 @@ an example. * `RC` the number of the current release candidate For example: - ``` - EXPORT COMMIT_HASH=7bd0ab63a8441c3f3d7f495d09ed2bed38762874 - EXPORT NEW_VERSION=11.09 - EXPORT RC=1 + ```bash + export COMMIT_HASH=7bd0ab63a8441c3f3d7f495d09ed2bed38762874 + export NEW_VERSION=11.09 + export RC=1 ``` 4. Create a new release candidate by running the command below from the [bazel](https://github.com/bazelbuild/bazel) repo: - ``` + ```bash src/create_java_tools_release.sh \ --commit_hash $COMMIT_HASH \ --java_tools_version $NEW_VERSION \ @@ -41,7 +41,7 @@ an example. and windows. Sample output: - ``` + ```bash $ src/create_java_tools_release.sh --commit_hash 7bd0ab63a8441c3f3d7f495d09ed2bed38762874 --java_tools_version 11.9 --rc 1 --release false release_candidates/java/v11.9/java_tools_linux-v11.9-rc1.zip 512582cac5b7ea7974a77b0da4581b21f546c9478f206eedf54687eeac035989 @@ -55,7 +55,7 @@ an example. * Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl) by updating the `archive`, `sha256`, and `urls` fields for `remote_java_tools` with the correct version, rc, sha256sum, and url (see output from step 4) Example: - ``` + ```starlark "archive": "java_tools-v11.9-rc1.zip", "sha256": "5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d", "urls": [ @@ -70,7 +70,7 @@ an example. 1. If the CI finishes successfully: - create the release artifacts from the release candidate: - ``` + ```bash src/create_java_tools_release.sh \ --java_tools_version $NEW_VERSION \ --rc $RC --release true @@ -78,7 +78,7 @@ an example. The script will output the sha256sum of the rc artifacts for linux, darwin and windows. Sample output: - ``` + ```bash $ src/create_java_tools_release.sh --commit_hash 7bd0ab63a8441c3f3d7f495d09ed2bed38762874 --java_tools_version 11.9 --rc 1 --release true releases/java/v11.9/java_tools_linux-v11.9.zip 512582cac5b7ea7974a77b0da4581b21f546c9478f206eedf54687eeac035989 @@ -90,7 +90,7 @@ an example. - Return to your PR and update the update the `archive`, `sha256`, and `urls` fields again (see step 5 above for reference). See [#16865](https://github.com/bazelbuild/bazel/pull/16865) ([this](https://github.com/bazelbuild/bazel/pull/16865/commits/863b71d654dfefa52f81ed986a83766e3aade2d4) commit). Example: - ``` + ```starlark "archive": "java_tools-v11.9.zip", "sha256": "5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d", "urls": [ From afdda128a2cbf6a0af20a7b2bdb8c7962b025d33 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 22 Feb 2023 02:26:24 -0800 Subject: [PATCH 07/27] Automatic code cleanup. PiperOrigin-RevId: 511437132 Change-Id: I5ce4334b597c2c05ef0f824d8d1ff0be921c4ab6 --- BUILD | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/BUILD b/BUILD index f92ce7f..001dcb9 100644 --- a/BUILD +++ b/BUILD @@ -1,14 +1,4 @@ -load("//tools/build_defs/license:license.bzl", "license") - -package( - default_applicable_licenses = ["//third_party/bazel_rules/java_tools:license"], - default_visibility = ["//visibility:public"], -) - -license( - name = "license", - package_name = "java_tools", -) +package(default_visibility = ["//visibility:public"]) licenses(["notice"]) From 265667f4023b0e80ccf9ff3de16014f24e47d174 Mon Sep 17 00:00:00 2001 From: kshyanashree <109167932+kshyanashree@users.noreply.github.com> Date: Fri, 3 Mar 2023 10:53:48 -0800 Subject: [PATCH 08/27] java_tools Updates in rules_java repo --- docs/release.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/release.md b/docs/release.md index 71520b3..1f04018 100644 --- a/docs/release.md +++ b/docs/release.md @@ -151,7 +151,13 @@ an example. - Update package_version, see [example](https://github.com/bazelbuild/bazel/pull/17203/commits/308ed35f45e82163a84313ef67610a32198f6555) - After making sure presubmits pass, send the PR for review and assign `@comius` and `@hvadehra` - 2. If the CI finishes unsuccessfully find the reasons why the CI is failing + 2. Update the version of the java_tools here in rules_java repository: + https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl#L22-L61. + After making the changes, submit the PR and it will add `@comius` and `@java team` as a reviewer. + Refer to [this example] (https://github.com/bazelbuild/rules_java/pull/87) + + 3. If the CI finishes unsuccessfully find the reasons why the CI is failing and file bugs. After the bugs are fixed start all over again from step 2 and create the next release candidate. This case is highly unlikely because bazel already tests the `java_tools` built at head. + From ac541a78fb4156b940d194aee338e9c777be709c Mon Sep 17 00:00:00 2001 From: keertk <110264242+keertk@users.noreply.github.com> Date: Fri, 3 Mar 2023 11:20:47 -0800 Subject: [PATCH 09/27] Reword instructions to update java_tools_repos() --- docs/release.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/release.md b/docs/release.md index 1f04018..f26154a 100644 --- a/docs/release.md +++ b/docs/release.md @@ -151,10 +151,7 @@ an example. - Update package_version, see [example](https://github.com/bazelbuild/bazel/pull/17203/commits/308ed35f45e82163a84313ef67610a32198f6555) - After making sure presubmits pass, send the PR for review and assign `@comius` and `@hvadehra` - 2. Update the version of the java_tools here in rules_java repository: - https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl#L22-L61. - After making the changes, submit the PR and it will add `@comius` and `@java team` as a reviewer. - Refer to [this example] (https://github.com/bazelbuild/rules_java/pull/87) + - Make the corresponding updates to [java_tools_repos()](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl#L22-L61) in the repositories.bzl file in the rules_java repository. Refer to [this example](https://github.com/bazelbuild/rules_java/pull/87). 3. If the CI finishes unsuccessfully find the reasons why the CI is failing and file bugs. After the bugs are fixed start all over again from step 2 and create the From 575ff4aa0e479664db8727cda6a9401790eca923 Mon Sep 17 00:00:00 2001 From: hvadehra Date: Fri, 17 Mar 2023 13:37:32 +0100 Subject: [PATCH 10/27] Update release playbook Adds change around separate repositories for darwin (x86_64 and arm64) --- docs/release.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/release.md b/docs/release.md index f26154a..c322b30 100644 --- a/docs/release.md +++ b/docs/release.md @@ -46,7 +46,8 @@ an example. release_candidates/java/v11.9/java_tools_linux-v11.9-rc1.zip 512582cac5b7ea7974a77b0da4581b21f546c9478f206eedf54687eeac035989 release_candidates/java/v11.9/java_tools_windows-v11.9-rc1.zip 677ab910046205020fd715489147c2bcfad8a35d9f5d94fdc998d217545bd87a - release_candidates/java/v11.9/java_tools_darwin-v11.9-rc1.zip b9e962c6a836ba1d7573f2473fab3a897c6370d4c2724bde4017b40932ff4fe4 + release_candidates/java/v11.9/java_tools_darwin_x86_64-v11.9-rc1.zip b9e962c6a836ba1d7573f2473fab3a897c6370d4c2724bde4017b40932ff4fe4 + release_candidates/java/v11.9/java_tools_darwin_arm64-v11.9-rc1.zip 3a897c6370d4c2724bde4017b40932ff4fe4b9e962c6a836ba1d7573f2473fab release_candidates/java/v11.9/java_tools-v11.9-rc1.zip 5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d ``` @@ -63,8 +64,8 @@ an example. ], ``` - * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, and `remote_java_tools_darwin` - * See [#16865](https://github.com/bazelbuild/bazel/pull/16865) for reference ([this](https://github.com/bazelbuild/bazel/pull/16865/commits/5e1a96221828b91eef634a2087e63d056fb2b146) commit) + * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, `remote_java_tools_darwin_x86_64` and `remote_java_tools_darwin_arm64` + * See [#16865](https://github.com/bazelbuild/bazel/pull/17802) for reference ([this](https://github.com/bazelbuild/bazel/pull/17802/commits/8678754e0b1c19269f4974d80ef66e8aeb7d4fb3) commit) 6. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). @@ -83,11 +84,12 @@ an example. releases/java/v11.9/java_tools_linux-v11.9.zip 512582cac5b7ea7974a77b0da4581b21f546c9478f206eedf54687eeac035989 releases/java/v11.9/java_tools_windows-v11.9.zip 677ab910046205020fd715489147c2bcfad8a35d9f5d94fdc998d217545bd87a - releases/java/v11.9/java_tools_darwin-v11.9.zip b9e962c6a836ba1d7573f2473fab3a897c6370d4c2724bde4017b40932ff4fe4 + releases/java/v11.9/java_tools_darwin_x86_64-v11.9.zip b9e962c6a836ba1d7573f2473fab3a897c6370d4c2724bde4017b40932ff4fe4 + releases/java/v11.9/java_tools_darwin_arm64-v11.9.zip 3a897c6370d4c2724bde4017b40932ff4fe4b9e962c6a836ba1d7573f2473fab releases/java/v11.9/java_tools-v11.9.zip 5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d ``` - - Return to your PR and update the update the `archive`, `sha256`, and `urls` fields again (see step 5 above for reference). See [#16865](https://github.com/bazelbuild/bazel/pull/16865) ([this](https://github.com/bazelbuild/bazel/pull/16865/commits/863b71d654dfefa52f81ed986a83766e3aade2d4) commit). + - Return to your PR and update the update the `archive`, `sha256`, and `urls` fields again (see step 5 above for reference). See [#16865](https://github.com/bazelbuild/bazel/pull/17802) ([this](https://github.com/bazelbuild/bazel/pull/17802/commits/67283b90fb69bd011531221ecebb70a863502dbc) commit). Example: ```starlark @@ -136,11 +138,20 @@ an example. ) http_archive( - name = "remote_java_tools_darwin", + name = "remote_java_tools_darwin_x86_64", sha256 = "b9e962c6a836ba1d7573f2473fab3a897c6370d4c2724bde4017b40932ff4fe4", urls = [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.9/java_tools_darwin-v11.9.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools_darwin-v11.9.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.9/java_tools_darwin_x86_64-v11.9.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools_darwin_x86_64-v11.9.zip", + ], + ) + + http_archive( + name = "remote_java_tools_darwin_arm64", + sha256 = "3a897c6370d4c2724bde4017b40932ff4fe4b9e962c6a836ba1d7573f2473fab", + urls = [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.9/java_tools_darwin_arm64-v11.9.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools_darwin_arm64-v11.9.zip", ], ) ``` From 35ad400062033513e0655a919809522e42673cfc Mon Sep 17 00:00:00 2001 From: keertk Date: Wed, 21 Jun 2023 22:37:53 +0530 Subject: [PATCH 11/27] Update playbook with new release process --- docs/release.md | 73 +++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/docs/release.md b/docs/release.md index c322b30..691b127 100644 --- a/docs/release.md +++ b/docs/release.md @@ -11,10 +11,8 @@ a new java_tools version. To understand the mechanism behind these steps and for more details about how the process works, see [Behind the java_tools release process](behind-the-release.md). -1. Create a new tracking issue for the release in this repository and add the -`release` label. See [#59](https://github.com/bazelbuild/java_tools/issues/59) as -an example. -2. Trigger a new build of the [`java_tools binaries pipeline`](https://buildkite.com/bazel-trusted/java-tools-binaries-java). Set the message field to "java_tools release [version] [rc]". See [example](https://buildkite.com/bazel-trusted/java-tools-binaries-java/builds/189). +1. Create a new tracking issue for the release in this repository and add the `release` label. See [#59](https://github.com/bazelbuild/java_tools/issues/59) as an example. +2. Trigger a new build of the [`java_tools binaries pipeline`](https://buildkite.com/bazel-trusted/java-tools-binaries-java). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". See [example](https://buildkite.com/bazel-trusted/java-tools-binaries-java/builds/189). 3. Identify and set the following environment variables: * `COMMIT_HASH` the commit hash where the pipeline was run (see below) @@ -51,26 +49,32 @@ an example. release_candidates/java/v11.9/java_tools-v11.9-rc1.zip 5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d ``` -5. Create a new bazel Pull Request that updates the `java_tools` archives (file [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl)) with the new release candidates. The PR triggers the CI presubmit. +5. Create a new branch in the [rules_java](https://github.com/bazelbuild/rules_java) repository + + * Name the branch `java_v[version number]`, e.g. `java_v11.09` + * Edit [java_tools_repos()](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl#L22-L73) by updating the `sha256` and `urls` fields for `remote_java_tools` with the correct version, rc, sha256sum, and url (see output from step 4) - * Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl) by updating the `archive`, `sha256`, and `urls` fields for `remote_java_tools` with the correct version, rc, sha256sum, and url (see output from step 4) - Example: ```starlark - "archive": "java_tools-v11.9-rc1.zip", - "sha256": "5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d", - "urls": [ - "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v11.9/java_tools-v11.9-rc1.zip", - ], + maybe( + http_archive, + name = "remote_java_tools", + sha256 = "5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d", + urls = [ + "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v11.9/java_tools-v11.9-rc1.zip", + ], + ) ``` - * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, `remote_java_tools_darwin_x86_64` and `remote_java_tools_darwin_arm64` - * See [#16865](https://github.com/bazelbuild/bazel/pull/17802) for reference ([this](https://github.com/bazelbuild/bazel/pull/17802/commits/8678754e0b1c19269f4974d80ef66e8aeb7d4fb3) commit) + * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, `remote_java_tools_darwin_x86_64` and `remote_java_tools_darwin_arm64` + +6. Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65) in the Bazel repository by updating the `archive`, `sha256`, and `urls` fields with the updates made to the new branch (step 5). Create a new pull request - **example PR coming soon**. The PR triggers the CI presubmit. -6. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). +7. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). - 1. If the CI finishes successfully: - - create the release artifacts from the release candidate: + 1. Check the results of the build to confirm that there are no new failures (i.e. all failures also appear at HEAD). To do this, compare the results to the latest run [here](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds?branch=master). + 2. If the CI finishes successfully: + - Create the release artifacts from the release candidate: ```bash src/create_java_tools_release.sh \ --java_tools_version $NEW_VERSION \ @@ -87,21 +91,10 @@ an example. releases/java/v11.9/java_tools_darwin_x86_64-v11.9.zip b9e962c6a836ba1d7573f2473fab3a897c6370d4c2724bde4017b40932ff4fe4 releases/java/v11.9/java_tools_darwin_arm64-v11.9.zip 3a897c6370d4c2724bde4017b40932ff4fe4b9e962c6a836ba1d7573f2473fab releases/java/v11.9/java_tools-v11.9.zip 5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d - ``` + ``` - - Return to your PR and update the update the `archive`, `sha256`, and `urls` fields again (see step 5 above for reference). See [#16865](https://github.com/bazelbuild/bazel/pull/17802) ([this](https://github.com/bazelbuild/bazel/pull/17802/commits/67283b90fb69bd011531221ecebb70a863502dbc) commit). - - Example: - ```starlark - "archive": "java_tools-v11.9.zip", - "sha256": "5cd59ea6bf938a1efc1e11ea562d37b39c82f76781211b7cd941a2346ea8484d", - "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.9/java_tools-v11.9.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.9/java_tools-v11.9.zip", - ], - ``` - Update the release in the java_tools [releases page](https://github.com/bazelbuild/java_tools/releases) - - Create on "Draft a new release" + - Click on "Draft a new release" - Set tag to java_v[version number], e.g. java_v11.09 - Set target to master - Add the name, sha256, and urls to the description @@ -156,16 +149,18 @@ an example. ) ``` - - Download the 4 .zip files from mirror.bazel.build/bazel_java_tools/releases and attach them to the release + - Download the 5 .zip files from the updated https://mirror.bazel.build URLs above and attach them to the release - Set as the latest release - Refer to [this example](https://github.com/bazelbuild/java_tools/releases/tag/java_v11.9) + + - Return to the rules_java repository and create a PR to update [java_tools_repos()](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl#L22-L73) with the latest java_tools versions. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. - - Update package_version, see [example](https://github.com/bazelbuild/bazel/pull/17203/commits/308ed35f45e82163a84313ef67610a32198f6555) - - After making sure presubmits pass, send the PR for review and assign `@comius` and `@hvadehra` - - Make the corresponding updates to [java_tools_repos()](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl#L22-L61) in the repositories.bzl file in the rules_java repository. Refer to [this example](https://github.com/bazelbuild/rules_java/pull/87). - - 3. If the CI finishes unsuccessfully find the reasons why the CI is failing - and file bugs. After the bugs are fixed start all over again from step 2 and create the - next release candidate. This case is highly unlikely because bazel already - tests the `java_tools` built at head. + - Follow the steps [here](https://github.com/bazelbuild/rules_java/tree/master/distro) to release a new version of rules_java. Reach out to `@hvadhera` to decide/confirm the version number bump. + + - Update Bazel with the final rules_java version by editing the following files. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. + - https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65 + - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools#L4 + - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel#L19 + + 3. If the CI finishes unsuccessfully find the reasons why the CI is failing and file bugs. After the bugs are fixed start all over again from step 2 and create the next release candidate. This case is highly unlikely because Bazel already tests the `java_tools` built at head. From 0dffcf5a3ca8e3d54539a64fef2d89a87b5b9270 Mon Sep 17 00:00:00 2001 From: keertk Date: Thu, 22 Jun 2023 15:50:23 +0530 Subject: [PATCH 12/27] Update step 6 --- docs/release.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/release.md b/docs/release.md index 691b127..dd87233 100644 --- a/docs/release.md +++ b/docs/release.md @@ -68,7 +68,20 @@ more details about how the process works, see * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, `remote_java_tools_darwin_x86_64` and `remote_java_tools_darwin_arm64` -6. Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65) in the Bazel repository by updating the `archive`, `sha256`, and `urls` fields with the updates made to the new branch (step 5). Create a new pull request - **example PR coming soon**. The PR triggers the CI presubmit. +6. Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65) in the Bazel repository and create a new pull request. This PR will trigger the CI presubmit. + + * Get the commit hash for the changes made in step 5 (e.g. `56220853b2d75c478dd1ee71ba7cd0e46363700f`) + * Download the tar.gz file at `https://github.com/bazelbuild/rules_java/archive/.tar.gz` + * Run `shasum -a 256 ` + * Update the following fields (note: add `strip_prefix`) + + Example: + ```starlark + "archive": "56220853b2d75c478dd1ee71ba7cd0e46363700f.tar.gz", + "sha256": "0f65c471b99c79e97dd18a3571d3707b4dbfc31ff8e9bf7083a09aae0adb7b5e", + "strip_prefix": "rules_java-56220853b2d75c478dd1ee71ba7cd0e46363700f", + "urls": ["https://github.com/meteorcloudy/rules_java/archive/56220853b2d75c478dd1ee71ba7cd0e46363700f.tar.gz"], + ``` 7. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). From 0df9c05f9971959ffe10144e9ee953d421845d17 Mon Sep 17 00:00:00 2001 From: keertk Date: Thu, 22 Jun 2023 20:37:39 +0530 Subject: [PATCH 13/27] Update url Co-authored-by: Yun Peng --- docs/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release.md b/docs/release.md index dd87233..4d4d66b 100644 --- a/docs/release.md +++ b/docs/release.md @@ -80,7 +80,7 @@ more details about how the process works, see "archive": "56220853b2d75c478dd1ee71ba7cd0e46363700f.tar.gz", "sha256": "0f65c471b99c79e97dd18a3571d3707b4dbfc31ff8e9bf7083a09aae0adb7b5e", "strip_prefix": "rules_java-56220853b2d75c478dd1ee71ba7cd0e46363700f", - "urls": ["https://github.com/meteorcloudy/rules_java/archive/56220853b2d75c478dd1ee71ba7cd0e46363700f.tar.gz"], + "urls": ["https://github.com/bazelbuild/rules_java/archive/56220853b2d75c478dd1ee71ba7cd0e46363700f.tar.gz"], ``` 7. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). From 12bb71677cb72a6b0a85f0f841f7b6885141e842 Mon Sep 17 00:00:00 2001 From: keertk Date: Mon, 17 Jul 2023 12:38:09 -0700 Subject: [PATCH 14/27] Add more steps to the release playbook --- docs/release.md | 63 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/docs/release.md b/docs/release.md index 4d4d66b..e746fee 100644 --- a/docs/release.md +++ b/docs/release.md @@ -66,22 +66,47 @@ more details about how the process works, see ) ``` - * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, `remote_java_tools_darwin_x86_64` and `remote_java_tools_darwin_arm64` + * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, `remote_java_tools_darwin_x86_64` and `remote_java_tools_darwin_arm64` + * Refer to [this example](https://github.com/bazelbuild/rules_java/commit/d1196d250c17dfffed52db13c75d4f9b9cd20617) 6. Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65) in the Bazel repository and create a new pull request. This PR will trigger the CI presubmit. - * Get the commit hash for the changes made in step 5 (e.g. `56220853b2d75c478dd1ee71ba7cd0e46363700f`) - * Download the tar.gz file at `https://github.com/bazelbuild/rules_java/archive/.tar.gz` - * Run `shasum -a 256 ` - * Update the following fields (note: add `strip_prefix`) - - Example: - ```starlark - "archive": "56220853b2d75c478dd1ee71ba7cd0e46363700f.tar.gz", - "sha256": "0f65c471b99c79e97dd18a3571d3707b4dbfc31ff8e9bf7083a09aae0adb7b5e", - "strip_prefix": "rules_java-56220853b2d75c478dd1ee71ba7cd0e46363700f", - "urls": ["https://github.com/bazelbuild/rules_java/archive/56220853b2d75c478dd1ee71ba7cd0e46363700f.tar.gz"], - ``` + * Get the commit hash for the changes made in step 5 (e.g. `d1196d250c17dfffed52db13c75d4f9b9cd20617` for [this commit](https://github.com/bazelbuild/rules_java/commit/d1196d250c17dfffed52db13c75d4f9b9cd20617)) + * Download the tar.gz file at `https://github.com/bazelbuild/rules_java/archive/.tar.gz` + * Run `shasum -a 256 ` + * Update the following fields (note: add `strip_prefix`) + + Example: + ```starlark + "archive": "d1196d250c17dfffed52db13c75d4f9b9cd20617.tar.gz", + "sha256": "0f65c471b99c79e97dd18a3571d3707b4dbfc31ff8e9bf7083a09aae0adb7b5e", + "strip_prefix": "rules_java-d1196d250c17dfffed52db13c75d4f9b9cd20617", + "urls": ["https://github.com/bazelbuild/rules_java/archive/d1196d250c17dfffed52db13c75d4f9b9cd20617.tar.gz"], + ``` + + * Refer to [this PR](https://github.com/bazelbuild/bazel/pull/18902) (specifically [this commit](https://github.com/bazelbuild/bazel/pull/18902/commits/26ea92bfa57c2706c10c82714ff9a3094c6a39ad)) + * Add archive_override to MODULE.bazel + * To calculate the `integrity` value of the source archive, do: + + ```bash + $ git clone https://github.com/bazelbuild/bazel-central-registry.git + $ cd bazel-central-registry + $ python3 ./tools/calc_integrity.py https://github.com/bazelbuild/rules_java/archive/d1196d250c17dfffed52db13c75d4f9b9cd20617.tar.gz + ``` + + * Add archive_override with the `integrity` and commit hash from above + + Example: + ```starlark + archive_override( + module_name = "rules_java", + urls = ["https://github.com/bazelbuild/rules_java/archive/d1196d250c17dfffed52db13c75d4f9b9cd20617.tar.gz"], + integrity = "sha256-4YvfBdBJhBvZNJh8nz0RRpdMI+CFuM4O8xRb3d1GinA=", + strip_prefix = "rules_java-d1196d250c17dfffed52db13c75d4f9b9cd20617", + ) + ``` + + * Refer to [this PR](https://github.com/bazelbuild/bazel/pull/18902) (specifically [this commit](https://github.com/bazelbuild/bazel/pull/18902/commits/642c32aa6e07d76654ac4210e7119e84e7bf2f82)) 7. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). @@ -166,14 +191,16 @@ more details about how the process works, see - Set as the latest release - Refer to [this example](https://github.com/bazelbuild/java_tools/releases/tag/java_v11.9) - - Return to the rules_java repository and create a PR to update [java_tools_repos()](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl#L22-L73) with the latest java_tools versions. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. + - Return to the rules_java repository and create a PR to update [java_tools_repos()](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl#L22-L73) with the latest java_tools versions. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this example](https://github.com/bazelbuild/rules_java/pull/119) (it also includes the 2 updates needed for the next step). - Follow the steps [here](https://github.com/bazelbuild/rules_java/tree/master/distro) to release a new version of rules_java. Reach out to `@hvadhera` to decide/confirm the version number bump. + - In order for checks to pass in the next step, the release must be mirrored to the Bazel Central Registry. Make sure that a PR is opened and approved in the BCR repository ([example](https://github.com/bazelbuild/bazel-central-registry/pull/774)) + - One time step: Add the `publish-to-bcr` app to your personal fork of `bazelbuild/bazel-central-registry`. Refer to the instructions [here](https://github.com/bazel-contrib/publish-to-bcr/blob/main/README.md). - - Update Bazel with the final rules_java version by editing the following files. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. - - https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65 - - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools#L4 - - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel#L19 + - Update Bazel with the final rules_java version by editing the following files. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/18902). + - https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/30aa092cfe50435ae370c4a4bc9938eff52ce3fb)) + - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools#L4 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/73c8858d5195f072bbb316a3bf1289de1646d91a)) + - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel#L19 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/5b30bc4f23037f5651063e24c1881328720d6bcb)). Remove the archive_override() method as well. 3. If the CI finishes unsuccessfully find the reasons why the CI is failing and file bugs. After the bugs are fixed start all over again from step 2 and create the next release candidate. This case is highly unlikely because Bazel already tests the `java_tools` built at head. From b2cfa478221f1c2571d2f961cff3b8e2088b193e Mon Sep 17 00:00:00 2001 From: keertk Date: Tue, 29 Aug 2023 17:50:40 -0700 Subject: [PATCH 15/27] Create release.py --- scripts/release.py | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 scripts/release.py diff --git a/scripts/release.py b/scripts/release.py new file mode 100644 index 0000000..5ca74c1 --- /dev/null +++ b/scripts/release.py @@ -0,0 +1,77 @@ +# Copyright 2022 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Script to get release notes + zip files to release java_tools.""" + +import argparse +import wget + +def get_artifact_breakdown(input): + artifacts = {} + input = input.split("\n") + for artifact in input: + dict = {} + info = artifact.split() + dict["path"] = path = info[0] + dict["sha"] = info[1] + name = path[path.find("/java_"):path.find("-v")][1:] + artifacts[name] = dict + return artifacts + +def get_version(artifacts): + path = artifacts["java_tools"]["path"] + version = path[path.find("/v"):path.find("/java_")][1:] + return version + +def generate_release_info(item, version, path, sha): + mirror_url = "https://mirror.bazel.build/bazel_java_tools/" + path + relnote = ("\n" + + "http_archive(\n" + " name = \"remote_" + item + "\",\n" + + " sha = \"" + sha + "\",\n" + + " urls = [\n" + + " \"" + mirror_url + "\",\n" + + " \"https://github.com/bazelbuild/java_tools/releases/download/java_" + version + "/" + item + "-" + version + ".zip\",\n" + " ],\n" + + ")") + return relnote, mirror_url + +def download_file(mirror_url): + wget.download(mirror_url , '.') + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument( + '--artifacts', + required=True, + dest='artifacts', + help='Output from create_java_tools_release.sh') + opts = parser.parse_args() + + artifacts = get_artifact_breakdown(opts.artifacts) + version = get_version(artifacts) + + relnotes = "To use this java_tools release, add to your WORKSPACE file the definitions: \n```py" + for item in artifacts: + relnote, mirror_url = generate_release_info(item, version, artifacts[item]["path"], artifacts[item]["sha"]) + relnotes += relnote + download_file(mirror_url) + + relnotes += "```" + with open('relnotes.txt', 'w') as f: + f.write(relnotes) + + +if __name__ == '__main__': + main() From d9d12b7e9afdfae374d6b0c566c5c59c72c9f6e2 Mon Sep 17 00:00:00 2001 From: keertk Date: Wed, 30 Aug 2023 18:22:30 -0700 Subject: [PATCH 16/27] Some updates --- scripts/release.py | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index 5ca74c1..711c124 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -16,33 +16,18 @@ import argparse import wget +import json -def get_artifact_breakdown(input): - artifacts = {} - input = input.split("\n") - for artifact in input: - dict = {} - info = artifact.split() - dict["path"] = path = info[0] - dict["sha"] = info[1] - name = path[path.find("/java_"):path.find("-v")][1:] - artifacts[name] = dict - return artifacts - -def get_version(artifacts): - path = artifacts["java_tools"]["path"] - version = path[path.find("/v"):path.find("/java_")][1:] - return version - -def generate_release_info(item, version, path, sha): +def generate_release_info(platform, version, path, sha): mirror_url = "https://mirror.bazel.build/bazel_java_tools/" + path + github_url = "https://github.com/bazelbuild/java_tools/releases/download/java_" + version + "/" + platform + "-" + version + ".zip" relnote = ("\n" + "http_archive(\n" - " name = \"remote_" + item + "\",\n" + + " name = \"remote_" + platform + "\",\n" + " sha = \"" + sha + "\",\n" + " urls = [\n" + - " \"" + mirror_url + "\",\n" + - " \"https://github.com/bazelbuild/java_tools/releases/download/java_" + version + "/" + item + "-" + version + ".zip\",\n" + " \"" + mirror_url + "\",\n" + + " \"" + github_url + "\",\n" + " ],\n" + ")") return relnote, mirror_url @@ -50,6 +35,11 @@ def generate_release_info(item, version, path, sha): def download_file(mirror_url): wget.download(mirror_url , '.') +def get_version(artifacts): + path = artifacts["java_tools"]["path"] + version = path[path.find("/v"):path.find("/java_")][1:] + return version + def main(): parser = argparse.ArgumentParser() parser.add_argument( @@ -59,12 +49,14 @@ def main(): help='Output from create_java_tools_release.sh') opts = parser.parse_args() - artifacts = get_artifact_breakdown(opts.artifacts) + artifacts = json.loads(opts.artifacts) version = get_version(artifacts) relnotes = "To use this java_tools release, add to your WORKSPACE file the definitions: \n```py" - for item in artifacts: - relnote, mirror_url = generate_release_info(item, version, artifacts[item]["path"], artifacts[item]["sha"]) + for platform in artifacts: + path = artifacts[platform]["path"] + sha = artifacts[platform]["sha"] + relnote, mirror_url = generate_release_info(platform, version, path, sha) relnotes += relnote download_file(mirror_url) From 5ceed834b83fad99390f755683cd44659bc62439 Mon Sep 17 00:00:00 2001 From: keertk Date: Sun, 10 Sep 2023 13:13:21 -0700 Subject: [PATCH 17/27] Updates after modifying the output of create_java_tools_release.sh --- scripts/release.py | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index 711c124..95d6268 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -18,28 +18,20 @@ import wget import json -def generate_release_info(platform, version, path, sha): - mirror_url = "https://mirror.bazel.build/bazel_java_tools/" + path - github_url = "https://github.com/bazelbuild/java_tools/releases/download/java_" + version + "/" + platform + "-" + version + ".zip" - relnote = ("\n" + +def generate_release_info(platform, artifacts): + return ("\n" + "http_archive(\n" " name = \"remote_" + platform + "\",\n" + - " sha = \"" + sha + "\",\n" + + " sha = \"" + artifacts["sha"] + "\",\n" + " urls = [\n" + - " \"" + mirror_url + "\",\n" + - " \"" + github_url + "\",\n" + + " \"" + artifacts["mirror_url"] + "\",\n" + + " \"" + artifacts["github_url"] + "\",\n" + " ],\n" + ")") - return relnote, mirror_url def download_file(mirror_url): wget.download(mirror_url , '.') -def get_version(artifacts): - path = artifacts["java_tools"]["path"] - version = path[path.find("/v"):path.find("/java_")][1:] - return version - def main(): parser = argparse.ArgumentParser() parser.add_argument( @@ -49,16 +41,12 @@ def main(): help='Output from create_java_tools_release.sh') opts = parser.parse_args() - artifacts = json.loads(opts.artifacts) - version = get_version(artifacts) + artifacts = json.loads(opts.artifacts)["artifacts"] relnotes = "To use this java_tools release, add to your WORKSPACE file the definitions: \n```py" for platform in artifacts: - path = artifacts[platform]["path"] - sha = artifacts[platform]["sha"] - relnote, mirror_url = generate_release_info(platform, version, path, sha) - relnotes += relnote - download_file(mirror_url) + relnotes += generate_release_info(platform, artifacts[platform]) + download_file(artifacts[platform]["mirror_url"]) relnotes += "```" with open('relnotes.txt', 'w') as f: From 8edd0a77e3a70c9a7d89d5a9d0e9aeab0c27ee8a Mon Sep 17 00:00:00 2001 From: keertk Date: Tue, 12 Sep 2023 16:15:36 -0700 Subject: [PATCH 18/27] Update with suggestions --- scripts/release.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index 95d6268..e53fd1a 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -18,16 +18,21 @@ import wget import json -def generate_release_info(platform, artifacts): - return ("\n" + - "http_archive(\n" - " name = \"remote_" + platform + "\",\n" + - " sha = \"" + artifacts["sha"] + "\",\n" + - " urls = [\n" + - " \"" + artifacts["mirror_url"] + "\",\n" + - " \"" + artifacts["github_url"] + "\",\n" + - " ],\n" + - ")") +def generate_release_info(platform, artifacts): + return ''' + http_archive( + name = "remote_{platform}", + sha256 = "{sha}", + urls = [ + "{mirror_url}", + "{github_url}" + ] + )'''.format( + platform = platform, + sha = artifacts["sha"], + mirror_url = artifacts["mirror_url"], + github_url = artifacts["github_url"] + ) def download_file(mirror_url): wget.download(mirror_url , '.') From 82ce6f5afd3db1a848ebe7feda4f054da3339414 Mon Sep 17 00:00:00 2001 From: keertk Date: Fri, 20 Oct 2023 12:19:37 -0700 Subject: [PATCH 19/27] Create a template for release requests --- .github/ISSUE_TEMPLATE/release.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/release.md diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md new file mode 100644 index 0000000..d7e1bf1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/release.md @@ -0,0 +1,17 @@ +--- +name: 'Release tracker' +about: Use this template to request for a new java_tools release +title: 'Release: java_tools X.Y.Z' +labels: ['release'] +assignees: + - iancha1992 + - sgowroji +--- + +**Link to relevant issue and/or commit:** + +**Other details:** + + + +cc @bazelbuild/triage From 1a849ec2667ffb87cf2b08492520b2596445f37f Mon Sep 17 00:00:00 2001 From: keertk Date: Fri, 20 Oct 2023 12:26:35 -0700 Subject: [PATCH 20/27] Update release.md --- .github/ISSUE_TEMPLATE/release.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index d7e1bf1..55a3aa8 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -1,8 +1,8 @@ --- name: 'Release tracker' about: Use this template to request for a new java_tools release -title: 'Release: java_tools X.Y.Z' -labels: ['release'] +title: 'Release: java_tools vX.Y.Z' +labels: ['release','P1'] assignees: - iancha1992 - sgowroji From db0bb32ca0a70ed9f83d5efc551060b0734d01d6 Mon Sep 17 00:00:00 2001 From: keertk Date: Fri, 3 Nov 2023 14:14:17 -0700 Subject: [PATCH 21/27] Create release-automated.md --- docs/release-automated.md | 204 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 docs/release-automated.md diff --git a/docs/release-automated.md b/docs/release-automated.md new file mode 100644 index 0000000..cfe89c9 --- /dev/null +++ b/docs/release-automated.md @@ -0,0 +1,204 @@ +**This playbook describes the updated java_tools release process. If you see any failures or issues with automation, please follow the manual release process documented [here](https://github.com/bazelbuild/java_tools/blob/master/docs/release.md).** + +# Release Process + +*Note: This document describes how to release java_tools for a JDK version that +is already tested by Bazel. This document is addressed to trusted members of +the Bazel team who have access to the Buildkite Bazel trusted pipelines and GCP. +If you want to release the Java tools but don’t have these permissions please +contact someone from the Bazel EngProd team (bazel-engprod@google.com).* + +The steps below are only meant to be followed as presented in order to release +a new java_tools version. To understand the mechanism behind these steps and for +more details about how the process works, see +[Behind the java_tools release process](behind-the-release.md). + +1. Create a new tracking issue for the release in this repository using the "release tracker" [template](https://github.com/bazelbuild/java_tools/issues/new/choose). +2. Trigger a new build of the [`java_tools binaries pipeline`](https://buildkite.com/bazel-trusted/java-tools-binaries-java). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". See [example](https://buildkite.com/bazel-trusted/java-tools-binaries-java/builds/233). +3. Identify and set the following environment variables: + + * `COMMIT_HASH` the commit hash where the pipeline was run (see below) + * `NEW_VERSION` the new version number you’re trying to release (e.g. `13.1`) + * `RC` the number of the current release candidate + + For example: + ```bash + export COMMIT_HASH=c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 + export NEW_VERSION=13.1 + export RC=1 + ``` + +4. Create a new release candidate by running the command below from the [Bazel](https://github.com/bazelbuild/bazel) repo: + + ```bash + src/create_java_tools_release.sh \ + --commit_hash $COMMIT_HASH \ + --java_tools_version $NEW_VERSION \ + --rc $RC --release false + ``` + + The script will output the sha256sum of the rc artifacts for linux, darwin + and windows. + + Sample output: + ```bash + $ src/create_java_tools_release.sh --commit_hash c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 --java_tools_version 13.1 --rc 1 --release false + + { + "version": "v13.1", + "release": "false", + "artifacts": { + "java_tools_linux": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_linux-v13.1-rc1.zip", + "sha": "d134da9b04c9023fb6e56a5d4bffccee73f7bc9572ddc4e747778dacccd7a5a7" + }, + "java_tools_windows": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_windows-v13.1-rc1.zip", + "sha": "c5c70c214a350f12cbf52da8270fa43ba629b795f3dd328028a38f8f0d39c2a1" + }, + "java_tools_darwin_x86_64": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_darwin_x86_64-v13.1-rc1.zip", + "sha": "0db40d8505a2b65ef0ed46e4256757807db8162f7acff16225be57c1d5726dbc" + }, + "java_tools_darwin_arm64": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_darwin_arm64-v13.1-rc1.zip", + "sha": "dab5bb87ec43e980faea6e1cec14bafb217b8e2f5346f53aa784fd715929a930" + }, + "java_tools": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools-v13.1-rc1.zip", + "sha": "286bdbbd66e616fc4ed3f90101418729a73baa7e8c23a98ffbef558f74c0ad14" + } + } + } + ``` + +5. Create a new branch in the [rules_java](https://github.com/bazelbuild/rules_java) repository + + * Name the branch `java_v[version number]`, e.g. `java_v11.09` + * Edit [java/repositories.bzl](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl) by copying the output from step 4 to `_JAVA_TOOLS_CONFIG` + + Example: + ```starlark + _JAVA_TOOLS_CONFIG = { + "version": "v13.1", + "release": "false", + "artifacts": { + "java_tools_linux": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_linux-v13.1-rc1.zip", + "sha": "d134da9b04c9023fb6e56a5d4bffccee73f7bc9572ddc4e747778dacccd7a5a7" + }, + "java_tools_windows": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_windows-v13.1-rc1.zip", + "sha": "c5c70c214a350f12cbf52da8270fa43ba629b795f3dd328028a38f8f0d39c2a1" + }, + "java_tools_darwin_x86_64": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_darwin_x86_64-v13.1-rc1.zip", + "sha": "0db40d8505a2b65ef0ed46e4256757807db8162f7acff16225be57c1d5726dbc" + }, + "java_tools_darwin_arm64": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_darwin_arm64-v13.1-rc1.zip", + "sha": "dab5bb87ec43e980faea6e1cec14bafb217b8e2f5346f53aa784fd715929a930" + }, + "java_tools": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools-v13.1-rc1.zip", + "sha": "286bdbbd66e616fc4ed3f90101418729a73baa7e8c23a98ffbef558f74c0ad14" + } + } + } + ``` + + * Refer to [this example](https://github.com/bazelbuild/rules_java/commit/8b3d6fd2728610c71be2f6937783a396de139576) + +6. Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl) in the Bazel repository and create a new pull request. This PR will trigger the CI presubmit. + + * Get the commit hash for the changes made in step 5 (e.g. `8b3d6fd2728610c71be2f6937783a396de139576` for [this commit](https://github.com/bazelbuild/rules_java/commit/8b3d6fd2728610c71be2f6937783a396de139576)) + * Download the tar.gz file at `https://github.com/bazelbuild/rules_java/archive/.tar.gz` + * Run `shasum -a 256 ` + * Update the following fields (note: add `strip_prefix`) + + Example: + ```starlark + "archive": "8b3d6fd2728610c71be2f6937783a396de139576.tar.gz", + "sha256": "e8a6427d7882215b009c048f996499e89c9e43c13c56234da16a49b154c46546", + "strip_prefix": "rules_java-8b3d6fd2728610c71be2f6937783a396de139576", + "urls": ["https://github.com/bazelbuild/rules_java/archive/8b3d6fd2728610c71be2f6937783a396de139576.tar.gz"],` + ``` + + * Refer to [this PR](https://github.com/bazelbuild/bazel/pull/20045) (specifically [this commit](https://github.com/bazelbuild/bazel/pull/20045/commits/b0ec360581ee665faf2298641ef4bb6feee12f9d)) + * Add archive_override to MODULE.bazel + * To calculate the `integrity` value of the source archive, trigger the [BCR integrity pipeline](https://buildkite.com/bazel-trusted/bcr-integrity). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "main". Click on "get archive" and enter the `.tar.gz` (e.g. `8b3d6fd2728610c71be2f6937783a396de139576.tar.gz`). The integrity value will be printed at the end of the "calculate integrity value" step. See [example](https://buildkite.com/bazel-trusted/bcr-integrity/builds/13). + + * Add archive_override with the `integrity` and commit hash from above + + Example: + ```starlark + archive_override( + module_name = "rules_java", + urls = ["https://github.com/bazelbuild/rules_java/archive/8b3d6fd2728610c71be2f6937783a396de139576.tar.gz"], + integrity = "sha256-6KZCfXiCIVsAnASPmWSZ6JyeQ8E8ViNNoWpJsVTEZUY=", + strip_prefix = "rules_java-8b3d6fd2728610c71be2f6937783a396de139576", + ) + ``` + +7. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). + + 1. Check the results of the build to confirm that there are no new failures (i.e. all failures also appear at HEAD). To do this, compare the results to the latest run [here](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds?branch=master). + 2. If the CI finishes successfully: + - Create the release artifacts from the release candidate: + ```bash + src/create_java_tools_release.sh \ + --java_tools_version $NEW_VERSION \ + --rc $RC --release true + ``` + The script will output the sha256sum of the rc artifacts for linux, darwin and windows. + + Sample output: + ```bash + $ src/create_java_tools_release.sh --commit_hash c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 --java_tools_version 13.1 --rc 1 --release true + + { + "version": "v13.1", + "release": "true", + "artifacts": { + "java_tools_linux": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_linux-v13.1.zip", + "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_linux-v13.1.zip", + "sha": "d134da9b04c9023fb6e56a5d4bffccee73f7bc9572ddc4e747778dacccd7a5a7" + }, + "java_tools_windows": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_windows-v13.1.zip", + "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_windows-v13.1.zip", + "sha": "c5c70c214a350f12cbf52da8270fa43ba629b795f3dd328028a38f8f0d39c2a1" + }, + "java_tools_darwin_x86_64": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_x86_64-v13.1.zip", + "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_x86_64-v13.1.zip", + "sha": "0db40d8505a2b65ef0ed46e4256757807db8162f7acff16225be57c1d5726dbc" + }, + "java_tools_darwin_arm64": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_arm64-v13.1.zip", + "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_arm64-v13.1.zip", + "sha": "dab5bb87ec43e980faea6e1cec14bafb217b8e2f5346f53aa784fd715929a930" + }, + "java_tools": { + "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools-v13.1.zip", + "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools-v13.1.zip", + "sha": "286bdbbd66e616fc4ed3f90101418729a73baa7e8c23a98ffbef558f74c0ad14" + } + } + } + ``` + + - Create a [java_tools release](https://github.com/bazelbuild/java_tools/releases) by triggering the [java-tools-release pipeline](https://buildkite.com/bazel-trusted/java-tools-release). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". Click on "artifacts information" and paste the output from the step above. See [example](https://buildkite.com/bazel-trusted/java-tools-release/builds/2). + + - Return to the rules_java repository and create a PR to update [java/repositories.bzl](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl) with the latest java_tools versions. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this example](https://github.com/bazelbuild/rules_java/pull/119) (it also includes the 2 updates needed for the next step). + + - Follow the steps [here](https://github.com/bazelbuild/rules_java/tree/master/distro) to release a new version of rules_java. + + - Update Bazel with the final rules_java version by editing the following files. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/18902). + - https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/30aa092cfe50435ae370c4a4bc9938eff52ce3fb)) + - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools#L4 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/73c8858d5195f072bbb316a3bf1289de1646d91a)) + - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel#L19 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/5b30bc4f23037f5651063e24c1881328720d6bcb)). Remove the archive_override() method as well. + + 3. If the CI finishes unsuccessfully find the reasons why the CI is failing and file bugs. After the bugs are fixed start all over again from step 2 and create the next release candidate. This case is highly unlikely because Bazel already tests the `java_tools` built at head. + From 3e37e71beb176cc924f3b2815d1ce46d4b0181a2 Mon Sep 17 00:00:00 2001 From: keertk Date: Fri, 3 Nov 2023 16:21:51 -0700 Subject: [PATCH 22/27] More updates --- docs/release-automated.md | 189 ++++++++++---------------------------- 1 file changed, 46 insertions(+), 143 deletions(-) diff --git a/docs/release-automated.md b/docs/release-automated.md index cfe89c9..2c38560 100644 --- a/docs/release-automated.md +++ b/docs/release-automated.md @@ -1,83 +1,24 @@ -**This playbook describes the updated java_tools release process. If you see any failures or issues with automation, please follow the manual release process documented [here](https://github.com/bazelbuild/java_tools/blob/master/docs/release.md).** +**This playbook describes the updated java_tools release process. If you see any errors or issues with automation, please follow the manual release process documented [here](https://github.com/bazelbuild/java_tools/blob/master/docs/release.md).** # Release Process -*Note: This document describes how to release java_tools for a JDK version that -is already tested by Bazel. This document is addressed to trusted members of -the Bazel team who have access to the Buildkite Bazel trusted pipelines and GCP. -If you want to release the Java tools but don’t have these permissions please -contact someone from the Bazel EngProd team (bazel-engprod@google.com).* - -The steps below are only meant to be followed as presented in order to release -a new java_tools version. To understand the mechanism behind these steps and for -more details about how the process works, see -[Behind the java_tools release process](behind-the-release.md). - -1. Create a new tracking issue for the release in this repository using the "release tracker" [template](https://github.com/bazelbuild/java_tools/issues/new/choose). -2. Trigger a new build of the [`java_tools binaries pipeline`](https://buildkite.com/bazel-trusted/java-tools-binaries-java). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". See [example](https://buildkite.com/bazel-trusted/java-tools-binaries-java/builds/233). -3. Identify and set the following environment variables: - - * `COMMIT_HASH` the commit hash where the pipeline was run (see below) - * `NEW_VERSION` the new version number you’re trying to release (e.g. `13.1`) - * `RC` the number of the current release candidate - - For example: - ```bash - export COMMIT_HASH=c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 - export NEW_VERSION=13.1 - export RC=1 - ``` +1. Create a new tracking issue for the release in this repository using the ["release tracker" template](https://github.com/bazelbuild/java_tools/issues/new/choose). -4. Create a new release candidate by running the command below from the [Bazel](https://github.com/bazelbuild/bazel) repo: +2. Trigger a new build of the [java_tools binaries pipeline](https://buildkite.com/bazel-trusted/java-tools-binaries-java). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". See [example](https://buildkite.com/bazel-trusted/java-tools-binaries-java/builds/233). - ```bash - src/create_java_tools_release.sh \ - --commit_hash $COMMIT_HASH \ - --java_tools_version $NEW_VERSION \ - --rc $RC --release false - ``` +3. Get the commit hash where the pipeline was run (e.g. `c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0` for v13.1) - The script will output the sha256sum of the rc artifacts for linux, darwin - and windows. - - Sample output: - ```bash - $ src/create_java_tools_release.sh --commit_hash c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 --java_tools_version 13.1 --rc 1 --release false +4. Create a new release candidate by triggering a new build of the [java-tools-rc pipeline](https://buildkite.com/bazel-trusted/java-tools-rc). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". Click on "release information" and enter the required details. See [example](https://buildkite.com/bazel-trusted/java-tools-rc/builds/1). - { - "version": "v13.1", - "release": "false", - "artifacts": { - "java_tools_linux": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_linux-v13.1-rc1.zip", - "sha": "d134da9b04c9023fb6e56a5d4bffccee73f7bc9572ddc4e747778dacccd7a5a7" - }, - "java_tools_windows": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_windows-v13.1-rc1.zip", - "sha": "c5c70c214a350f12cbf52da8270fa43ba629b795f3dd328028a38f8f0d39c2a1" - }, - "java_tools_darwin_x86_64": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_darwin_x86_64-v13.1-rc1.zip", - "sha": "0db40d8505a2b65ef0ed46e4256757807db8162f7acff16225be57c1d5726dbc" - }, - "java_tools_darwin_arm64": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools_darwin_arm64-v13.1-rc1.zip", - "sha": "dab5bb87ec43e980faea6e1cec14bafb217b8e2f5346f53aa784fd715929a930" - }, - "java_tools": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/release_candidates/java/v13.1/java_tools-v13.1-rc1.zip", - "sha": "286bdbbd66e616fc4ed3f90101418729a73baa7e8c23a98ffbef558f74c0ad14" - } - } - } - ``` +``` +Version: 13.1 +RC: 1 +Commit hash: c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 +Final release: false +``` -5. Create a new branch in the [rules_java](https://github.com/bazelbuild/rules_java) repository +5. Create a new branch in the [rules_java](https://github.com/bazelbuild/rules_java) repository and name it `java_v[version number]`, e.g. `java_v13.1`. Edit [java/repositories.bzl](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl) by copying the output from step 4 to `_JAVA_TOOLS_CONFIG`. Refer to [this example](https://github.com/bazelbuild/rules_java/commit/8b3d6fd2728610c71be2f6937783a396de139576). - * Name the branch `java_v[version number]`, e.g. `java_v11.09` - * Edit [java/repositories.bzl](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl) by copying the output from step 4 to `_JAVA_TOOLS_CONFIG` - - Example: ```starlark _JAVA_TOOLS_CONFIG = { "version": "v13.1", @@ -106,29 +47,27 @@ more details about how the process works, see } } ``` - - * Refer to [this example](https://github.com/bazelbuild/rules_java/commit/8b3d6fd2728610c71be2f6937783a396de139576) -6. Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl) in the Bazel repository and create a new pull request. This PR will trigger the CI presubmit. +6. Update [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl) in the Bazel repository and create a new draft pull request to trigger the CI presubmit. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/20045) (specifically [this commit](https://github.com/bazelbuild/bazel/pull/20045/commits/b0ec360581ee665faf2298641ef4bb6feee12f9d)) * Get the commit hash for the changes made in step 5 (e.g. `8b3d6fd2728610c71be2f6937783a396de139576` for [this commit](https://github.com/bazelbuild/rules_java/commit/8b3d6fd2728610c71be2f6937783a396de139576)) - * Download the tar.gz file at `https://github.com/bazelbuild/rules_java/archive/.tar.gz` - * Run `shasum -a 256 ` - * Update the following fields (note: add `strip_prefix`) + * Download the tar.gz file at `https://github.com/bazelbuild/rules_java/archive/.tar.gz` + * Run `shasum -a 256 ` + * Update the following fields: `archive`, `sha256`, `urls`, `strip_prefix` (to be added) - Example: - ```starlark - "archive": "8b3d6fd2728610c71be2f6937783a396de139576.tar.gz", - "sha256": "e8a6427d7882215b009c048f996499e89c9e43c13c56234da16a49b154c46546", - "strip_prefix": "rules_java-8b3d6fd2728610c71be2f6937783a396de139576", - "urls": ["https://github.com/bazelbuild/rules_java/archive/8b3d6fd2728610c71be2f6937783a396de139576.tar.gz"],` - ``` - - * Refer to [this PR](https://github.com/bazelbuild/bazel/pull/20045) (specifically [this commit](https://github.com/bazelbuild/bazel/pull/20045/commits/b0ec360581ee665faf2298641ef4bb6feee12f9d)) - * Add archive_override to MODULE.bazel + Example: + ```starlark + "archive": "8b3d6fd2728610c71be2f6937783a396de139576.tar.gz", + "sha256": "e8a6427d7882215b009c048f996499e89c9e43c13c56234da16a49b154c46546", + "strip_prefix": "rules_java-8b3d6fd2728610c71be2f6937783a396de139576", + "urls": ["https://github.com/bazelbuild/rules_java/archive/8b3d6fd2728610c71be2f6937783a396de139576.tar.gz"],` + ``` + +7. Add archive_override to [MODULE.bazel](https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel) + * To calculate the `integrity` value of the source archive, trigger the [BCR integrity pipeline](https://buildkite.com/bazel-trusted/bcr-integrity). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "main". Click on "get archive" and enter the `.tar.gz` (e.g. `8b3d6fd2728610c71be2f6937783a396de139576.tar.gz`). The integrity value will be printed at the end of the "calculate integrity value" step. See [example](https://buildkite.com/bazel-trusted/bcr-integrity/builds/13). - * Add archive_override with the `integrity` and commit hash from above + * Add archive_override with the `integrity` and commit hash from above. Example: ```starlark @@ -140,65 +79,29 @@ more details about how the process works, see ) ``` -7. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). - - 1. Check the results of the build to confirm that there are no new failures (i.e. all failures also appear at HEAD). To do this, compare the results to the latest run [here](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds?branch=master). - 2. If the CI finishes successfully: - - Create the release artifacts from the release candidate: - ```bash - src/create_java_tools_release.sh \ - --java_tools_version $NEW_VERSION \ - --rc $RC --release true - ``` - The script will output the sha256sum of the rc artifacts for linux, darwin and windows. - - Sample output: - ```bash - $ src/create_java_tools_release.sh --commit_hash c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 --java_tools_version 13.1 --rc 1 --release true - - { - "version": "v13.1", - "release": "true", - "artifacts": { - "java_tools_linux": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_linux-v13.1.zip", - "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_linux-v13.1.zip", - "sha": "d134da9b04c9023fb6e56a5d4bffccee73f7bc9572ddc4e747778dacccd7a5a7" - }, - "java_tools_windows": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_windows-v13.1.zip", - "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_windows-v13.1.zip", - "sha": "c5c70c214a350f12cbf52da8270fa43ba629b795f3dd328028a38f8f0d39c2a1" - }, - "java_tools_darwin_x86_64": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_x86_64-v13.1.zip", - "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_x86_64-v13.1.zip", - "sha": "0db40d8505a2b65ef0ed46e4256757807db8162f7acff16225be57c1d5726dbc" - }, - "java_tools_darwin_arm64": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_arm64-v13.1.zip", - "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_arm64-v13.1.zip", - "sha": "dab5bb87ec43e980faea6e1cec14bafb217b8e2f5346f53aa784fd715929a930" - }, - "java_tools": { - "mirror_url": "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools-v13.1.zip", - "github_url": "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools-v13.1.zip", - "sha": "286bdbbd66e616fc4ed3f90101418729a73baa7e8c23a98ffbef558f74c0ad14" - } - } - } - ``` - - - Create a [java_tools release](https://github.com/bazelbuild/java_tools/releases) by triggering the [java-tools-release pipeline](https://buildkite.com/bazel-trusted/java-tools-release). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". Click on "artifacts information" and paste the output from the step above. See [example](https://buildkite.com/bazel-trusted/java-tools-release/builds/2). +9. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). + +Check the results of the build to confirm that there are no new failures (i.e. all failures also appear at HEAD). To do this, compare the results to the latest run [here](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds?branch=master). If the CI finishes unsuccessfully, find the reasons why the CI is failing and file bugs. After the bugs are fixed, start all over again from step 2 and create the next release candidate. This case is highly unlikely because Bazel already tests the `java_tools` built at head. + +If the CI finishes successfully: + +9. Create the release artifacts from the release candidate by triggering a new build of the [java-tools-rc pipeline](https://buildkite.com/bazel-trusted/java-tools-rc). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". Click on "release information" and enter the required details. + +``` +Version: 13.1 +RC: 1 +Commit hash: c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 +Final release: true +``` + +10. Create a [java_tools release](https://github.com/bazelbuild/java_tools/releases) on GitHub by triggering the [java-tools-release pipeline](https://buildkite.com/bazel-trusted/java-tools-release). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". Click on "artifacts information" and paste the output from the step above. See [example](https://buildkite.com/bazel-trusted/java-tools-release/builds/2). - - Return to the rules_java repository and create a PR to update [java/repositories.bzl](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl) with the latest java_tools versions. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this example](https://github.com/bazelbuild/rules_java/pull/119) (it also includes the 2 updates needed for the next step). +11. Return to the rules_java repository and create a PR to update [java/repositories.bzl](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl) with the latest java_tools versions. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this example](https://github.com/bazelbuild/rules_java/pull/119) (it also includes the 2 updates needed for the next step). - - Follow the steps [here](https://github.com/bazelbuild/rules_java/tree/master/distro) to release a new version of rules_java. +12. Follow the steps [here](https://github.com/bazelbuild/rules_java/tree/master/distro) to release a new version of rules_java. - - Update Bazel with the final rules_java version by editing the following files. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/18902). +13. Update Bazel with the final rules_java version by editing the following files. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/18902). - https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/30aa092cfe50435ae370c4a4bc9938eff52ce3fb)) - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools#L4 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/73c8858d5195f072bbb316a3bf1289de1646d91a)) - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel#L19 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/5b30bc4f23037f5651063e24c1881328720d6bcb)). Remove the archive_override() method as well. - - 3. If the CI finishes unsuccessfully find the reasons why the CI is failing and file bugs. After the bugs are fixed start all over again from step 2 and create the next release candidate. This case is highly unlikely because Bazel already tests the `java_tools` built at head. From 590f6787180f8a085cdd9a50455d8ef610b677a8 Mon Sep 17 00:00:00 2001 From: keertk Date: Fri, 3 Nov 2023 16:35:47 -0700 Subject: [PATCH 23/27] Fix formatting --- docs/release-automated.md | 51 ++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/docs/release-automated.md b/docs/release-automated.md index 2c38560..9003cc4 100644 --- a/docs/release-automated.md +++ b/docs/release-automated.md @@ -10,12 +10,12 @@ 4. Create a new release candidate by triggering a new build of the [java-tools-rc pipeline](https://buildkite.com/bazel-trusted/java-tools-rc). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". Click on "release information" and enter the required details. See [example](https://buildkite.com/bazel-trusted/java-tools-rc/builds/1). -``` -Version: 13.1 -RC: 1 -Commit hash: c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 -Final release: false -``` + ``` + Version: 13.1 + RC: 1 + Commit hash: c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 + Final release: false + ``` 5. Create a new branch in the [rules_java](https://github.com/bazelbuild/rules_java) repository and name it `java_v[version number]`, e.g. `java_v13.1`. Edit [java/repositories.bzl](https://github.com/bazelbuild/rules_java/blob/master/java/repositories.bzl) by copying the output from step 4 to `_JAVA_TOOLS_CONFIG`. Refer to [this example](https://github.com/bazelbuild/rules_java/commit/8b3d6fd2728610c71be2f6937783a396de139576). @@ -55,19 +55,19 @@ Final release: false * Run `shasum -a 256 ` * Update the following fields: `archive`, `sha256`, `urls`, `strip_prefix` (to be added) - Example: - ```starlark - "archive": "8b3d6fd2728610c71be2f6937783a396de139576.tar.gz", - "sha256": "e8a6427d7882215b009c048f996499e89c9e43c13c56234da16a49b154c46546", - "strip_prefix": "rules_java-8b3d6fd2728610c71be2f6937783a396de139576", - "urls": ["https://github.com/bazelbuild/rules_java/archive/8b3d6fd2728610c71be2f6937783a396de139576.tar.gz"],` - ``` + Example: + ```starlark + "archive": "8b3d6fd2728610c71be2f6937783a396de139576.tar.gz", + "sha256": "e8a6427d7882215b009c048f996499e89c9e43c13c56234da16a49b154c46546", + "strip_prefix": "rules_java-8b3d6fd2728610c71be2f6937783a396de139576", + "urls": ["https://github.com/bazelbuild/rules_java/archive/8b3d6fd2728610c71be2f6937783a396de139576.tar.gz"],` + ``` 7. Add archive_override to [MODULE.bazel](https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel) - * To calculate the `integrity` value of the source archive, trigger the [BCR integrity pipeline](https://buildkite.com/bazel-trusted/bcr-integrity). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "main". Click on "get archive" and enter the `.tar.gz` (e.g. `8b3d6fd2728610c71be2f6937783a396de139576.tar.gz`). The integrity value will be printed at the end of the "calculate integrity value" step. See [example](https://buildkite.com/bazel-trusted/bcr-integrity/builds/13). + * To calculate the `integrity` value of the source archive, trigger the [BCR integrity pipeline](https://buildkite.com/bazel-trusted/bcr-integrity). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "main". Click on "get archive" and enter the `.tar.gz` (e.g. `8b3d6fd2728610c71be2f6937783a396de139576.tar.gz`). The integrity value will be printed at the end of the "calculate integrity value" step. See [example](https://buildkite.com/bazel-trusted/bcr-integrity/builds/13). - * Add archive_override with the `integrity` and commit hash from above. + * Add archive_override with the `integrity` and commit hash from above. Example: ```starlark @@ -79,7 +79,7 @@ Final release: false ) ``` -9. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). +8. Trigger a new build on Downstream https://buildkite.com/bazel/bazel-at-head-plus-downstream. Set the message field to "java_tools release [version] [rc]", leave the commit field as "HEAD", and use `pull/[PRNUMBER]/head` for the branch. See [example](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2818). Check the results of the build to confirm that there are no new failures (i.e. all failures also appear at HEAD). To do this, compare the results to the latest run [here](https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds?branch=master). If the CI finishes unsuccessfully, find the reasons why the CI is failing and file bugs. After the bugs are fixed, start all over again from step 2 and create the next release candidate. This case is highly unlikely because Bazel already tests the `java_tools` built at head. @@ -87,12 +87,12 @@ If the CI finishes successfully: 9. Create the release artifacts from the release candidate by triggering a new build of the [java-tools-rc pipeline](https://buildkite.com/bazel-trusted/java-tools-rc). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". Click on "release information" and enter the required details. -``` -Version: 13.1 -RC: 1 -Commit hash: c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 -Final release: true -``` + ``` + Version: 13.1 + RC: 1 + Commit hash: c7d8d1e3f16ac6db37b134358b6cfdb5e3c8f6b0 + Final release: true + ``` 10. Create a [java_tools release](https://github.com/bazelbuild/java_tools/releases) on GitHub by triggering the [java-tools-release pipeline](https://buildkite.com/bazel-trusted/java-tools-release). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "master". Click on "artifacts information" and paste the output from the step above. See [example](https://buildkite.com/bazel-trusted/java-tools-release/builds/2). @@ -101,7 +101,8 @@ Final release: true 12. Follow the steps [here](https://github.com/bazelbuild/rules_java/tree/master/distro) to release a new version of rules_java. 13. Update Bazel with the final rules_java version by editing the following files. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/18902). - - https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/30aa092cfe50435ae370c4a4bc9938eff52ce3fb)) - - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools#L4 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/73c8858d5195f072bbb316a3bf1289de1646d91a)) - - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel#L19 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/5b30bc4f23037f5651063e24c1881328720d6bcb)). Remove the archive_override() method as well. + + - https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/30aa092cfe50435ae370c4a4bc9938eff52ce3fb)) + - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools#L4 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/73c8858d5195f072bbb316a3bf1289de1646d91a)) + - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel#L19 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/5b30bc4f23037f5651063e24c1881328720d6bcb)). Remove the archive_override() method as well. From afcae67d2084622dda5e60da594fa4e5d5145227 Mon Sep 17 00:00:00 2001 From: keertk Date: Mon, 6 Nov 2023 10:52:26 -0800 Subject: [PATCH 24/27] Minor fix in release.py --- scripts/release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release.py b/scripts/release.py index e53fd1a..61d1928 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -53,7 +53,7 @@ def main(): relnotes += generate_release_info(platform, artifacts[platform]) download_file(artifacts[platform]["mirror_url"]) - relnotes += "```" + relnotes += "\n```" with open('relnotes.txt', 'w') as f: f.write(relnotes) From f731d37f498b5c76cf8e52f8e60f0c39361d8a0e Mon Sep 17 00:00:00 2001 From: Keerthana Kumar Date: Wed, 8 Nov 2023 18:38:53 +0000 Subject: [PATCH 25/27] Replace distdir_deps with workspace_deps --- docs/release-automated.md | 8 ++++---- docs/release.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/release-automated.md b/docs/release-automated.md index 9003cc4..332542b 100644 --- a/docs/release-automated.md +++ b/docs/release-automated.md @@ -48,7 +48,7 @@ } ``` -6. Update [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl) in the Bazel repository and create a new draft pull request to trigger the CI presubmit. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/20045) (specifically [this commit](https://github.com/bazelbuild/bazel/pull/20045/commits/b0ec360581ee665faf2298641ef4bb6feee12f9d)) +6. Update [workspace_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/workspace_deps.bzl) in the Bazel repository and create a new draft pull request to trigger the CI presubmit. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/20045) (specifically [this commit](https://github.com/bazelbuild/bazel/pull/20045/commits/b0ec360581ee665faf2298641ef4bb6feee12f9d)) * Get the commit hash for the changes made in step 5 (e.g. `8b3d6fd2728610c71be2f6937783a396de139576` for [this commit](https://github.com/bazelbuild/rules_java/commit/8b3d6fd2728610c71be2f6937783a396de139576)) * Download the tar.gz file at `https://github.com/bazelbuild/rules_java/archive/.tar.gz` @@ -102,7 +102,7 @@ If the CI finishes successfully: 13. Update Bazel with the final rules_java version by editing the following files. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/18902). - - https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/30aa092cfe50435ae370c4a4bc9938eff52ce3fb)) - - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools#L4 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/73c8858d5195f072bbb316a3bf1289de1646d91a)) - - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel#L19 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/5b30bc4f23037f5651063e24c1881328720d6bcb)). Remove the archive_override() method as well. + - https://github.com/bazelbuild/bazel/blob/master/workspace_deps.bzl ([example](https://github.com/bazelbuild/bazel/commit/ef5648ef4e0a48291c8bd5ff02a96ef03d69cf04)) + - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/73c8858d5195f072bbb316a3bf1289de1646d91a)) + - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/5b30bc4f23037f5651063e24c1881328720d6bcb)). Remove the archive_override() method as well. diff --git a/docs/release.md b/docs/release.md index e746fee..1662a74 100644 --- a/docs/release.md +++ b/docs/release.md @@ -69,7 +69,7 @@ more details about how the process works, see * Repeat for `remote_java_tools_linux`, `remote_java_tools_windows`, `remote_java_tools_darwin_x86_64` and `remote_java_tools_darwin_arm64` * Refer to [this example](https://github.com/bazelbuild/rules_java/commit/d1196d250c17dfffed52db13c75d4f9b9cd20617) -6. Edit [distdir_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65) in the Bazel repository and create a new pull request. This PR will trigger the CI presubmit. +6. Edit [workspace_deps.bzl](https://github.com/bazelbuild/bazel/blob/master/workspace_deps.bzl) in the Bazel repository and create a new pull request. This PR will trigger the CI presubmit. * Get the commit hash for the changes made in step 5 (e.g. `d1196d250c17dfffed52db13c75d4f9b9cd20617` for [this commit](https://github.com/bazelbuild/rules_java/commit/d1196d250c17dfffed52db13c75d4f9b9cd20617)) * Download the tar.gz file at `https://github.com/bazelbuild/rules_java/archive/.tar.gz` @@ -198,9 +198,9 @@ more details about how the process works, see - One time step: Add the `publish-to-bcr` app to your personal fork of `bazelbuild/bazel-central-registry`. Refer to the instructions [here](https://github.com/bazel-contrib/publish-to-bcr/blob/main/README.md). - Update Bazel with the final rules_java version by editing the following files. After making sure presubmits pass, send the PR for review and assign `@hvadehra`. Refer to [this PR](https://github.com/bazelbuild/bazel/pull/18902). - - https://github.com/bazelbuild/bazel/blob/master/distdir_deps.bzl#L65 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/30aa092cfe50435ae370c4a4bc9938eff52ce3fb)) - - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools#L4 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/73c8858d5195f072bbb316a3bf1289de1646d91a)) - - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel#L19 ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/5b30bc4f23037f5651063e24c1881328720d6bcb)). Remove the archive_override() method as well. + - https://github.com/bazelbuild/bazel/blob/master/workspace_deps.bzl ([example](https://github.com/bazelbuild/bazel/commit/ef5648ef4e0a48291c8bd5ff02a96ef03d69cf04)) + - https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/73c8858d5195f072bbb316a3bf1289de1646d91a)) + - https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel# ([example](https://github.com/bazelbuild/bazel/pull/18902/commits/5b30bc4f23037f5651063e24c1881328720d6bcb)). Remove the archive_override() method as well. 3. If the CI finishes unsuccessfully find the reasons why the CI is failing and file bugs. After the bugs are fixed start all over again from step 2 and create the next release candidate. This case is highly unlikely because Bazel already tests the `java_tools` built at head. From b9e915460c7d1c2b4fcf7fef5317e10953310091 Mon Sep 17 00:00:00 2001 From: keertk Date: Wed, 15 May 2024 07:17:29 -0700 Subject: [PATCH 26/27] Fix --- docs/release-automated.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-automated.md b/docs/release-automated.md index 332542b..724fdc1 100644 --- a/docs/release-automated.md +++ b/docs/release-automated.md @@ -66,6 +66,7 @@ 7. Add archive_override to [MODULE.bazel](https://github.com/bazelbuild/bazel/blob/master/MODULE.bazel) * To calculate the `integrity` value of the source archive, trigger the [BCR integrity pipeline](https://buildkite.com/bazel-trusted/bcr-integrity). Set the message field to "java_tools release [version] [rc]", and leave the commit field as "HEAD" and branch as "main". Click on "get archive" and enter the `.tar.gz` (e.g. `8b3d6fd2728610c71be2f6937783a396de139576.tar.gz`). The integrity value will be printed at the end of the "calculate integrity value" step. See [example](https://buildkite.com/bazel-trusted/bcr-integrity/builds/13). + * Alternately, run `cat .tar.gz | openssl dgst -sha256 -binary | base64`. * Add archive_override with the `integrity` and commit hash from above. From 4b28ec300963e3676c4c413fc175afec5980b193 Mon Sep 17 00:00:00 2001 From: hvadehra Date: Mon, 19 Jan 2026 16:31:19 +0530 Subject: [PATCH 27/27] Add provenance info to release notes --- scripts/release.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index 61d1928..0ed464c 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -46,14 +46,15 @@ def main(): help='Output from create_java_tools_release.sh') opts = parser.parse_args() - artifacts = json.loads(opts.artifacts)["artifacts"] + release_info = json.loads(opts.artifacts) + artifacts = release_info["artifacts"] relnotes = "To use this java_tools release, add to your WORKSPACE file the definitions: \n```py" for platform in artifacts: relnotes += generate_release_info(platform, artifacts[platform]) download_file(artifacts[platform]["mirror_url"]) - relnotes += "\n```" + relnotes += "\n```\nThis Java tools version was built from http://github.com/bazelbuild/bazel/commit/" + release_info["source_revision"] with open('relnotes.txt', 'w') as f: f.write(relnotes)