Skip to content

Commit a63e54a

Browse files
refackaddaleax
authored andcommitted
doc: update backporting guide
* also update STYLE_GUIDE comment about Em dashes PR-URL: #13749 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
1 parent f1d96f0 commit a63e54a

File tree

2 files changed

+50
-54
lines changed

2 files changed

+50
-54
lines changed

doc/STYLE_GUIDE.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
* When documenting APIs, note the version the API was introduced in at
4141
the end of the section. If an API has been deprecated, also note the first
4242
version that the API appeared deprecated in.
43-
* When using dashes, use emdashes ("—", Option+Shift+"-" on macOS) surrounded by
44-
spaces, per the New York Times usage.
43+
* When using dashes, use [Em dashes][] ("—" or `Option+Shift+"-"` on macOS)
44+
surrounded by spaces, as per [The New York Times Manual of Style and Usage][].
4545
* Including assets:
4646
* If you wish to add an illustration or full program, add it to the
4747
appropriate sub-directory in the `assets/` dir.
@@ -68,3 +68,5 @@
6868

6969
[plugin]: http://editorconfig.org/#download
7070
[Oxford comma]: https://en.wikipedia.org/wiki/Serial_comma
71+
[Em dashes]: https://en.wikipedia.org/wiki/Dash#Em_dash
72+
[The New York Times Manual of Style and Usage]: https://en.wikipedia.org/wiki/The_New_York_Times_Manual_of_Style_and_Usage

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

+46-52
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,49 @@ Each release line has a staging branch that the releaser will use as a scratch
66
pad while preparing a release. The branch name is formatted as follows:
77
`vN.x-staging` where `N` is the major release number.
88

9-
### Active staging branches
10-
11-
| Release Line | Staging Branch |
12-
| ------------ | -------------- |
13-
| `v7.x` | `v7.x-staging` |
14-
| `v6.x` | `v6.x-staging` |
15-
| `v4.x` | `v4.x-staging` |
9+
*Note*: For the active staging branches see the [LTS Schedule][].
1610

1711
## What needs to be backported?
1812

1913
If a cherry-pick from master does not land cleanly on a staging branch, the
2014
releaser will mark the pull request with a particular label for that release
21-
line, specifying to our tooling that this pull request should not be included.
22-
The releaser will then add a comment that a backport is needed.
15+
line (e.g. `backport-requested-vN.x`), specifying to our tooling that this
16+
pull request should not be included. The releaser will then add a comment
17+
requesting that a backport pull request be made.
2318

2419
## What can be backported?
2520

2621
The "Current" release line is much more lenient than the LTS release lines in
27-
what can be landed. Our LTS release lines (v4.x and v6.x as of March 2017)
28-
require that commits mature in a Current release for at least 2 weeks before
29-
they can be landed on staging. If the commit can not be cherry-picked from
30-
master a manual backport will need to be submitted. Please see the [LTS Plan][]
31-
for more information. After that time, if the commit can be cherry-picked
32-
cleanly from master, then nothing needs to be done. If not, a backport pull
33-
request will need to be submitted.
22+
what can be landed. Our LTS release lines (see the [LTS Plan][])
23+
require that commits mature in the Current release for at least 2 weeks before
24+
they can be landed in an LTS staging branch. Only after "maturation" will those
25+
commits be cherry-picked or backported.
3426

3527
## How to submit a backport pull request
3628

37-
For these steps, let's assume that a backport is needed for the v7.x release
38-
line. All commands will use the v7.x-staging branch as the target branch.
39-
In order to submit a backport pull request to another branch, simply replace
40-
that with the staging branch for the targeted release line.
29+
For the following steps, let's assume that a backport is needed for the v6.x
30+
release line. All commands will use the `v6.x-staging` branch as the target
31+
branch. In order to submit a backport pull request to another branch, simply
32+
replace that with the staging branch for the targeted release line.
4133

42-
* Checkout the staging branch for the targeted release line
43-
* Make sure that the local staging branch is up to date with the remote
44-
* Create a new branch off of the staging branch
34+
1. Checkout the staging branch for the targeted release line
35+
2. Make sure that the local staging branch is up to date with the remote
36+
3. Create a new branch off of the staging branch
4537

4638
```shell
4739
# Assuming your fork of Node.js is checked out in $NODE_DIR,
4840
# the origin remote points to your fork, and the upstream remote points
4941
# to git://github.com/nodejs/node
5042
cd $NODE_DIR
51-
# Fails if you already have a v7.x-staging
52-
git branch v7.x-staging upstream/v7.x-staging
53-
git checkout v7.x-staging
54-
git reset --hard upstream/v7.x-staging
55-
# We want to backport pr #10157
56-
git checkout -b backport-10157-to-v7.x
43+
# If v6.x-staging is checked out `pull` should be used instead of `fetch`
44+
git fetch upstream v6.x-staging:v6.x-staging -f
45+
# Assume we want to backport PR #10157
46+
git checkout -b backport-10157-to-v6.x v6.x-staging
5747
```
5848

59-
* After creating the branch, apply the changes to the branch. The cherry-pick
60-
will likely fail due to conflicts. In that case, you will see something this:
49+
4. After creating the branch, apply the changes to the branch. The cherry-pick
50+
will likely fail due to conflicts. In that case, you will see something
51+
like this:
6152

6253
```shell
6354
# Say the $SHA is 773cdc31ef
@@ -68,25 +59,28 @@ hint: with 'git add <paths>' or 'git rm <paths>'
6859
hint: and commit the result with 'git commit'
6960
```
7061

71-
* Make the required changes to remove the conflicts, add the files to the index
72-
using `git add`, and then commit the changes. That can be done with
73-
`git cherry-pick --continue`.
74-
* Leave the commit message as is. If you think it should be modified, comment
75-
in the Pull Request.
76-
* Make sure `make -j4 test` passes
77-
* Push the changes to your fork and open a pull request.
78-
* Be sure to target the `v7.x-staging` branch in the pull request.
79-
80-
### Helpful Hints
81-
82-
* Please include the backport target in the pull request title in the following
83-
format: `(v7.x backport) <commit title>`
84-
* Ex. `(v4.x backport) process: improve performance of nextTick`
85-
* Please check the checkbox labelled "Allow edits from maintainers".
86-
This is the easiest way to to avoid constant rebases.
87-
88-
In the event the backport pull request is different than the original,
89-
the backport pull request should be reviewed the same way a new pull request
90-
is reviewed.
91-
62+
5. Make the required changes to remove the conflicts, add the files to the index
63+
using `git add`, and then commit the changes. That can be done with
64+
`git cherry-pick --continue`.
65+
6. Leave the commit message as is. If you think it should be modified, comment
66+
in the Pull Request.
67+
7. Make sure `make -j4 test` passes.
68+
8. Push the changes to your fork
69+
9. Open a pull request:
70+
1. Be sure to target the `v6.x-staging` branch in the pull request.
71+
2. Include the backport target in the pull request title in the following
72+
format — `[v6.x backport] <commit title>`.
73+
Example: `[v6.x backport] process: improve performance of nextTick`
74+
3. Check the checkbox labelled "Allow edits from maintainers".
75+
4. In the description add a reference to the original PR
76+
5. Run a [`node-test-pull-request`][] CI job (with `REBASE_ONTO` set to the
77+
default `<pr base branch>`)
78+
10. If during the review process conflicts arise, use the following to rebase:
79+
`git pull --rebase upstream v6.x-staging`
80+
81+
After the PR lands replace the `backport-requested-v6.x` label on the original
82+
PR with `backported-to-v6.x`.
83+
84+
[LTS Schedule]: https://github.com/nodejs/LTS/#lts-schedule1
9285
[LTS Plan]: https://github.com/nodejs/LTS#lts-plan
86+
[`node-test-pull-request`]: https://ci.nodejs.org/job/node-test-pull-request/build

0 commit comments

Comments
 (0)