blob: 9e1744c97d0c26606d79c197bd2f3423d77d7427 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Making a Gerrit Release
Martin Fick21e278e2012-02-23 13:45:54 -07002
3[NOTE]
Martin Fick21e278e2012-02-23 13:45:54 -07004This document is meant primarily for Gerrit maintainers
5who have been given approval and submit status to the Gerrit
6projects. Additionally, maintainers should be given owner
7status to the Gerrit web site.
Martin Fick21e278e2012-02-23 13:45:54 -07008
9To make a Gerrit release involves a great deal of complex
10tasks and it is easy to miss a step so this document should
Edwin Kempinbb8e6252012-07-31 14:30:35 +020011hopefully serve as both a how to for those new to the process
Martin Fick21e278e2012-02-23 13:45:54 -070012and as a checklist for those already familiar with these
13tasks.
14
15
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080016== Gerrit Release Type
Martin Fick21e278e2012-02-23 13:45:54 -070017
18Here are some guidelines on release approaches depending on the
Patrick Hiesel9d165c52017-04-13 10:08:53 +020019type of release you want to make (`stable-fix`, `stable`, `rc0`,
20`rc1`...).
Martin Fick21e278e2012-02-23 13:45:54 -070021
Edwin Kempin60ab8532013-03-27 14:33:46 +010022[[stable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080023=== Stable
Martin Fick21e278e2012-02-23 13:45:54 -070024
Edwin Kempinbb8e6252012-07-31 14:30:35 +020025A `stable` release is generally built from the `master` branch and may
26need to undergo some stabilization before releasing the final release.
Martin Fick21e278e2012-02-23 13:45:54 -070027
28* Propose the release with any plans/objectives to the mailing list
29
Patrick Hiesel9d165c52017-04-13 10:08:53 +020030* Create a Gerrit `rc0`
Martin Fick21e278e2012-02-23 13:45:54 -070031
Patrick Hiesel9d165c52017-04-13 10:08:53 +020032* If needed create a Gerrit `rc1`
Martin Fick21e278e2012-02-23 13:45:54 -070033
34[NOTE]
Martin Fick21e278e2012-02-23 13:45:54 -070035You may let in a few features to this release
Martin Fick21e278e2012-02-23 13:45:54 -070036
Patrick Hiesel9d165c52017-04-13 10:08:53 +020037* If needed create a Gerrit `rc2`
Martin Fick21e278e2012-02-23 13:45:54 -070038
39[NOTE]
Martin Fick21e278e2012-02-23 13:45:54 -070040There should be no new features in this release, only bug fixes
Martin Fick21e278e2012-02-23 13:45:54 -070041
Patrick Hiesel9d165c52017-04-13 10:08:53 +020042* Finally create the `stable` release (no `rc`)
Martin Fick21e278e2012-02-23 13:45:54 -070043
44
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080045=== Stable-Fix
Martin Fick21e278e2012-02-23 13:45:54 -070046
Edwin Kempinbb8e6252012-07-31 14:30:35 +020047`stable-fix` releases should likely only contain bug fixes and doc
48updates.
Martin Fick21e278e2012-02-23 13:45:54 -070049
Edwin Kempina0272a52012-12-28 10:25:57 +010050* Propose the release with any plans/objectives to the mailing list
51
Edwin Kempinbb8e6252012-07-31 14:30:35 +020052* This type of release does not need any RCs, release when the
53objectives are met
Martin Fick21e278e2012-02-23 13:45:54 -070054
55
Edwin Kempin60ab8532013-03-27 14:33:46 +010056[[security]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080057=== Security-Fix
Edwin Kempind71591e2012-12-28 10:50:38 +010058
59`security-fix` releases should only contain bug fixes for security
60issues.
61
62For security issues it is important that they are only announced
63*after* fixed versions for all relevant releases have been published.
David Pursehouse452ea4c2013-01-07 17:30:47 +090064Because of this, `security-fix` releases can't be prepared in the public
Edwin Kempind71591e2012-12-28 10:50:38 +010065`gerrit` project.
66
67`security-fix` releases are prepared in the `gerrit-security-fixes`
68project which is only readable by the Gerrit Maintainers. Only after
David Pursehouse452ea4c2013-01-07 17:30:47 +090069a `security-fix` release has been published will the commits/tags made in
70the `gerrit-security-fixes` project be taken over into the public
Edwin Kempind71591e2012-12-28 10:50:38 +010071`gerrit` project.
72
73
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080074== Create the Actual Release
Martin Fick21e278e2012-02-23 13:45:54 -070075
Dave Borowitz9b877072017-10-01 16:17:42 -040076[[update-versions]]
77=== Update Versions and Create Release Tag
Edwin Kempin6ba21942014-06-03 09:16:20 +020078
Patrick Hiesel9d165c52017-04-13 10:08:53 +020079Before doing the release build, the `GERRIT_VERSION` in the `version.bzl`
Dave Borowitz23607652017-10-01 20:16:49 +010080file must be updated, e.g. change it from `$version-SNAPSHOT` to `$version`.
Edwin Kempin6ba21942014-06-03 09:16:20 +020081
Dave Borowitzf4f1ca02017-10-10 09:26:17 -040082In addition the version must be updated in a number of `*_pom.xml` files.
Dave Borowitz9b877072017-10-01 16:17:42 -040083
84To do this run the `./tools/version.py` script and provide the new
85version as parameter, e.g.:
86
87----
David Pursehouse9cb3fc22017-10-12 09:43:02 +090088 version=2.15
89 ./tools/version.py $version
Dave Borowitz9b877072017-10-01 16:17:42 -040090----
91
92Commit the changes and create a signed release tag on the new commit:
Edwin Kempin6ba21942014-06-03 09:16:20 +020093
94----
Dave Borowitz23607652017-10-01 20:16:49 +010095 git tag -s -m "v$version" "v$version"
Edwin Kempin6ba21942014-06-03 09:16:20 +020096----
Edwin Kempinbb8e6252012-07-31 14:30:35 +020097
David Pursehousea1ab3e72015-01-30 14:57:11 +090098Tag the plugins:
99
100----
David Pursehouse89aeba92019-10-18 19:20:29 +0900101 git submodule foreach '[ "$path" == "modules/jgit" ] || git tag -s -m "v$version" "v$version"'
David Pursehousea1ab3e72015-01-30 14:57:11 +0900102----
103
Shawn Pearcebf8ebbe2013-05-06 14:23:26 -0700104[[build-gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800105=== Build Gerrit
Martin Fick21e278e2012-02-23 13:45:54 -0700106
Yuxuan 'fishy' Wang6714b0d2016-05-03 12:58:04 -0700107* Build the Gerrit WAR, API JARs and documentation
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200108+
David Pursehouse383a3182013-12-06 13:06:57 +0900109----
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800110 bazel build release Documentation:searchfree
111 ./tools/maven/api.sh install
David Pursehouse383a3182013-12-06 13:06:57 +0900112----
Martin Fick21e278e2012-02-23 13:45:54 -0700113
Dave Borowitz4c040002017-10-02 12:51:34 +0100114* Verify the WAR version:
115+
116----
117 java -jar ~/dl/gerrit-$version.war --version
118----
119* Try upgrading a test site and launching the daemon
Martin Fick21e278e2012-02-23 13:45:54 -0700120
David Pursehouse7eb16eb2016-03-11 12:01:56 +0900121* Verify plugin versions
122+
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800123Verify the versions:
David Pursehouse7eb16eb2016-03-11 12:01:56 +0900124+
125----
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800126 java -jar bazel-bin/release.war init --list-plugins
David Pursehouse7eb16eb2016-03-11 12:01:56 +0900127----
128
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200129[[publish-gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800130=== Publish the Gerrit Release
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200131
Edwin Kempin210b6362014-06-03 13:33:16 +0200132[[publish-to-maven-central]]
133==== Publish the Gerrit artifacts to Maven Central
134
135* Make sure you have done the
136link:dev-release-deploy-config.html#deploy-configuration-setting-maven-central[
137configuration] for deploying to Maven Central
138
Dave Borowitz9b877072017-10-01 16:17:42 -0400139* Make sure that the version is updated in the `version.bzl` file and in
Dave Borowitzf4f1ca02017-10-10 09:26:17 -0400140the `*_pom.xml` files as described in the link:#update-versions[Update
Dave Borowitz9b877072017-10-01 16:17:42 -0400141Versions and Create Release Tag] section.
Edwin Kempin210b6362014-06-03 13:33:16 +0200142
Edwin Kempine5b49432014-06-03 09:25:39 +0200143* Push the WAR to Maven Central:
144+
145----
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800146 ./tools/maven/api.sh war_deploy
Edwin Kempine5b49432014-06-03 09:25:39 +0200147----
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200148
Edwin Kempin210b6362014-06-03 13:33:16 +0200149* Push the plugin artifacts to Maven Central:
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200150+
151----
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800152 ./tools/maven/api.sh deploy
Edwin Kempin210b6362014-06-03 13:33:16 +0200153----
154
Edwin Kempin210b6362014-06-03 13:33:16 +0200155* To where the artifacts are uploaded depends on the `GERRIT_VERSION` in
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800156the `version.bzl` file:
Edwin Kempin210b6362014-06-03 13:33:16 +0200157
158** SNAPSHOT versions are directly uploaded into the Sonatype snapshots
159repository and no further action is needed:
160+
161https://oss.sonatype.org/content/repositories/snapshots/com/google/gerrit/
162
163** Release versions are uploaded into a staging repository in the
164link:https://oss.sonatype.org/[Sonatype Nexus Server].
165
166* Verify the staging repository
Edwin Kempin210b6362014-06-03 13:33:16 +0200167
168** Go to the link:https://oss.sonatype.org/[Sonatype Nexus Server] and
169sign in with your Sonatype credentials.
170
Edwin Kempin58bc3132014-06-05 14:56:58 +0200171** Click on 'Build Promotion' in the left navigation bar under
172'Staging Repositories' and find the `comgooglegerrit-XXXX` staging
Edwin Kempin210b6362014-06-03 13:33:16 +0200173repository.
174
175** Verify its content
176+
177While the staging repository is open you can upload further content and
178also replace uploaded artifacts. If something is wrong with the staging
179repository you can drop it by selecting it and clicking on `Drop`.
180
181** Run Sonatype validations on the staging repository
182+
183Select the staging repository and click on `Close`. This runs the
184Sonatype validations on the staging repository. The repository will
185only be closed if everything is OK. A closed repository cannot be
186modified anymore, but you may still drop it if you find any issues.
187
188** Test closed staging repository
189+
190Once a repository is closed you can find the URL to it in the `Summary`
191section, e.g. https://oss.sonatype.org/content/repositories/comgooglegerrit-1029
192+
193Use this URL for further testing of the artifacts in this repository,
194e.g. to try building a plugin against the plugin API in this repository
Dave Borowitzf4f1ca02017-10-10 09:26:17 -0400195update the version in the `*_pom.xml` and configure the repository:
Edwin Kempin210b6362014-06-03 13:33:16 +0200196+
197----
198 <repositories>
199 <repository>
200 <id>gerrit-staging-repository</id>
201 <url>https://oss.sonatype.org/content/repositories/comgooglegerrit-1029</url>
202 </repository>
203 </repositories>
204----
205
206* Release the staging repository
207+
208How to release a staging repository is described in the
209link:https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.a.2.ReleasingaStagingRepository[
210Sonatype OSS Maven Repository Usage Guide].
211+
212[WARNING]
213Releasing artifacts to Maven Central cannot be undone!
214
215** Find the closed staging repository in the
216link:https://oss.sonatype.org/[Sonatype Nexus Server], select it and
217click on `Release`.
218
Edwin Kempin8e63cf42014-06-04 14:24:20 +0200219** The released artifacts are available in
220https://oss.sonatype.org/content/repositories/releases/com/google/gerrit/
221
Edwin Kempin210b6362014-06-03 13:33:16 +0200222** It may take up to 2 hours until the artifacts appear on Maven
223Central:
224+
Edwin Kempin8e63cf42014-06-04 14:24:20 +0200225http://central.maven.org/maven2/com/google/gerrit/
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200226
Edwin Kempin58bc3132014-06-05 14:56:58 +0200227* [optional]: View download statistics
228
229** Sign in to the
230link:https://oss.sonatype.org/[Sonatype Nexus Server].
231
232** Click on 'Views/Repositories' in the left navigation bar under
233'Central Statistics'.
234
235** Select `com.google.gerrit` as `Project`.
236
Martin Fick21e278e2012-02-23 13:45:54 -0700237
David Pursehousedd066e42015-04-17 17:53:57 +0900238[[publish-to-google-storage]]
239==== Publish the Gerrit WAR to the Google Cloud Storage
240
David Pursehouseaf652ab2016-08-29 16:37:22 +0900241* go to the link:https://console.cloud.google.com/storage/browser/gerrit-releases/?project=api-project-164060093628[
242gerrit-releases bucket in the Google cloud storage console]
David Pursehousedd066e42015-04-17 17:53:57 +0900243* make sure you are signed in with your Gmail account
244* manually upload the Gerrit WAR file by using the `Upload` button
245
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200246[[push-stable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800247==== Push the Stable Branch
Martin Fick21e278e2012-02-23 13:45:54 -0700248
Dave Borowitz23607652017-10-01 20:16:49 +0100249* Create the stable branch `stable-$version` in the `gerrit` project via the
David Pursehouse122f0782018-09-28 13:45:23 +0900250link:https://gerrit-review.googlesource.com/admin/repos/gerrit,branches[
David Pursehousea1d633b2014-05-02 17:21:02 +0900251Gerrit Web UI] or by push.
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200252
Dave Borowitz23607652017-10-01 20:16:49 +0100253* Push the commits done on `stable-$version` to `refs/for/stable-$version` and
David Pursehousefaf30c52019-08-26 09:31:50 +0900254get them merged.
255
Monty Taylor78f5bf32019-08-25 16:12:02 +0200256* Create a change updating the `defaultbranch` field in the `.gitreview`
257to match the branch name created.
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200258
259
260[[push-tag]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800261==== Push the Release Tag
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200262
David Pursehousea1ab3e72015-01-30 14:57:11 +0900263Push the new Release Tag:
264
David Pursehouse383a3182013-12-06 13:06:57 +0900265----
Dave Borowitz23607652017-10-01 20:16:49 +0100266 git push gerrit-review tag v$version
David Pursehouse383a3182013-12-06 13:06:57 +0900267----
Martin Fick21e278e2012-02-23 13:45:54 -0700268
David Pursehousea1ab3e72015-01-30 14:57:11 +0900269Push the new Release Tag on the plugins:
270
271----
Dave Borowitz23607652017-10-01 20:16:49 +0100272 git submodule foreach git push gerrit-review tag v$version
David Pursehousea1ab3e72015-01-30 14:57:11 +0900273----
274
Martin Fick21e278e2012-02-23 13:45:54 -0700275
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200276[[upload-documentation]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800277==== Upload the Documentation
Martin Fick21e278e2012-02-23 13:45:54 -0700278
Yuxuan 'fishy' Wang6714b0d2016-05-03 12:58:04 -0700279* Extract the documentation files from the zip file generated from
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800280`bazel build searchfree`: `bazel-bin/Documentation/searchfree.zip`.
David Pursehousedb628162014-12-09 19:33:01 +0900281
David Pursehouse62106ac2016-03-11 14:19:48 +0900282* Upload the files manually via web browser to the appropriate folder
283in the
David Pursehouseaf652ab2016-08-29 16:37:22 +0900284link:https://console.cloud.google.com/storage/browser/gerrit-documentation/?project=api-project-164060093628[
David Pursehousea8dca2f2015-04-17 13:59:29 +0900285gerrit-documentation] storage bucket.
Yuxuan 'fishy' Wangf7803972014-09-03 12:23:21 -0700286
David Pursehoused228d6d2016-10-19 19:25:35 +0900287[[finalize-release-notes]]
288=== Finalize the Release Notes
289
290Upload a change on the homepage project to:
291
292* Remove 'In Development' caveat from the relevant section.
293
294* Add links to the released documentation and the .war file, and make the
295latest version bold.
296
David Pursehousedb628162014-12-09 19:33:01 +0900297[[update-links]]
David Pursehouse08726a82015-07-14 11:46:20 +0900298==== Update homepage links
Yuxuan 'fishy' Wangf7803972014-09-03 12:23:21 -0700299
David Pursehouse122f0782018-09-28 13:45:23 +0900300Upload a change on the link:https://gerrit-review.googlesource.com/admin/repos/homepage[
David Pursehouse08726a82015-07-14 11:46:20 +0900301homepage project] to change the version numbers to the new version.
Martin Fick21e278e2012-02-23 13:45:54 -0700302
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200303[[update-issues]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800304==== Update the Issues
Martin Fick21e278e2012-02-23 13:45:54 -0700305
Michael Ochmannb99feab2016-07-06 14:10:22 +0200306Update the issues by hand. There is no script for this.
Martin Fick21e278e2012-02-23 13:45:54 -0700307
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200308Our current process is an issue should be updated to say `Status =
Dave Borowitz23607652017-10-01 20:16:49 +0100309Submitted, FixedIn-$version` once the change is submitted, but before the
Martin Fick21e278e2012-02-23 13:45:54 -0700310release.
311
312After the release is actually made, you can search in Google Code for
Dave Borowitz23607652017-10-01 20:16:49 +0100313`Status=Submitted FixedIn=$version` and then batch update these changes
Michael Ochmannb99feab2016-07-06 14:10:22 +0200314to say `Status=Released`. Make sure the pulldown says `All Issues`
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200315because `Status=Submitted` is considered a closed issue.
Martin Fick21e278e2012-02-23 13:45:54 -0700316
317
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200318[[announce]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800319==== Announce on Mailing List
Martin Fick21e278e2012-02-23 13:45:54 -0700320
David Pursehoused15e4362017-07-19 11:06:52 +0900321Send an email to the mailing list to announce the release. The content of the
David Pursehouse731e2652018-06-21 15:44:46 +0900322announcement email is generated with the `release-announcement.py` script from
323the gerrit-release-tools repository, which automatically includes all the
324necessary links, hash values, and wraps the text in a PGP signature.
David Pursehouseb3f1deb2017-06-30 13:37:11 +0900325
David Pursehoused15e4362017-07-19 11:06:52 +0900326For details refer to the documentation in the script's header, and/or the
327help text:
328
329----
David Pursehouse731e2652018-06-21 15:44:46 +0900330 ~/gerrit-release-tools/release-announcement.py --help
David Pursehoused15e4362017-07-19 11:06:52 +0900331----
Martin Fick21e278e2012-02-23 13:45:54 -0700332
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200333[[increase-version]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800334=== Increase Gerrit Version for Current Development
Martin Fick21e278e2012-02-23 13:45:54 -0700335
David Pursehousef7c9f2c2014-12-09 19:36:04 +0900336All new development that is done in the `master` branch will be included in the
337next Gerrit release. The Gerrit version should be set to the snapshot version
338for the next release.
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200339
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800340Use the `version` tool to set the version in the `version.bzl` file:
David Pursehousef7c9f2c2014-12-09 19:36:04 +0900341
342----
Patrick Hiesel9d165c52017-04-13 10:08:53 +0200343 ./tools/version.py 2.6-SNAPSHOT
David Pursehousef7c9f2c2014-12-09 19:36:04 +0900344----
345
346Verify that the changes made by the tool are sane, then commit them, push
347the change for review on the master branch, and get it merged.
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200348
349[[merge-stable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800350=== Merge `stable` into `master`
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200351
352After every release, stable should be merged to master to ensure that
353none of the changes/fixes ever get lost.
Martin Fick21e278e2012-02-23 13:45:54 -0700354
David Pursehouse383a3182013-12-06 13:06:57 +0900355----
356 git config merge.summary true
357 git checkout master
358 git reset --hard origin/master
359 git branch -f stable origin/stable
360 git merge stable
361----
Martin Fickec31ff42012-06-23 11:35:39 -0600362
David Ostrovsky01a33d82017-08-31 19:49:12 +0200363[[update-api-version-in-bazlets-repository]]
364
365Bazlets is used by gerrit plugins to simplify build process. To allow the
366new released version to be used by gerrit plugins,
367link:https://gerrit.googlesource.com/bazlets/+/master/gerrit_api.bzl#8[gerrit_api.bzl]
368must reference the new version. Upload a change to bazlets repository with
369api version upgrade.
Martin Fickec31ff42012-06-23 11:35:39 -0600370
Patrick Hiesel14f5aec2018-09-04 14:33:11 +0200371[[clean-up-on-master]]
372=== Clean up on master
373
374Once you are done with the release, check if there are any code changes in the
375master branch that were gated on the next release. Mostly, these are
376feature-deprecations that we were holding off on to have a stable release where
377the feature is still contained, but marked as deprecated.
378
Luca Milanesio38dd3282019-08-22 13:49:58 +0100379See link:dev-processes.html#deprecating-features[Deprecating features] for
Patrick Hiesel14f5aec2018-09-04 14:33:11 +0200380details.
381
Martin Fickec31ff42012-06-23 11:35:39 -0600382GERRIT
383------
384Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700385
386SEARCHBOX
387---------