Double check the PR is eligible for backport as per this linked page.
Verify that the backport PR does not add a cluster version nor a version gate.
(i.e. it does not make changes to
pkg/clusterversion/cockroach_versions.gonor does it contain checks that compare the current version to one of the newer versions.)
Ask on #engineering if you need details about why backports must never add cluster versions or version gates.
Check the release notes in the commit messages, to ensure they are applicable to the branch (if a release note refers to another change / PR that is not being backported, or that may be backported later, suggest a rephrasing.)
Make sure the
backporttool is installed:
go get install github.com/benesch/backportbackport@latest
For first time setup, you will need to set the
cockroach.remotegit config option. If your fork of cockroach is in the remote named
origin, then set it with
git config cockroach.remote originwhile in your local cockroach git repo.
backport -r VV.V xxxxx, where
VV.Vis replaced by the version number of the release branch and
xxxxxis replaced by the GitHub PR number of the PR you are trying to backport, or a space-separated list of PR numbers.
This will automatically create a backport branch and upload it to your repository against the release branch to GitHub.
Then, it will try to open your browser to create a new PR with that branch, or provide instruction on how to do this manually if it cannot open your browser.
If there were merge conflicts,
backportwill halt and ask you to fix them. Once they're fixed, run
backport --continueto continue the procedure.
If there were any non-trivial merge conflicts, be sure to call those out in the PR message so reviewers can pay closer attention to the diff.
If something goes wrong, you can use
backport --abortto give up on the current manual backport.
Note: You do not need to use bors to merge a backport PR; just hit the big green button once the CI is green and the backport is approved by the reviewer (usually the main reviewer of the original PR to