Skip to content

Commit e8ea839

Browse files
committed
docs: update docs to reflect new PR targeting methods for release trains (angular#38401)
As part of the migration to a common strategy/method for branching and releasing across the main angular repositories, updates need to be made to the documentation. These changes reflect the updates made and is based on the following document which describes the merging label expectations: https://docs.google.com/document/d/197kVillDwx-RZtSVOBtPb4BBIAw0E9RT3q3v6DZkykU PR Close angular#38401
1 parent 90cec40 commit e8ea839

File tree

3 files changed

+39
-73
lines changed

3 files changed

+39
-73
lines changed

docs/CARETAKER.md

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,23 @@ Caretaker is responsible for merging PRs into the individual branches and intern
44

55
## Responsibilities
66

7-
- Draining the queue of PRs ready to be merged. (PRs with [`PR action: merge`](https://github.com/angular/angular/pulls?q=is%3Aopen+is%3Apr+label%3A%22PR+action%3A+merge%22) label)
7+
- Draining the queue of PRs ready to be merged. (PRs with [`action: merge`](https://github.com/angular/angular/pulls?q=is%3Aopen+is%3Apr+label%3A%22action%3A+merge%22) label)
88
- Assigning [new issues](https://github.com/angular/angular/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) to individual component authors.
99

1010
## Merging the PR
1111

12-
A PR needs to have `PR action: merge` and `PR target: *` labels to be considered
13-
ready to merge. Merging is performed by running `merge-pr` with a PR number to merge.
12+
A PR needs to have `action: merge` and `target: *` labels to be considered
13+
ready to merge. Merging is performed by running `ng-dev pr merge` with a PR number to merge.
14+
15+
The tooling automatically verifies the given PR is ready for merge. If the PR passes the tests, the
16+
tool will automatically merge it based on the applied target label.
1417

1518
To merge a PR run:
1619

1720
```
18-
$ ./scripts/github/merge-pr 1234
21+
$ yarn ng-dev pr merge <pr number>
1922
```
2023

21-
The `merge-pr` script will:
22-
- Ensure that all appropriate labels are on the PR.
23-
- Fetches the latest PR code from the `angular/angular` repo.
24-
- It will `cherry-pick` all of the SHAs from the PR into the current corresponding branches `master` and or `?.?.x` (patch).
25-
- It will rewrite commit history by automatically adding `Close #1234` and `(#1234)` into the commit message.
26-
27-
NOTE: The `merge-pr` will land the PR on `master` and or `?.?.x` (patch) as described by `PR target: *` label.
28-
2924
### Recovering from failed `merge-pr` due to conflicts
3025

31-
When running `merge-pr` the script will output the commands which it is about to run.
32-
33-
```
34-
$ ./scripts/github/merge-pr 1234
35-
======================
36-
GitHub Merge PR Steps
37-
======================
38-
git cherry-pick angular/pr/1234~1..angular/pr/1234
39-
git filter-branch -f --msg-filter "/home/misko/angular/scripts/github/utils/github.closes 1234" HEAD~1..HEAD
40-
```
41-
42-
If the `cherry-pick` command fails than resolve conflicts and use `git cherry-pick --continue` once ready. After the `cherry-pick` is done cut&paste and run the `filter-branch` command to properly rewrite the messages
43-
44-
## Cherry-picking PRs into patch branch
45-
46-
In addition to merging PRs into the master branch, many PRs need to be also merged into a patch branch.
47-
Follow these steps to get patch branch up to date.
48-
49-
1. Check out the most recent patch branch: `git checkout 4.3.x`
50-
2. Get a list of PRs merged into master: `git log master --oneline -n10`
51-
3. For each PR number in the commit message run: `./scripts/github/merge-pr 1234`
52-
- The PR will only merge if the `PR target:` matches the branch.
53-
54-
Once all of the PRs are in patch branch, push the all branches and tags to github using `push-upstream` script.
55-
56-
57-
## Pushing merged PRs into github
58-
59-
Use `push-upstream` script to push all of the branch and tags to github.
60-
61-
```
62-
$ ./scripts/github/push-upstream
63-
git push git@github.com:angular/angular.git master:master 4.3.x:4.3.x
64-
Counting objects: 25, done.
65-
Delta compression using up to 6 threads.
66-
Compressing objects: 100% (17/17), done.
67-
Writing objects: 100% (25/25), 2.22 KiB | 284.00 KiB/s, done.
68-
Total 25 (delta 22), reused 8 (delta 7)
69-
remote: Resolving deltas: 100% (22/22), completed with 18 local objects.
70-
To github.com:angular/angular.git
71-
079d884b6..d1c4a94bb master -> master
72-
git push --tags -f git@github.com:angular/angular.git patch_sync:patch_sync
73-
Everything up-to-date
74-
```
26+
The `ng-dev pr merge` tool will automatically restore to the previous git state when a merge fails.

docs/COMMITTER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Change approvals in our monorepo are managed via [PullApprove](https://docs.pull
1212
# Merging
1313

1414
Once a change has all of the required approvals, either the last approver or the PR author (if PR author has the project collaborator status)
15-
should mark the PR with the `PR action: merge` label and the correct [target label](https://github.com/angular/angular/blob/master/docs/TRIAGE_AND_LABELS.md#pr-target).
15+
should mark the PR with the `action: merge` label and the correct [target label](https://github.com/angular/angular/blob/master/docs/TRIAGE_AND_LABELS.md#pr-target).
1616
This signals to the caretaker that the PR should be merged. See [merge instructions](CARETAKER.md).
1717

1818
# Who is the Caretaker?

docs/TRIAGE_AND_LABELS.md

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,28 +125,28 @@ Triaging PRs is the same as triaging issues, except that the labels `frequency:
125125

126126
PRs also have additional label categories that should be used to signal their state.
127127

128-
Every triaged PR must have a `PR action` label assigned to it:
128+
Every triaged PR must have a `action: *` label assigned to it:
129129

130-
* `PR action: discuss`: Discussion is needed, to be led by the author.
130+
* `action: discuss`: Discussion is needed, to be led by the author.
131131
* _**Who adds it:** Typically the PR author._
132132
* _**Who removes it:** Whoever added it._
133-
* `PR action: review` (optional): One or more reviews are pending. The label is optional, since the review status can be derived from GitHub's Reviewers interface.
133+
* `action: review` (optional): One or more reviews are pending. The label is optional, since the review status can be derived from GitHub's Reviewers interface.
134134
* _**Who adds it:** Any team member. The caretaker can use it to differentiate PRs pending review from merge-ready PRs._
135135
* _**Who removes it:** Whoever added it or the reviewer adding the last missing review._
136-
* `PR action: cleanup`: More work is needed from the author.
136+
* `action: cleanup`: More work is needed from the author.
137137
* _**Who adds it:** The reviewer requesting changes to the PR._
138138
* _**Who removes it:** Either the author (after implementing the requested changes) or the reviewer (after confirming the requested changes have been implemented)._
139-
* `PR action: merge`: The PR author is ready for the changes to be merged by the caretaker as soon as the PR is green (or merge-assistance label is applied and caretaker has deemed it acceptable manually). In other words, this label indicates to "auto submit when ready".
139+
* `action: merge`: The PR author is ready for the changes to be merged by the caretaker as soon as the PR is green (or merge-assistance label is applied and caretaker has deemed it acceptable manually). In other words, this label indicates to "auto submit when ready".
140140
* _**Who adds it:** Typically the PR author._
141141
* _**Who removes it:** Whoever added it._
142142

143143

144144
In addition, PRs can have the following states:
145145

146-
* `PR state: WIP`: PR is experimental or rapidly changing. Not ready for review or triage.
146+
* `state: WIP`: PR is experimental or rapidly changing. Not ready for review or triage.
147147
* _**Who adds it:** The PR author._
148148
* _**Who removes it:** Whoever added it._
149-
* `PR state: blocked`: PR is blocked on an issue or other PR. Not ready for merge.
149+
* `state: blocked`: PR is blocked on an issue or other PR. Not ready for merge.
150150
* _**Who adds it:** Any team member._
151151
* _**Who removes it:** Any team member._
152152

@@ -162,13 +162,27 @@ This decision is then honored when the PR is being merged by the caretaker.
162162

163163
To communicate the target we use the following labels:
164164

165-
* `PR target: master & patch`: the PR should me merged into the master branch and cherry-picked into the most recent patch branch. All PRs with fixes, docs and refactorings should use this target.
166-
* `PR target: master-only`: the PR should be merged only into the `master` branch. All PRs with new features, API changes or high-risk changes should use this target.
167-
* `PR target: patch-only`: the PR should be merged only into the most recent patch branch (e.g. 5.0.x). This target is useful if a `master & patch` PR can't be cleanly cherry-picked into the stable branch and a new PR is needed.
168-
* `PR target: LTS-only`: the PR should be merged only into the active LTS branch(es). Only security and critical fixes are allowed in these branches. Always send a new PR targeting just the LTS branch and request review approval from @IgorMinar.
169-
* `PR target: TBD`: the target is yet to be determined.
165+
Targeting an active release train:
170166

171-
If a PR is missing the `PR target: *` label, or if the label is set to "TBD" when the PR is sent to the caretaker, the caretaker should reject the PR and request the appropriate target label to be applied before the PR is merged.
167+
* `target: major`: Any breaking change
168+
* `target: minor`: Any new feature
169+
* `target: patch`: Bug fixes, refactorings, documentation changes, etc. that pose no or very low risk of adversely
170+
affecting existing applications.
171+
172+
Special Cases:
173+
* `target: rc`: A critical fix for an active release-train while it is in a feature freeze or RC phase
174+
* `target: lts`: A criticial fix for a specific release-train that is still within the long term support phase
175+
176+
177+
Notes:
178+
- To land a change only in a patch/RC branch, without landing it in any other active release-train branch (such
179+
as `master`), the patch/RC branch can be targeted in the Github UI with the appropriate
180+
`target: patch`/`target: rc` label.
181+
- `target: lts` PRs must target the specific LTS branch they would need to merge into in the Github UI, in
182+
cases which a change is desired in multiple LTS branches, individual PRs for each LTS branch must be created
183+
184+
185+
If a PR is missing the `target:*` label, it will be marked as pending by the angular robot status checks.
172186

173187

174188
## PR Approvals
@@ -182,7 +196,7 @@ In any case, the reviewer should actually look through the code and provide feed
182196

183197
Note that approved state does not mean a PR is ready to be merged.
184198
For example, a reviewer might approve the PR but request a minor tweak that doesn't need further review, e.g., a rebase or small uncontroversial change.
185-
Only the `PR action: merge` label means that the PR is ready for merging.
199+
Only the `action: merge` label means that the PR is ready for merging.
186200

187201

188202
## Special Labels
@@ -201,7 +215,7 @@ Only issues with `cla:yes` should be merged into master.
201215

202216
Applying this label to a PR makes the angular.io preview available regardless of the author. [More info](../aio/aio-builds-setup/docs/overview--security-model.md)
203217

204-
### `PR action: merge-assistance`
218+
### `action: merge-assistance`
205219
* _**Who adds it:** Any team member._
206220
* _**Who removes it:** Any team member._
207221

@@ -211,7 +225,7 @@ The comment should be formatted like this: `merge-assistance: <explain what kind
211225

212226
For example, the PR owner might not be a Googler and needs help to run g3sync; or one of the checks is failing due to external causes and the PR should still be merged.
213227

214-
### `PR action: rerun CI at HEAD`
228+
### `action: rerun CI at HEAD`
215229
* _**Who adds it:** Any team member._
216230
* _**Who removes it:** The Angular Bot, once it triggers the CI rerun._
217231

0 commit comments

Comments
 (0)