@@ -40,10 +40,26 @@ For the following labels, the `N` in `vN.x` refers to the major release number. |
40 | 40 |
|
41 | 41 | ## How to submit a backport pull request |
42 | 42 |
|
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 |
47 | 63 |
|
48 | 64 | 1. Checkout the staging branch for the targeted release line. |
49 | 65 |
|
@@ -56,10 +72,10 @@ replace that with the staging branch for the targeted release line. |
56 | 72 | # the origin remote points to your fork, and the upstream remote points |
57 | 73 | |
58 | 74 | 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 |
61 | 77 | # 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 |
63 | 79 | # Ensure there are no test artifacts from previous builds |
64 | 80 | # Note that this command deletes all files and directories |
65 | 81 | # not under revision control below the ./test directory. |
@@ -93,10 +109,10 @@ replace that with the staging branch for the targeted release line. |
93 | 109 | 8. Push the changes to your fork. |
94 | 110 |
|
95 | 111 | 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. |
97 | 113 | 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` |
100 | 116 | 3. Check the checkbox labeled "Allow edits and access to secrets by |
101 | 117 | maintainers". |
102 | 118 | 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. |
105 | 121 | 6. Run a [`node-test-pull-request`][] CI job (with `REBASE_ONTO` set to the |
106 | 122 | default `<pr base branch>`) |
107 | 123 |
|
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`. |
110 | 126 |
|
111 | 127 | 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` |
113 | 129 |
|
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`. |
116 | 132 |
|
117 | 133 | [Release Plan]: https://github.com/nodejs/Release#release-plan |
118 | 134 | [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 |
119 | 137 | [`node-test-pull-request`]: https://ci.nodejs.org/job/node-test-pull-request/build |