Skip to content

Commit b2c8fb3

Browse files
dgp1130kirjs
authored andcommitted
refactor(devtools): update release process to commit before publishing (angular#60646)
This moves the commit step to the start of the process and releases after merging it. This has two key benefits: 1. The commit history now reflects the actual release (ex. any DevTools commits before the release commit are actually included in that release). Previously the changes in a release were dictated by the release PR branch, which is an ephemeral target. Other PRs may be merged to `main` before the release PR, and those changes would not be included in that DevTools release. 2. We can now compute a changelog based on this more accurate history. The downside to this change is that release PRs are now blocking releases in a way they weren't before (which is likely desirable in the grand scheme of things), meaning we need to be more diligent about merging them in a timely manner. I added a short script for listing DevTools commits since the last release, taking advantage of the more accurate commit history. This should make changelog generation a lot easier, even if there's still a manual process of rewriting the commit message into a line item in release notes. Also made a few minor cleanup changes such as escaping the markdown in the suggested reviewer note so it can be more easily copy-pasted from the rendered format of this doc. PR Close angular#60646
1 parent 939ee08 commit b2c8fb3

File tree

1 file changed

+56
-22
lines changed

1 file changed

+56
-22
lines changed

devtools/docs/release.md

Lines changed: 56 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Before starting anything, make sure your workspace is up to date with latest cha
1515
git checkout main
1616
git pull upstream main
1717
nvm install
18-
yarn --frozen-lockfile
18+
yarn --immutable
1919
```
2020

2121
## 2. Update extension version numbers
@@ -24,7 +24,33 @@ Bump the version numbers listed in
2424
[`manifest.chrome.json`](/devtools/projects/shell-browser/src/manifest/manifest.chrome.json)
2525
and [`manifest.firefox.json`](/devtools/projects/shell-browser/src/manifest/manifest.firefox.json).
2626

27-
## 3. Publish to Chrome Chrome
27+
### 3. Commit and merge
28+
29+
Commit the version bump:
30+
31+
```shell
32+
git checkout -b devtools-release
33+
git add . && git commit -m "release: bump Angular DevTools version to ${VERSION}"
34+
git push -u origin devtools-release
35+
```
36+
37+
Then create and merge a PR targeting `patch` with this change. Merging this PR does not
38+
have any automation associated with it and can be merged at any time.
39+
40+
Once the PR is merged, pull and check out that specific commit hash on `main`.
41+
42+
```shell
43+
git checkout main
44+
git pull upstream main
45+
git checkout "${MERGED_RELEASE_COMMIT}"
46+
```
47+
48+
Note that while the steps below can technically be done without merging the release PR
49+
or checking out the merged commit, doing so is useful for release stability (actually
50+
releasing what the commit history says we are) and is _necessary_ for accurate changelog
51+
generation.
52+
53+
## 4. Publish to Chrome Chrome
2854

2955
To publish Angular DevTools to the Chrome Web Store, first build and package the extension.
3056

@@ -49,7 +75,7 @@ Note that even publishing immediately still requires approval from Chrome Web St
4975
available to users. Historically this has been pretty quick (< 30 minutes), but there is no hard upper
5076
limit on how long a review might take: https://developer.chrome.com/docs/webstore/review-process#review-time.
5177

52-
## 4. Publish to Firefox
78+
## 5. Publish to Firefox
5379

5480
To publish Angular DevTools as a Firefox Add-on, first build and package the extension.
5581

@@ -70,10 +96,28 @@ Then upload it:
7096

7197
The Firefox publishing process is slightly more involved than Chrome.
7298

73-
Mozilla asks for a changelog, which needs to be authored manually. You can search for recent
74-
`devtools` commits to see what has landed since the last release.
99+
### Changelog
75100

76-
https://github.com/search?q=repo%3Aangular%2Fangular+devtools&type=commits&s=committer-date&o=desc
101+
Mozilla asks for a changelog, which needs to be authored manually. You can generate a list of
102+
`(devtools)`-scoped commits since the last release with the following command:
103+
104+
```shell
105+
git log "HEAD...$(git log HEAD~1 --grep="release:.*Angular DevTools" --format=format:%H | head -n 1)~1" --oneline |
106+
grep "(devtools):\|release:.*Angular DevTools" --color=never
107+
```
108+
109+
Internal refactors and non-Firefox changes don't need to be mentioned (note that
110+
`refactor(devtools)` is frequently used for feature work, so don't entirely ignore a commit for
111+
that reason).
112+
113+
Mozilla's changelog rendering does support basic markdown, so you can write these in a list format:
114+
115+
```md
116+
* Fixes stuff.
117+
* Breaks some other stuff.
118+
```
119+
120+
### Source Code
77121

78122
Mozilla also requires extension source code with instructions to build and run it. Since DevTools
79123
exists in a monorepo with critical build tooling existing outside the `devtools/` directory, we
@@ -87,24 +131,14 @@ rm -rf dist/ && zip -r ~/angular-source.zip * -x ".git/*" -x "node_modules/*" -x
87131
Suggested note to reviewer:
88132

89133
> This is a monorepo and includes much more code than just the DevTools extension. The relevant
90-
> code is under `devtools/...` and `devtools/README.md` contains instructions for compiling release
91-
> builds locally.
134+
> code is under \`devtools/...\` and \`devtools/README.md\` contains instructions for compiling
135+
> release builds locally.
92136
>
93137
> The uploaded source is equivalent to
94138
> https://github.com/angular/angular/tree/${permalink to current main}/ with the single change
95-
> of a bumped version number in the `manifest.json` file.
96-
97-
### 5. Commit and merge
98-
99-
Commit the version bump:
100-
101-
```shell
102-
git checkout -b devtools-release
103-
git add . && git commit -m "release: bump Angular DevTools version to 1.0.10"
104-
git push -u origin devtools-release
105-
```
139+
> of a bumped version number in the \`manifest.json\` file.
106140
107-
Then create and merge a PR targeting `patch` with this change.
141+
Similar to Chrome, we need to wait for approval from Mozilla before the extension is released.
142+
There's no hard upper-bound on this, but historically it typically takes at least a week.
108143

109-
Once the PR merges and both Chrome and Firefox are showing the new version to end users, then
110-
the release is complete!
144+
Once the release is in-review for both Chrome and Firefox, the process is complete.

0 commit comments

Comments
 (0)