Skip to content

Commit 7a8a3e9

Browse files
Include updates to CHANGELOG.md in release process (#1109)
* specify expected pre/post release changelog edits * add missing formula name to Homebrew step * apply various clarifications --------- Co-authored-by: Ezra Chung <[email protected]>
1 parent 5cbf006 commit 7a8a3e9

File tree

2 files changed

+110
-25
lines changed

2 files changed

+110
-25
lines changed

etc/make_release.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,10 @@ def get_jira_project_versions(auth_jira):
496496
def get_all_issues_for_version(auth_jira, release_version):
497497
"""
498498
Return a list of all issues in the project assigned to the given release.
499+
Excludes the ticket created to track the release itself.
499500
"""
500501

501-
jql_query = 'project={} and fixVersion={} ORDER BY issueKey ASC'\
502+
jql_query = 'project={} and fixVersion={} and (labels IS EMPTY OR labels != release) ORDER BY issueKey ASC'\
502503
.format(str(CXX_PROJ_ID), release_version)
503504
return auth_jira.search_issues(jql_query, maxResults=0)
504505

etc/releasing.md

Lines changed: 108 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,51 @@ Update Jira ticket types and titles as appropriate.
3838
User-facing issues should generally be either "Bug" or "New Feature".
3939
Non-user facing issues should generally be "Task" tickets.
4040

41-
## Update CHANGELOG.md
41+
## Update CHANGELOG.md pre-release ...
42+
43+
### ... for a minor release (e.g. `1.2.0`)
44+
45+
Create a new branch to contain changelog updates from the master branch: `git checkout -b pre-release-changes master`. This branch will be used to create a PR.
46+
47+
Check Jira for tickets closed in this fix version. Update CHANGELOG.md with notable changes not already mentioned. Remove `[Unreleased]` from the version being released.
48+
49+
Check if there is an `[Unreleased]` section for a patch version (e.g. `1.1.4 [Unreleased]`). Normally, the C++ Driver does not release patches for old minor versions. If an unreleased patch release section is no longer applicable, move its entries into the minor release section (as needed) and remove the patch release section. If you are unsure whether the patch release is planned, ask in the #dbx-c-cxx channel.
50+
51+
Example (if `1.2.0` is being released):
52+
```md
53+
## 1.2.0 [Unreleased]
54+
55+
### Fixed
56+
57+
- Fixes A <!-- Unreleased fix on master branch -->
58+
59+
## 1.1.4 [Unreleased]
60+
61+
### Fixed
62+
63+
- Fixes B <!-- Unreleased fix on `releases/v1.1` branch. B is implicity fixed on 1.2.0. Change was cherry-picked from master. -->
64+
```
65+
66+
Becomes:
67+
```md
68+
## 1.2.0
69+
70+
### Fixed
71+
72+
- Fixes A
73+
- Fixes B <!-- 1.1.4 is no longer planned. Document B in 1.2.0 -->
74+
```
75+
76+
Commit with a message like `Update CHANGELOG for <version>`. Create a PR for the `pre-release-changes` branch which contains the commits made up to this point. Once the PR is merged, proceed with the rest of the release. The `pre-release-changes` branch may be deleted.
77+
78+
### ... for a patch release (e.g. `1.2.3`)
79+
80+
Check out the existing release branch (e.g. `releases/v1.2`).
81+
82+
Check Jira for tickets closed in this fix version. Update CHANGELOG.md with notable changes not already mentioned. Remove `[Unreleased]` from the version being released.
83+
84+
Commit with a message like `Update CHANGELOG for <version>`. Push the change.
4285

43-
Check Jira for tickets closed in this fix version. Consider updating CHANGELOG.md
44-
with notable changes not already mentioned.
4586

4687
## Clone and set up environment
4788

@@ -160,14 +201,27 @@ git reset --hard r1.2.3
160201
git push -f origin releases/stable
161202
```
162203

204+
## Branch if necessary
205+
206+
If doing a new minor release `X.Y.0` (e.g. a `1.2.0` release), create branch
207+
`releases/vX.Y` (e.g `releases/v1.2`): `git checkout -b releases/v1.2 master`
208+
209+
Push the new branch:
210+
211+
```
212+
git push --set-upstream origin releases/v1.2
213+
```
214+
215+
The new branch should be continuously tested on Evergreen. Update the "Display Name" and "Branch Name" of the [mongo-cxx-driver-latest-release Evergreen project](https://spruce.mongodb.com/project/mongo-cxx-driver-latest-release/settings/general) to refer to the new release branch.
216+
163217
## Generate and Publish Documentation
164218

165219
Documentation generation must be run after the release tag has been made and
166220
pushed.
167221

168-
- Checkout the master branch.
222+
- Create and checkout a new branch to contain documentation updates from master: `git checkout -b post-release-changes master`. This branch will be used to create a PR later.
169223
- Edit `etc/apidocmenu.md` and add the released version in the `mongocxx` column
170-
following the established pattern. If this is a minor release (x.y.0), revise
224+
following the established pattern. If this is a minor release (X.Y.0), revise
171225
the entire document as needed.
172226
- Edit `docs/content/_index.md` and `README.md` to match.
173227
- Edit the `Installing the MongoDB C driver` section of
@@ -204,14 +258,59 @@ pushed.
204258
stable release branch.
205259
- Commit and push the symlink change:
206260
`git commit -am "Update symlink for r1.2.3"`
261+
- Switch back to the branch with documentation updates: `git checkout post-release-changes`.
207262
- Wait a few minutes and verify mongocxx.org has updated.
208-
- Checkout the master branch. Push the commit containing changes to `etc/` and
209-
`docs/`. This may require pushing the commit to a fork of the C++ Driver
210-
repository and creating a pull request.
263+
264+
## Update CHANGELOG.md post-release ...
265+
266+
CHANGELOG.md on the `master` branch contains sections for every release. This is intended to ease searching for changes among all releases.
267+
CHANGELOG.md on a release branch (e.g. `releases/v1.2`) contains entries for patch releases of the minor version number tracked by the release branch (e.g. for 1.2.1, 1.2.2, 1.2.3, etc.), as well as all entries prior to the initial minor release (e.g. before 1.2.0).
268+
269+
### ... on the release branch
270+
271+
Check out the release branch (e.g. `releases/v1.2`).
272+
273+
Update CHANGELOG.md to add an `[Unreleased]` section for the next patch release. Example (if `1.2.3` was just released):
274+
275+
```md
276+
## 1.2.4 [Unreleased]
277+
278+
<!-- Will contain entries for the next patch release -->
279+
280+
## 1.2.3
281+
282+
<!-- Contains published release notes -->
283+
```
284+
285+
Commit and push this change to the release branch (no PR necessary for release branch).
286+
287+
### ... on the `master` branch
288+
289+
Check out the `post-release-changes` branch created before editing and generating documentation.
290+
291+
Ensure `[Unreleased]` is removed from the recently released section. Ensure the contents of the recently released section match the published release notes.
292+
293+
Ensure there are `[Unreleased]` sections for the next minor and patch releases. Example (if `1.2.3` was just released):
294+
295+
```md
296+
## 1.3.0 [Unreleased]
297+
298+
<!-- Will contain entries for the next minor release -->
299+
300+
## 1.2.4 [Unreleased]
301+
302+
<!-- Will contain entries for the next patch release -->
303+
304+
## 1.2.3
305+
306+
<!-- Contains published release notes -->
307+
```
308+
309+
Commit the change. Create a PR from the `post-release-changes` branch to merge to `master`.
211310

212311
## Homebrew
213312
This requires a macOS machine.
214-
If this is a stable release, update the [mongo-cxx-driver](https://github.com/Homebrew/homebrew-core/blob/master/Formula/mongo-cxx-driver.rb) homebrew formula, using: `brew bump-formula-pr --url <tarball url>`
313+
If this is a stable release, update the [mongo-cxx-driver](https://github.com/Homebrew/homebrew-core/blob/master/Formula/mongo-cxx-driver.rb) homebrew formula, using: `brew bump-formula-pr mongo-cxx-driver --url <tarball url>`
215314

216315
Example:
217316
`brew bump-formula-pr mongo-cxx-driver --url https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.3/mongo-cxx-driver-r3.7.3.tar.gz`
@@ -241,21 +340,6 @@ See this
241340
[example announcement](https://www.mongodb.com/community/forums/t/mongodb-c-11-driver-3-9-0-released/252724)
242341
of the stable release of 3.9.0.
243342

244-
## Branch if necessary
245-
246-
If doing a new minor release `x.y.0` (e.g. a `1.2.0` release), create branch
247-
`releases/vx.y` (e.g `releases/v3.8`).
248-
249-
Push the new branch:
250-
251-
```
252-
git push --set-upstream origin releases/v3.8
253-
```
254-
255-
The new branch should be continuously tested on Evergreen. Create a BUILD ticket
256-
to request the build team create new Evergreen project to track the
257-
`releases/vx.y` branch (see BUILD-5666 for an example).
258-
259343
## Docker Image Build and Publish
260344

261345
We maintain the docker images found in the

0 commit comments

Comments
 (0)