Skip to content

Commit 308468b

Browse files
authored
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 856eeab commit 308468b

File tree

1 file changed

+60
-11
lines changed

1 file changed

+60
-11
lines changed

etc/releasing.md

Lines changed: 60 additions & 11 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"
@@ -230,6 +222,15 @@ The following credentials are required. Ask for these from a team member if nece
230222
GRS_CONFIG_USER1_USERNAME=<username>
231223
GRS_CONFIG_USER1_PASSWORD=<password>
232224
```
225+
- Silk credentials. Save these to `~/.secrets/silk-creds.txt`:
226+
```bash
227+
SILK_CLIENT_ID=<client_id>
228+
SILK_CLIENT_SECRET=<client_secret>
229+
```
230+
- Snyk credentials. Save these to `~/.secrets/snyk-creds.txt`:
231+
```bash
232+
SNYK_API_TOKEN=<token>
233+
```
233234

234235
Run the release script with the git tag created above as an argument and
235236
`--dry-run` to test for unexpected errors.
@@ -310,6 +311,41 @@ git push --set-upstream origin releases/v1.2
310311

311312
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.
312313

314+
## Update Silk and Snyk with new branch if necessary
315+
316+
After creating the new minor release branch in the prior step, update Silk and Snyk to trach the new release branch.
317+
318+
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.
319+
320+
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:
321+
322+
```bash
323+
# Snyk credentials. Ask for these from a team member.
324+
. ~/.secrets/snyk-creds.txt
325+
326+
# Name of the new minor release branch. Ensure this is correct!
327+
branch="rX.Y"
328+
329+
# Authenticate with Snyk dev-prod organization.
330+
snyk auth "${SNYK_API_TOKEN:?}"
331+
332+
# Verify third party dependency sources listed in etc/purls.txt are detected by Snyk.
333+
# If not, see: https://support.snyk.io/hc/en-us/requests/new
334+
snyk_args=(
335+
--org=dev-prod
336+
--remote-repo-url=https://github.com/mongodb/mongo-cxx-driver/
337+
--target-reference="${branch:?}"
338+
--unmanaged
339+
--all-projects
340+
--detection-depth=10 # build/src/bsoncxx/third_party/_deps/core-install/include/core
341+
--exclude=extras # CXX-3042
342+
)
343+
snyk test "${snyk_args[@]:?}" --print-deps
344+
345+
# Create a new Snyk target reference for the new release branch.
346+
snyk monitor "${snyk_args[@]:?}"
347+
```
348+
313349
## Create Documentation Tickets
314350

315351
Documentation generation must be run after the release tag has been made and
@@ -362,6 +398,17 @@ pushed.
362398
- Switch back to the branch with documentation updates: `git checkout post-release-changes`.
363399
- Wait a few minutes and verify mongocxx.org has updated.
364400

401+
## Merge the release branch back into `master` if necessary
402+
403+
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.
404+
405+
> [IMPORTANT]
406+
> Use the "Create a merge commit" option when merging this pull request!
407+
408+
Do **NOT** delete the release branch after merge.
409+
410+
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`.
411+
365412
## Update CHANGELOG.md post-release ...
366413

367414
CHANGELOG.md on the `master` branch contains sections for every release. This is intended to ease searching for changes among all releases.
@@ -407,7 +454,9 @@ Ensure there are `[Unreleased]` sections for the next minor and patch releases.
407454
<!-- Contains published release notes -->
408455
```
409456

410-
Commit the change. Create a PR from the `post-release-changes` branch to merge to `master`.
457+
Commit the change.
458+
459+
Create a PR from the `post-release-changes` branch to merge to `master`.
411460

412461
## Homebrew
413462
This requires a macOS machine.

0 commit comments

Comments
 (0)