Filippo Valsorda | a5c5aae | 2018-04-17 14:56:14 -0400 | [diff] [blame] | 1 | Fixes for regressions, security issues, and serious problems with no workaround are backported to the two supported major releases. For example a fix developed during the 1.11 cycle will be backported to a 1.9.x (if applicable) and 1.10.x release. |
| 2 | |
Filippo Valsorda | 6a0db9a | 2018-04-23 15:46:30 -0400 | [diff] [blame] | 3 | As soon as an interested party thinks an issue should be considered for backport, they open one or two “child” issues titled like `package: title [1.9 backport]`. The issue should include a link to the original issue and a short rationale about why the backport might be needed. |
Filippo Valsorda | 49a707b | 2018-04-23 13:38:23 -0400 | [diff] [blame] | 4 | |
| 5 | GopherBot is capable of opening the backport issues automatically in response to comments like the following on the main issue. (The keywords are `@gopherbot`, `backport`, `please` and optionally the release. The entire message is quoted in the new issue.) |
| 6 | |
| 7 | > @gopherbot please consider this for backport to 1.10, it's a regression. |
| 8 | |
| 9 | > @gopherbot please open the backport tracking issues. This is a severe compiler bug. |
Filippo Valsorda | a5c5aae | 2018-04-17 14:56:14 -0400 | [diff] [blame] | 10 | |
Filippo Valsorda | a526ed8 | 2018-04-23 13:50:08 -0400 | [diff] [blame] | 11 | The fix is developed for the main issue, which is closed when the fix is merged to the master branch. |
Filippo Valsorda | a5c5aae | 2018-04-17 14:56:14 -0400 | [diff] [blame] | 12 | |
Filippo Valsorda | 6a0db9a | 2018-04-23 15:46:30 -0400 | [diff] [blame] | 13 | The child issue is assigned to the minor release milestone and labeled **CherryPickCandidate**, and its candidacy is discussed there. Once it is approved it transitions to **CherryPickApproved**. Release managers (a subset of the Go team that handles the release process) and/or code owners approve cherry-picks via an informal process. |
Filippo Valsorda | a5c5aae | 2018-04-17 14:56:14 -0400 | [diff] [blame] | 14 | |
Filippo Valsorda | 6a5ec5b | 2018-04-23 17:52:26 -0400 | [diff] [blame] | 15 | When the child issue is labeled **CherryPickApproved**, the original author of the change fixing |
| 16 | that issue should immediately [create and mail a cherry-pick change](#making-cherry-pick-cls) against the release branch, which will be merged as soon as it is ready, closing the child issue. |
Filippo Valsorda | e281bf2 | 2018-04-23 14:36:05 -0400 | [diff] [blame] | 17 | |
| 18 | At release time, any open backport issue which is not release-blocker is pushed to the next minor release milestone, and a minor release is minted with the already merged changes. |
| 19 | |
| 20 | ## Making cherry-pick CLs |
| 21 | |
Filippo Valsorda | 23c6d4a | 2018-05-08 13:46:38 -0400 | [diff] [blame] | 22 | Once the main fix has been submitted to master, you can use the Gerrit UI to make a cherry-pick if there are no merge conflicts: |
| 23 | |
| 24 |  |
| 25 | |
| 26 | In the popup enter the branch name (like `release-branch.go1.10`), add the commit message prefix (like `[release-branch.go1.10]`), update the "Fixes" line and do not change any of the other automated lines. |
| 27 | |
| 28 | To cherry-pick from the command line or to resolve a merge conflict, take note of the final commit hash, then use `git codereview` and `git cherry-pick` to prepare a cherry-pick CL: |
Filippo Valsorda | e281bf2 | 2018-04-23 14:36:05 -0400 | [diff] [blame] | 29 | |
Filippo Valsorda | 6a0db9a | 2018-04-23 15:46:30 -0400 | [diff] [blame] | 30 | ``` |
Josh Bleecher Snyder | 15e1b14 | 2018-04-23 16:00:55 -0700 | [diff] [blame] | 31 | git checkout release-branch.go1.10 |
Filippo Valsorda | 6a0db9a | 2018-04-23 15:46:30 -0400 | [diff] [blame] | 32 | git codereview change cherry-pick-NNNN |
| 33 | git cherry-pick $COMMIT_HASH |
| 34 | git commit --amend # add message prefix and change Fixes line |
| 35 | git codereview mail |
| 36 | ``` |
Filippo Valsorda | bb24d52 | 2018-04-23 14:16:27 -0400 | [diff] [blame] | 37 | |
Filippo Valsorda | 23c6d4a | 2018-05-08 13:46:38 -0400 | [diff] [blame] | 38 | **The cherry-pick CL must include a message prefix like `[release-branch.go1.10]`, and update the "Fixes" line to the child issue. Do not change or remove the "Change-Id" line nor the other Gerrit lines.** |
Filippo Valsorda | a5c5aae | 2018-04-17 14:56:14 -0400 | [diff] [blame] | 39 | |
Filippo Valsorda | e281bf2 | 2018-04-23 14:36:05 -0400 | [diff] [blame] | 40 | Gerrit is configured to only allow release managers to submit to release branches, but the code review process is otherwise the usual. |
Filippo Valsorda | a5c5aae | 2018-04-17 14:56:14 -0400 | [diff] [blame] | 41 | |
| 42 | ## Security releases |
| 43 | |
| 44 | Security releases preempt the next minor release and need to ship only the security fix. |
| 45 | |
| 46 | To avoid rolling back the release branch in that exceptional case, a new release branch is created based on the previous release. For example `release-branch.go1.9.5` is branched from tag `go1.9.4`. The release is tagged from that branch, and the branch is then merged into the main release branch. For example `release-branch.go1.9.5` is merged into `release-branch.go1.9`. |
| 47 | |