Skip to content

Commit bf91db2

Browse files
jmikolaalcaeus
andauthored
Revise release instructions (#1007)
This is the PHPLIB counterpart to mongodb/mongo-php-driver@ab400ec Add instructions for creating a maintenance branch after releasing a new minor version. * Use diff code blocks for more concise examples * Apply syntax highlighting to release notes examples Co-authored-by: Andreas Braun <[email protected]>
1 parent a1ef317 commit bf91db2

File tree

1 file changed

+93
-15
lines changed

1 file changed

+93
-15
lines changed

CONTRIBUTING.md

Lines changed: 93 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,18 @@ $ git commit -m "Master is now 1.10-dev" composer.json
203203

204204
## Releasing
205205

206-
The follow steps outline the release process for a maintenance branch (e.g.
207-
releasing the `vX.Y` branch as X.Y.Z).
206+
The following steps outline the release process for both new minor versions (e.g.
207+
releasing the `master` branch as X.Y.0) and patch versions (e.g. releasing the
208+
`vX.Y` branch as X.Y.Z).
209+
210+
The command examples below assume that the canonical "mongodb" repository has
211+
the remote name "mongodb". You may need to adjust these commands if you've given
212+
the remote another name (e.g. "upstream"). The "origin" remote name was not used
213+
as it likely refers to your personal fork.
214+
215+
It helps to keep your own fork in sync with the "mongodb" repository (i.e. any
216+
branches and tags on the main repository should also exist in your fork). This
217+
is left as an exercise to the reader.
208218

209219
### Ensure PHP version compatibility
210220

@@ -234,50 +244,118 @@ changes in this maintenance branch. This is important because we will later
234244
merge the ensuing release commits up to master with `--strategy=ours`, which
235245
will ignore changes from the merged commits.
236246

237-
### Tag release
247+
### Update composer.json and CI matrices
248+
249+
This is especially important before releasing a new minor version.
250+
251+
Ensure that the extension requirement and branch alias in `composer.json` are
252+
correct for the library version being released. For example, the 1.15.0 release
253+
of the library should depend on version `^1.15.0` of the extension and master
254+
branch alias should be `1.15.x-dev`.
255+
256+
If this is the first release of a minor version for the library, it is likely
257+
following an extension release. In that case, the `driver-versions` matrix in
258+
the Evergreen configuration should be updated:
259+
260+
```diff
261+
- id: "oldest-supported"
262+
- display_name: "PHPC 1.15-dev"
263+
+ display_name: "PHPC 1.15.0"
264+
variables:
265+
- EXTENSION_BRANCH: "master"
266+
+ EXTENSION_VERSION: "1.15.0"
267+
- id: "latest-stable"
268+
- display_name: "PHPC 1.15-dev"
269+
+ display_name: "PHPC 1.15.x"
270+
variables:
271+
- EXTENSION_BRANCH: "master"
272+
+ EXTENSION_VERSION: "stable"
273+
- id: "latest-dev"
274+
- display_name: "PHPC 1.15-dev"
275+
+ display_name: "PHPC 1.16-dev"
276+
variables:
277+
EXTENSION_BRANCH: "master"
278+
```
279+
280+
Commit and push any changes:
281+
282+
```
283+
$ git commit -m "Update composer.json and CI matrices for X.Y.Z" composer.json .evergreen/config.yml
284+
$ git push mongodb
285+
```
286+
287+
### Tag the release
238288

239-
The maintenance branch's HEAD will be the target for our release tag:
289+
Create a tag for the release and push:
240290

241291
```
242292
$ git tag -a -m "Release X.Y.Z" X.Y.Z
293+
$ git push mongodb --tags
243294
```
244295

245-
### Push tags
296+
### Branch management
246297

298+
#### After releasing a new minor version
299+
300+
After a new minor version is released (i.e. `master` was tagged), a maintenance
301+
branch should be created for future patch releases:
302+
303+
```
304+
$ git checkout -b vX.Y
305+
$ git push mongodb vX.Y
306+
```
307+
308+
Update the master branch alias in `composer.json`:
309+
310+
```diff
311+
"extra": {
312+
"branch-alias": {
313+
- "dev-master": "1.15.x-dev"
314+
+ "dev-master": "1.16.x-dev"
315+
}
316+
},
247317
```
248-
$ git push --tags
318+
319+
Commit and push this change:
320+
321+
```
322+
$ git commit -m "Master is now X.Y-dev" composer.json
323+
$ git push mongodb
249324
```
250325

251-
### Merge the maintenance branch up to master
326+
#### After releasing a patch version
327+
328+
If this was a patch release, the maintenance branch must be merged up to master:
252329

253330
```
254331
$ git checkout master
332+
$ git pull mongodb master
255333
$ git merge vX.Y --strategy=ours
256-
$ git push
334+
$ git push mongodb
257335
```
258336

259337
The `--strategy=ours` option ensures that all changes from the merged commits
260-
will be ignored.
338+
will be ignored. This is OK because we previously ensured that the `master`
339+
branch was up-to-date with all code changes in this maintenance branch before
340+
tagging.
261341

262342
### Publish release notes
263343

264344
The following template should be used for creating GitHub release notes via
265345
[this form](https://github.com/mongodb/mongo-php-library/releases/new).
266346

267-
```
347+
```markdown
268348
The PHP team is happy to announce that version X.Y.Z of the MongoDB PHP library is now available.
269349

270350
**Release Highlights**
271351

272352
<one or more paragraphs describing important changes in this release>
273353

274-
A complete list of resolved issues in this release may be found at:
275-
$JIRA_URL
354+
A complete list of resolved issues in this release may be found in [JIRA]($JIRA_URL).
276355

277356
**Documentation**
278357

279-
Documentation for this library may be found at:
280-
https://mongodb.com/docs/php-library/current/
358+
Documentation for this library may be found in the [PHP Library Manual](https://mongodb.com/docs/php-library/current/).
281359

282360
**Installation**
283361

@@ -295,7 +373,7 @@ release. You may obtain the list from
295373
If commits from community contributors were included in this release, append the
296374
following section:
297375

298-
```
376+
```markdown
299377
**Thanks**
300378

301379
Thanks for our community contributors for this release:

0 commit comments

Comments
 (0)