Skip to content

Commit 1f9a7bc

Browse files
committed
CXX-3008 Add post-release instructions for Silk, Snyk, and patch release tags (#1148)
* CXX-3008 Add instructions to create new Silk/Snyk target reference post-release * Add new post-patch-release merge commit to release instructions * Move Silk credentials to .secrets in instructions
1 parent c47fb50 commit 1f9a7bc

File tree

1 file changed

+120
-14
lines changed

1 file changed

+120
-14
lines changed

etc/releasing.md

Lines changed: 120 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ podman pull artifactory.corp.mongodb.com/release-tools-container-registry-public
4646

4747
# Output: "... writing sbom to file"
4848
podman run \
49-
--env-file <(
50-
printf "%s\n" \
51-
"SILK_CLIENT_ID=${SILK_CLIENT_ID:?}" \
52-
"SILK_CLIENT_SECRET=${SILK_CLIENT_SECRET:?}"
53-
) \
49+
--env-file "$HOME/.secrets/silk-creds.txt" \
5450
-it --rm -v "$(pwd):/pwd" \
5551
artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 \
5652
update -p "/pwd/etc/purls.txt" -i "/pwd/etc/cyclonedx.sbom.json" -o "/pwd/etc/cyclonedx.sbom.json"
@@ -79,11 +75,7 @@ podman pull artifactory.corp.mongodb.com/release-tools-container-registry-public
7975

8076
# Output: "... writing sbom to file"
8177
podman run \
82-
--env-file <(
83-
printf "%s\n" \
84-
"SILK_CLIENT_ID=${SILK_CLIENT_ID:?}" \
85-
"SILK_CLIENT_SECRET=${SILK_CLIENT_SECRET:?}"
86-
) \
78+
--env-file "$HOME/.secrets/silk-creds.txt" \
8779
-it --rm -v "$(pwd):/pwd" \
8880
artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 \
8981
download --silk-asset-group "mongo-cxx-driver" -o "/pwd/etc/augmented.sbom.json"
@@ -189,6 +181,15 @@ The following credentials are required. Ask for these from a team member if nece
189181
GRS_CONFIG_USER1_USERNAME=<username>
190182
GRS_CONFIG_USER1_PASSWORD=<password>
191183
```
184+
- Silk credentials. Save these to `~/.secrets/silk-creds.txt`:
185+
```bash
186+
SILK_CLIENT_ID=<client_id>
187+
SILK_CLIENT_SECRET=<client_secret>
188+
```
189+
- Snyk credentials. Save these to `~/.secrets/snyk-creds.txt`:
190+
```bash
191+
SNYK_API_TOKEN=<token>
192+
```
192193

193194
Run the release script with the git tag created above as an argument and
194195
`--dry-run` to test for unexpected errors.
@@ -256,7 +257,55 @@ git reset --hard r1.2.3
256257
git push -f origin releases/stable
257258
```
258259

259-
## Generate and Publish Documentation
260+
## Branch if necessary
261+
262+
If doing a new minor release `X.Y.0` (e.g. a `1.2.0` release), create branch
263+
`releases/vX.Y` (e.g `releases/v1.2`): `git checkout -b releases/v1.2 master`
264+
265+
Push the new branch:
266+
267+
```
268+
git push --set-upstream origin releases/v1.2
269+
```
270+
271+
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.
272+
273+
## Update Silk and Snyk with new branch if necessary
274+
275+
After creating the new minor release branch in the prior step, update Silk and Snyk to trach the new release branch.
276+
277+
For Silk, use the [create-silk-asset-group.py script](https://github.com/mongodb/mongo-c-driver/blob/master/tools/create-silk-asset-group.py) in the C Driver to create a new Silk asset group. Use `mongo-cxx-driver` as the name and prefix in place of `mongo-c-driver` accordingly.
278+
279+
For Snyk, configure and build the CXX Driver with `BSONCXX_POLY_USE_MNMLSTC=ON` (force download of mnmlstc/core sources) and no `CMAKE_PREFIX_PATH` entry to a C Driver installation (force download of C Driver sources), then run:
280+
281+
```bash
282+
# Snyk credentials. Ask for these from a team member.
283+
. ~/.secrets/snyk-creds.txt
284+
285+
# Name of the new minor release branch. Ensure this is correct!
286+
branch="rX.Y"
287+
288+
# Authenticate with Snyk dev-prod organization.
289+
snyk auth "${SNYK_API_TOKEN:?}"
290+
291+
# Verify third party dependency sources listed in etc/purls.txt are detected by Snyk.
292+
# If not, see: https://support.snyk.io/hc/en-us/requests/new
293+
snyk_args=(
294+
--org=dev-prod
295+
--remote-repo-url=https://github.com/mongodb/mongo-cxx-driver/
296+
--target-reference="${branch:?}"
297+
--unmanaged
298+
--all-projects
299+
--detection-depth=10 # build/src/bsoncxx/third_party/_deps/core-install/include/core
300+
--exclude=extras # CXX-3042
301+
)
302+
snyk test "${snyk_args[@]:?}" --print-deps
303+
304+
# Create a new Snyk target reference for the new release branch.
305+
snyk monitor "${snyk_args[@]:?}"
306+
```
307+
308+
## Create Documentation Tickets
260309

261310
Documentation generation must be run after the release tag has been made and
262311
pushed.
@@ -301,9 +350,66 @@ pushed.
301350
- Commit and push the symlink change:
302351
`git commit -am "Update symlink for r1.2.3"`
303352
- Wait a few minutes and verify mongocxx.org has updated.
304-
- Checkout the master branch. Push the commit containing changes to `etc/` and
305-
`docs/`. This may require pushing the commit to a fork of the C++ Driver
306-
repository and creating a pull request.
353+
354+
## Merge the release branch back into `master` if necessary
355+
356+
If this is a patch release on a minor release branch, create a pull request on GitHub to merge the latest state of the `releases/rX.Y` branch containing the new release tag `rX.Y.Z` into the `master` branch. Use the "Create a merge commit" option when merging this pull request.
357+
358+
> [IMPORTANT]
359+
> Use the "Create a merge commit" option when merging this pull request!
360+
361+
Do **NOT** delete the release branch after merge.
362+
363+
Verify correct repo state by running `git describe --tags --abbrev=0` on the post-merge `master` branch, which should return the patch release tag `rX.Y.Z`. Adding the `--first-parent` flag should return the last minor release tag `rX.Y.0`.
364+
365+
## Update CHANGELOG.md post-release ...
366+
367+
CHANGELOG.md on the `master` branch contains sections for every release. This is intended to ease searching for changes among all releases.
368+
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).
369+
370+
### ... on the release branch
371+
372+
Check out the release branch (e.g. `releases/v1.2`).
373+
374+
Update CHANGELOG.md to add an `[Unreleased]` section for the next patch release. Example (if `1.2.3` was just released):
375+
376+
```md
377+
## 1.2.4 [Unreleased]
378+
379+
<!-- Will contain entries for the next patch release -->
380+
381+
## 1.2.3
382+
383+
<!-- Contains published release notes -->
384+
```
385+
386+
Commit and push this change to the release branch (no PR necessary for release branch).
387+
388+
### ... on the `master` branch
389+
390+
Check out the `post-release-changes` branch created before editing and generating documentation.
391+
392+
Ensure `[Unreleased]` is removed from the recently released section. Ensure the contents of the recently released section match the published release notes.
393+
394+
Ensure there are `[Unreleased]` sections for the next minor and patch releases. Example (if `1.2.3` was just released):
395+
396+
```md
397+
## 1.3.0 [Unreleased]
398+
399+
<!-- Will contain entries for the next minor release -->
400+
401+
## 1.2.4 [Unreleased]
402+
403+
<!-- Will contain entries for the next patch release -->
404+
405+
## 1.2.3
406+
407+
<!-- Contains published release notes -->
408+
```
409+
410+
Commit the change.
411+
412+
Create a PR from the `post-release-changes` branch to merge to `master`.
307413

308414
## Homebrew
309415
This requires a macOS machine.

0 commit comments

Comments
 (0)