blob: 039d545d24de6e3c74e7de000a315566e97c9560 [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
Edwin Kempinbb8e6252012-07-31 14:30:35 +020076To create a Gerrit release the following steps have to be done:
Sasa Zivkov619f9ed2012-05-25 14:49:29 +020077
David Pursehouse383a3182013-12-06 13:06:57 +090078. link:#build-gerrit[Build the Gerrit Release]
Edwin Kempinbb8e6252012-07-31 14:30:35 +020079. link:#publish-gerrit[Publish the Gerrit Release]
David Pursehousedd066e42015-04-17 17:53:57 +090080.. link:#publish-to-maven-central[Publish the Gerrit artifacts to Maven Central]
81.. link:#publish-to-google-storage[Publish the Gerrit WAR to Google Storage]
Edwin Kempinbb8e6252012-07-31 14:30:35 +020082.. link:#push-stable[Push the Stable Branch]
83.. link:#push-tag[Push the Release Tag]
84.. link:#upload-documentation[Upload the Documentation]
David Pursehoused228d6d2016-10-19 19:25:35 +090085.. link:#finalize-release-notes[Finalize Release Notes]
Edwin Kempinbb8e6252012-07-31 14:30:35 +020086.. link:#update-issues[Update the Issues]
87.. link:#announce[Announce on Mailing List]
88. link:#increase-version[Increase Gerrit Version for Current Development]
89. link:#merge-stable[Merge `stable` into `master`]
Martin Fick21e278e2012-02-23 13:45:54 -070090
91
Dave Borowitz9b877072017-10-01 16:17:42 -040092[[update-versions]]
93=== Update Versions and Create Release Tag
Edwin Kempin6ba21942014-06-03 09:16:20 +020094
Patrick Hiesel9d165c52017-04-13 10:08:53 +020095Before doing the release build, the `GERRIT_VERSION` in the `version.bzl`
David Pursehouse5b425932015-01-22 16:46:00 +090096file must be updated, e.g. change it from `2.5-SNAPSHOT` to `2.5`.
Edwin Kempin6ba21942014-06-03 09:16:20 +020097
Dave Borowitz9b877072017-10-01 16:17:42 -040098In addition the version must be updated in a number of pom.xml files.
99
100To do this run the `./tools/version.py` script and provide the new
101version as parameter, e.g.:
102
103----
104 ./tools/version.py 2.5
105----
106
107Commit the changes and create a signed release tag on the new commit:
Edwin Kempin6ba21942014-06-03 09:16:20 +0200108
109----
David Pursehouse02224a12017-07-03 14:22:34 +0900110 git tag -s -m "v2.5" v2.5
Edwin Kempin6ba21942014-06-03 09:16:20 +0200111----
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200112
David Pursehousea1ab3e72015-01-30 14:57:11 +0900113Tag the plugins:
114
115----
David Pursehouse02224a12017-07-03 14:22:34 +0900116 git submodule foreach git tag -s -m "v2.5" v2.5
David Pursehousea1ab3e72015-01-30 14:57:11 +0900117----
118
Shawn Pearcebf8ebbe2013-05-06 14:23:26 -0700119[[build-gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800120=== Build Gerrit
Martin Fick21e278e2012-02-23 13:45:54 -0700121
Yuxuan 'fishy' Wang6714b0d2016-05-03 12:58:04 -0700122* Build the Gerrit WAR, API JARs and documentation
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200123+
David Pursehouse383a3182013-12-06 13:06:57 +0900124----
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800125 bazel build release Documentation:searchfree
126 ./tools/maven/api.sh install
David Pursehouse383a3182013-12-06 13:06:57 +0900127----
Martin Fick21e278e2012-02-23 13:45:54 -0700128
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200129* Sanity check WAR
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200130* Test the new Gerrit version
Martin Fick21e278e2012-02-23 13:45:54 -0700131
David Pursehouse7eb16eb2016-03-11 12:01:56 +0900132* Verify plugin versions
133+
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800134Verify the versions:
David Pursehouse7eb16eb2016-03-11 12:01:56 +0900135+
136----
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800137 java -jar bazel-bin/release.war init --list-plugins
David Pursehouse7eb16eb2016-03-11 12:01:56 +0900138----
139
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200140[[publish-gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800141=== Publish the Gerrit Release
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200142
Edwin Kempin210b6362014-06-03 13:33:16 +0200143[[publish-to-maven-central]]
144==== Publish the Gerrit artifacts to Maven Central
145
146* Make sure you have done the
147link:dev-release-deploy-config.html#deploy-configuration-setting-maven-central[
148configuration] for deploying to Maven Central
149
Dave Borowitz9b877072017-10-01 16:17:42 -0400150* Make sure that the version is updated in the `version.bzl` file and in
151the `pom.xml` files as described in the link:#update-versions[Update
152Versions and Create Release Tag] section.
Edwin Kempin210b6362014-06-03 13:33:16 +0200153
Edwin Kempine5b49432014-06-03 09:25:39 +0200154* Push the WAR to Maven Central:
155+
156----
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800157 ./tools/maven/api.sh war_deploy
Edwin Kempine5b49432014-06-03 09:25:39 +0200158----
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200159
Edwin Kempin210b6362014-06-03 13:33:16 +0200160* Push the plugin artifacts to Maven Central:
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200161+
162----
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800163 ./tools/maven/api.sh deploy
Edwin Kempin210b6362014-06-03 13:33:16 +0200164----
165
Edwin Kempin210b6362014-06-03 13:33:16 +0200166* To where the artifacts are uploaded depends on the `GERRIT_VERSION` in
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800167the `version.bzl` file:
Edwin Kempin210b6362014-06-03 13:33:16 +0200168
169** SNAPSHOT versions are directly uploaded into the Sonatype snapshots
170repository and no further action is needed:
171+
172https://oss.sonatype.org/content/repositories/snapshots/com/google/gerrit/
173
174** Release versions are uploaded into a staging repository in the
175link:https://oss.sonatype.org/[Sonatype Nexus Server].
176
177* Verify the staging repository
Edwin Kempin210b6362014-06-03 13:33:16 +0200178
179** Go to the link:https://oss.sonatype.org/[Sonatype Nexus Server] and
180sign in with your Sonatype credentials.
181
Edwin Kempin58bc3132014-06-05 14:56:58 +0200182** Click on 'Build Promotion' in the left navigation bar under
183'Staging Repositories' and find the `comgooglegerrit-XXXX` staging
Edwin Kempin210b6362014-06-03 13:33:16 +0200184repository.
185
186** Verify its content
187+
188While the staging repository is open you can upload further content and
189also replace uploaded artifacts. If something is wrong with the staging
190repository you can drop it by selecting it and clicking on `Drop`.
191
192** Run Sonatype validations on the staging repository
193+
194Select the staging repository and click on `Close`. This runs the
195Sonatype validations on the staging repository. The repository will
196only be closed if everything is OK. A closed repository cannot be
197modified anymore, but you may still drop it if you find any issues.
198
199** Test closed staging repository
200+
201Once a repository is closed you can find the URL to it in the `Summary`
202section, e.g. https://oss.sonatype.org/content/repositories/comgooglegerrit-1029
203+
204Use this URL for further testing of the artifacts in this repository,
205e.g. to try building a plugin against the plugin API in this repository
206update the version in the `pom.xml` and configure the repository:
207+
208----
209 <repositories>
210 <repository>
211 <id>gerrit-staging-repository</id>
212 <url>https://oss.sonatype.org/content/repositories/comgooglegerrit-1029</url>
213 </repository>
214 </repositories>
215----
216
217* Release the staging repository
218+
219How to release a staging repository is described in the
220link:https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.a.2.ReleasingaStagingRepository[
221Sonatype OSS Maven Repository Usage Guide].
222+
223[WARNING]
224Releasing artifacts to Maven Central cannot be undone!
225
226** Find the closed staging repository in the
227link:https://oss.sonatype.org/[Sonatype Nexus Server], select it and
228click on `Release`.
229
Edwin Kempin8e63cf42014-06-04 14:24:20 +0200230** The released artifacts are available in
231https://oss.sonatype.org/content/repositories/releases/com/google/gerrit/
232
Edwin Kempin210b6362014-06-03 13:33:16 +0200233** It may take up to 2 hours until the artifacts appear on Maven
234Central:
235+
Edwin Kempin8e63cf42014-06-04 14:24:20 +0200236http://central.maven.org/maven2/com/google/gerrit/
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200237
Edwin Kempin58bc3132014-06-05 14:56:58 +0200238* [optional]: View download statistics
239
240** Sign in to the
241link:https://oss.sonatype.org/[Sonatype Nexus Server].
242
243** Click on 'Views/Repositories' in the left navigation bar under
244'Central Statistics'.
245
246** Select `com.google.gerrit` as `Project`.
247
Martin Fick21e278e2012-02-23 13:45:54 -0700248
David Pursehousedd066e42015-04-17 17:53:57 +0900249[[publish-to-google-storage]]
250==== Publish the Gerrit WAR to the Google Cloud Storage
251
David Pursehouseaf652ab2016-08-29 16:37:22 +0900252* go to the link:https://console.cloud.google.com/storage/browser/gerrit-releases/?project=api-project-164060093628[
253gerrit-releases bucket in the Google cloud storage console]
David Pursehousedd066e42015-04-17 17:53:57 +0900254* make sure you are signed in with your Gmail account
255* manually upload the Gerrit WAR file by using the `Upload` button
256
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200257[[push-stable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800258==== Push the Stable Branch
Martin Fick21e278e2012-02-23 13:45:54 -0700259
David Pursehouse0c104022014-06-02 09:57:14 +0900260* Create the stable branch `stable-2.5` in the `gerrit` project via the
261link:https://gerrit-review.googlesource.com/#/admin/projects/gerrit,branches[
David Pursehousea1d633b2014-05-02 17:21:02 +0900262Gerrit Web UI] or by push.
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200263
264* Push the commits done on `stable-2.5` to `refs/for/stable-2.5` and
265get them merged
266
267
268[[push-tag]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800269==== Push the Release Tag
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200270
David Pursehousea1ab3e72015-01-30 14:57:11 +0900271Push the new Release Tag:
272
David Pursehouse383a3182013-12-06 13:06:57 +0900273----
Saša Živkovffd288e2015-01-28 12:22:37 +0100274 git push gerrit-review tag v2.5
David Pursehouse383a3182013-12-06 13:06:57 +0900275----
Martin Fick21e278e2012-02-23 13:45:54 -0700276
David Pursehousea1ab3e72015-01-30 14:57:11 +0900277Push the new Release Tag on the plugins:
278
279----
280 git submodule foreach git push gerrit-review tag v2.5
281----
282
Martin Fick21e278e2012-02-23 13:45:54 -0700283
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200284[[upload-documentation]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800285==== Upload the Documentation
Martin Fick21e278e2012-02-23 13:45:54 -0700286
Yuxuan 'fishy' Wang6714b0d2016-05-03 12:58:04 -0700287* Extract the documentation files from the zip file generated from
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800288`bazel build searchfree`: `bazel-bin/Documentation/searchfree.zip`.
David Pursehousedb628162014-12-09 19:33:01 +0900289
David Pursehouse62106ac2016-03-11 14:19:48 +0900290* Upload the files manually via web browser to the appropriate folder
291in the
David Pursehouseaf652ab2016-08-29 16:37:22 +0900292link:https://console.cloud.google.com/storage/browser/gerrit-documentation/?project=api-project-164060093628[
David Pursehousea8dca2f2015-04-17 13:59:29 +0900293gerrit-documentation] storage bucket.
Yuxuan 'fishy' Wangf7803972014-09-03 12:23:21 -0700294
David Pursehoused228d6d2016-10-19 19:25:35 +0900295[[finalize-release-notes]]
296=== Finalize the Release Notes
297
298Upload a change on the homepage project to:
299
300* Remove 'In Development' caveat from the relevant section.
301
302* Add links to the released documentation and the .war file, and make the
303latest version bold.
304
David Pursehousedb628162014-12-09 19:33:01 +0900305[[update-links]]
David Pursehouse08726a82015-07-14 11:46:20 +0900306==== Update homepage links
Yuxuan 'fishy' Wangf7803972014-09-03 12:23:21 -0700307
David Pursehouse08726a82015-07-14 11:46:20 +0900308Upload a change on the link:https://gerrit-review.googlesource.com/#/admin/projects/homepage[
309homepage project] to change the version numbers to the new version.
Martin Fick21e278e2012-02-23 13:45:54 -0700310
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200311[[update-issues]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800312==== Update the Issues
Martin Fick21e278e2012-02-23 13:45:54 -0700313
Michael Ochmannb99feab2016-07-06 14:10:22 +0200314Update the issues by hand. There is no script for this.
Martin Fick21e278e2012-02-23 13:45:54 -0700315
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200316Our current process is an issue should be updated to say `Status =
317Submitted, FixedIn-2.5` once the change is submitted, but before the
Martin Fick21e278e2012-02-23 13:45:54 -0700318release.
319
320After the release is actually made, you can search in Google Code for
Michael Ochmannb99feab2016-07-06 14:10:22 +0200321`Status=Submitted FixedIn=2.5` and then batch update these changes
322to say `Status=Released`. Make sure the pulldown says `All Issues`
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200323because `Status=Submitted` is considered a closed issue.
Martin Fick21e278e2012-02-23 13:45:54 -0700324
325
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200326[[announce]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800327==== Announce on Mailing List
Martin Fick21e278e2012-02-23 13:45:54 -0700328
David Pursehoused15e4362017-07-19 11:06:52 +0900329Send an email to the mailing list to announce the release. The content of the
330announcement email is generated with the `release-announcement.py` which
331automatically includes all the necessary links, hash values, and wraps the
332text in a PGP signature.
David Pursehouseb3f1deb2017-06-30 13:37:11 +0900333
David Pursehoused15e4362017-07-19 11:06:52 +0900334For details refer to the documentation in the script's header, and/or the
335help text:
336
337----
338 ./tools/release-announcement.py --help
339----
Martin Fick21e278e2012-02-23 13:45:54 -0700340
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200341[[increase-version]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800342=== Increase Gerrit Version for Current Development
Martin Fick21e278e2012-02-23 13:45:54 -0700343
David Pursehousef7c9f2c2014-12-09 19:36:04 +0900344All new development that is done in the `master` branch will be included in the
345next Gerrit release. The Gerrit version should be set to the snapshot version
346for the next release.
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200347
David Ostrovskyfdbfcad2016-11-15 06:35:29 -0800348Use the `version` tool to set the version in the `version.bzl` file:
David Pursehousef7c9f2c2014-12-09 19:36:04 +0900349
350----
Patrick Hiesel9d165c52017-04-13 10:08:53 +0200351 ./tools/version.py 2.6-SNAPSHOT
David Pursehousef7c9f2c2014-12-09 19:36:04 +0900352----
353
354Verify that the changes made by the tool are sane, then commit them, push
355the change for review on the master branch, and get it merged.
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200356
357[[merge-stable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800358=== Merge `stable` into `master`
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200359
360After every release, stable should be merged to master to ensure that
361none of the changes/fixes ever get lost.
Martin Fick21e278e2012-02-23 13:45:54 -0700362
David Pursehouse383a3182013-12-06 13:06:57 +0900363----
364 git config merge.summary true
365 git checkout master
366 git reset --hard origin/master
367 git branch -f stable origin/stable
368 git merge stable
369----
Martin Fickec31ff42012-06-23 11:35:39 -0600370
David Ostrovsky01a33d82017-08-31 19:49:12 +0200371[[update-api-version-in-bazlets-repository]]
372
373Bazlets is used by gerrit plugins to simplify build process. To allow the
374new released version to be used by gerrit plugins,
375link:https://gerrit.googlesource.com/bazlets/+/master/gerrit_api.bzl#8[gerrit_api.bzl]
376must reference the new version. Upload a change to bazlets repository with
377api version upgrade.
Martin Fickec31ff42012-06-23 11:35:39 -0600378
379GERRIT
380------
381Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700382
383SEARCHBOX
384---------