blob: e2b39c7fdb1967191859350e71701456a1529cae [file] [log] [blame] [view]
Russ Cox270a22d2023-12-05 11:15:03 -05001---
2title: MinorReleases
3---
4
Matt Layher18c7c7d2023-06-12 22:01:50 -04005Our default decision should always be to not backport, but fixes for **security issues**, **serious problems with no workaround**, and **documentation fixes** are backported to the most recent two release branches, if applicable to that branch. (for example, the most current two release branches are `release-branch.go1.16` and `release-branch.go1.17`, from which new `Go 1.16.x` and `Go 1.17.x` releases are cut) Fixes for experimental ports are generally not backported.
6
7A “serious” problem is one that prevents a program from working at all.
8
9As 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.17 backport]`. The issue should include a link to the original issue and a short rationale about why the backport might be needed.
10
11GopherBot 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.)
12
13> @gopherbot please consider this for backport to 1.17, it's a regression.
14
15> @gopherbot please open the backport tracking issues. This is a severe compiler bug.
16
17The fix is developed for the main issue, which is closed when the fix is merged to the master branch.
18
19The 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.
20
21When the child issue is labeled **CherryPickApproved**, the original author of the change fixing
Keith Randall42771702024-05-07 09:10:46 -070022that issue should immediately [create and mail a cherry-pick change](#making-cherry-pick-cls) against the release branch, which can be merged as soon as it is ready, closing the child issue.
Matt Layher18c7c7d2023-06-12 22:01:50 -040023
24At 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.
25
26## Making cherry-pick CLs
27
Heschi Kreinick193ffaf2023-07-18 12:47:09 -040028_Note that only the authors of the original CL and approvers have the ability to create the cherry-pick._
Matt Layher18c7c7d2023-06-12 22:01:50 -040029
30Once the main fix has been submitted to master, please make a cherry-pick CL to the applicable release branch.
31
32You can use the Gerrit UI to make a cherry-pick if there are no merge conflicts:
33
34![Top right corner > More > Cherry-pick](https://user-images.githubusercontent.com/1225294/39773359-dc0c2b3a-52c5-11e8-836a-c518186e0ab3.png)
35
36In 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.
37
38To 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:
39
40```
41git checkout release-branch.go1.17
42git codereview change cherry-pick-NNNN
43git cherry-pick $COMMIT_HASH
44git commit --amend # add message prefix and change Fixes line
45git codereview mail
46```
47
48**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.**
49
Keith Randall42771702024-05-07 09:10:46 -070050The code review process is otherwise the same as regular CLs. Permission to submit to the release branches is more restricted. If you do not have submit permissions then once your CL is otherwise ready release managers will submit it for you. If you do have permission, be sure to not submit the CL until the corresponding issue is marked **CherryPickApproved**.
Matt Layher18c7c7d2023-06-12 22:01:50 -040051
Russ Cox270a22d2023-12-05 11:15:03 -050052At this time, it's not possible to make a cherry-pick CL by sending a [pull request](GerritBot). Only Gerrit is supported. See [golang.org/issue/30037](https://go.dev/issue/30037).
Matt Layher18c7c7d2023-06-12 22:01:50 -040053
54### Cherry-pick CLs for vendored golang.org/x packages
55
56The Go standard library includes some generated files whose source of truth is outside the main repository, in golang.org/x repositories. For example, a copy of the `golang.org/x/sys/unix` package is [vendored](https://go.googlesource.com/go/+/go1.16/src/cmd/vendor/modules.txt#45) into the Go tree, and a copy of the `golang.org/x/net/http2` package is [bundled](https://go.googlesource.com/go/+/go1.16/src/net/http/http.go#5). That means a fix to a golang.org/x package that needs to be backported to a Go release will need two corresponding CLs:
57
581. In the golang.org/x repository, cherry-pick the fix from the `master` branch to the `internal-branch.go1.x-vendor` branch.
59
60 The commit message should include "Updates golang/go#nnn" to mention the backport issue.
61
622. In the main repository on the `release-branch.go1.x` branch, create a CL that pulls in the fix from the golang.org/x internal branch:
63
64 ```
Dmitri Shuralyovae82b362023-07-17 10:32:35 -040065 go get golang.org/x/repo@internal-branch.go1.x-vendor
Matt Layher18c7c7d2023-06-12 22:01:50 -040066 go mod tidy
67 go mod vendor
68 go generate -run=bundle std # If a bundled package needs regeneration.
69 ```
70
71 The commit message should include "Fixes #nnn" to close the backport issue.
72
73(As of Go 1.16, the golang.org/x branch name is always `internal-branch.go1.x-vendor`. In Go 1.15, the name of the golang.org/x branch is `release-branch.go1.x` or `release-branch.go1.x-bundle` in [special cases](https://go.dev/cl/305489).)
Russ Cox270a22d2023-12-05 11:15:03 -050074