Skip to content

Commit 864fe56

Browse files
rluvatonruyadorno
authored andcommitted
doc: add git node backport way to the backporting guide
also updated 10.x to 20.x in backporting examples PR-URL: #49760 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
1 parent 5ac6722 commit 864fe56

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

doc/contributing/backporting-to-release-lines.md

+33-15
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,26 @@ For the following labels, the `N` in `vN.x` refers to the major release number.
4040

4141
## How to submit a backport pull request
4242

43-
For the following steps, let's assume that a backport is needed for the v10.x
44-
release line. All commands will use the `v10.x-staging` branch as the target
45-
branch. In order to submit a backport pull request to another branch, simply
46-
replace that with the staging branch for the targeted release line.
43+
For the following steps, let's assume that you need to backport PR `123`
44+
to the v20.x release line. All commands will use the `v20.x-staging` branch
45+
as the target branch. In order to submit a backport pull request to another
46+
branch, simply replace that with the staging branch for the targeted release
47+
line.
48+
49+
### Automated
50+
51+
1. Make sure you have [`node-core-utils`][] installed
52+
53+
2. Run the [`git node backport`][] command
54+
55+
```bash
56+
# Backport PR 123 to v20.x-staging
57+
git node backport 123 --to=20
58+
```
59+
60+
3. Jump to step 5 in the Manual section below
61+
62+
### Manually
4763

4864
1. Checkout the staging branch for the targeted release line.
4965

@@ -56,10 +72,10 @@ replace that with the staging branch for the targeted release line.
5672
# the origin remote points to your fork, and the upstream remote points
5773
# to [email protected]:nodejs/node.git
5874
cd $NODE_DIR
59-
# If v10.x-staging is checked out `pull` should be used instead of `fetch`
60-
git fetch upstream v10.x-staging:v10.x-staging -f
75+
# If v20.x-staging is checked out `pull` should be used instead of `fetch`
76+
git fetch upstream v20.x-staging:v20.x-staging -f
6177
# Assume we want to backport PR #10157
62-
git checkout -b backport-10157-to-v10.x v10.x-staging
78+
git checkout -b backport-10157-to-v20.x v20.x-staging
6379
# Ensure there are no test artifacts from previous builds
6480
# Note that this command deletes all files and directories
6581
# not under revision control below the ./test directory.
@@ -93,10 +109,10 @@ replace that with the staging branch for the targeted release line.
93109
8. Push the changes to your fork.
94110

95111
9. Open a pull request:
96-
1. Be sure to target the `v10.x-staging` branch in the pull request.
112+
1. Be sure to target the `v20.x-staging` branch in the pull request.
97113
2. Include the backport target in the pull request title in the following
98-
format: `[v10.x backport] <commit title>`.
99-
Example: `[v10.x backport] process: improve performance of nextTick`
114+
format: `[v20.x backport] <commit title>`.
115+
Example: `[v20.x backport] process: improve performance of nextTick`
100116
3. Check the checkbox labeled "Allow edits and access to secrets by
101117
maintainers".
102118
4. In the description add a reference to the original pull request.
@@ -105,15 +121,17 @@ replace that with the staging branch for the targeted release line.
105121
6. Run a [`node-test-pull-request`][] CI job (with `REBASE_ONTO` set to the
106122
default `<pr base branch>`)
107123

108-
10. Replace the `backport-requested-v10.x` label on the original pull request
109-
with `backport-open-v10.x`.
124+
10. Replace the `backport-requested-v20.x` label on the original pull request
125+
with `backport-open-v20.x`.
110126

111127
11. If during the review process conflicts arise, use the following to rebase:
112-
`git pull --rebase upstream v10.x-staging`
128+
`git pull --rebase upstream v20.x-staging`
113129

114-
After the pull request lands, replace the `backport-open-v10.x` label on the
115-
original pull request with `backported-to-v10.x`.
130+
After the pull request lands, replace the `backport-open-v20.x` label on the
131+
original pull request with `backported-to-v20.x`.
116132

117133
[Release Plan]: https://github.com/nodejs/Release#release-plan
118134
[Release Schedule]: https://github.com/nodejs/Release#release-schedule
135+
[`git node backport`]: https://github.com/nodejs/node-core-utils/blob/main/docs/git-node.md#git-node-backport
136+
[`node-core-utils`]: https://github.com/nodejs/node-core-utils
119137
[`node-test-pull-request`]: https://ci.nodejs.org/job/node-test-pull-request/build

0 commit comments

Comments
 (0)