Skip to content

Commit 7882605

Browse files
committed
Merge remote-tracking branch 'origin/main' into 1.33-releases
2 parents b7abe2d + ca6f24a commit 7882605

File tree

22 files changed

+997
-172
lines changed

22 files changed

+997
-172
lines changed

.depcheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ignores:
2+
- '@mongodb-js/bump-monorepo-packages'
23
# TODO: We keep webpack-cli/serve and testing-library/dom at the root to work
34
# around weird npm workspace hoising issues caused by outdated transient
45
# dependencies. This can go away when we update webpack and leafygreen to the
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Bump packages
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
update_generated_files:
10+
name: Bump packages
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
# don't checkout a detatched HEAD
16+
ref: ${{ github.head_ref }}
17+
18+
# this is important so git log can pick up on
19+
# the whole history to generate the list of AUTHORS
20+
fetch-depth: '0'
21+
22+
- name: Setup git
23+
run: |
24+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
25+
git config --local user.name "github-actions[bot]"
26+
27+
- uses: actions/setup-node@v2
28+
with:
29+
node-version: ^16.15.1
30+
cache: 'npm'
31+
32+
- name: Install [email protected]
33+
run: |
34+
npm install -g [email protected]
35+
36+
- name: Install Dependencies
37+
run: |
38+
npm -v
39+
npm ci
40+
41+
- name: Bump packages
42+
env:
43+
LAST_BUMP_COMMIT_MESSAGE: 'chore(release): bump package versions'
44+
SKIP_BUMP_PACKAGES: 'mongodb-compass'
45+
run: |
46+
npm run bump-packages
47+
git add .
48+
git commit --no-allow-empty -m "$LAST_BUMP_COMMIT_MESSAGE" || true
49+
50+
- name: Create Pull Request
51+
id: cpr
52+
uses: peter-evans/create-pull-request@v4
53+
with:
54+
token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }}
55+
commit-message: 'chore(release): bump package versions'
56+
branch: ci/bump-packages
57+
title: 'chore(release): bump package versions'
58+
body: |
59+
- Bump package versions
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish
2+
on:
3+
# NOTE: avoid using the manual execution unless is the only way to fix some issue,
4+
# rather retry failed jobs in case of flakes. The manual execution can potentially
5+
# cause the tags to point to a different commit that the one used to publish
6+
# the packages
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
publish:
14+
if: |
15+
github.event_name == 'workflow_dispatch' ||
16+
startsWith(github.event.head_commit.message, 'chore(release): bump package versions')
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
# don't checkout a detatched HEAD
24+
ref: ${{ github.head_ref }}
25+
26+
# this is important so git log has the whole history
27+
fetch-depth: '0'
28+
29+
- name: Setup git
30+
run: |
31+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
32+
git config --local user.name "github-actions[bot]"
33+
34+
- name: "Use Node.js 14"
35+
uses: actions/setup-node@v2
36+
with:
37+
node-version: ^16.15.1
38+
39+
- name: Install npm@8
40+
run: npm install -g npm@8
41+
42+
- name: Install Dependencies
43+
run: |
44+
npm run bootstrap-ci
45+
shell: bash
46+
47+
- name: "Publish what is not already in NPM"
48+
env:
49+
NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }}
50+
run: |
51+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
52+
git update-index --assume-unchanged .npmrc
53+
npm run publish-packages
54+
55+
- name: "Publish tags"
56+
run: |
57+
npx lerna list -a --json | \
58+
jq -r '.[] | .name + "@" + .version' | \
59+
xargs -i sh -c "git tag -a {} -m {} || true"
60+
git push --follow-tags

CONTRIBUTING.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,15 @@ HADRON_SKIP_INSTALLER=true npm run test-package-compass
7979

8080
### Publishing Packages
8181

82-
For package changes to be applied in Compass beta or GA releases they need to be published first. The whole publish process happens from the main branch with the following command in order:
82+
Compass is built out of a number of different NPM packages. Since all the relevant code is bundled in the packaged version of Compass with webpack, it is not necessary to publish any package to build and run the Compass application.
8383

84-
1. `npm run packages-version [semver bump]`: updates package versions for everything that was changed since the last release, updates package-lock file at the root of the repository, commits and tags the changes. See lerna docs to learn more about optional [`semver bump`](https://github.com/lerna/lerna/tree/main/commands/version#semver-bump) argument.
85-
1. `npm run packages-publish`: publishes packages to the registry, if your npm account uses OTP publishing protection get ready to enter the code a few times, as an alternative you might want to use [npm automation authorization tokens](https://docs.npmjs.com/creating-and-viewing-access-tokens) locally if OTP gets in the way too much (in that case add a [`--no-verify-access`](https://github.com/lerna/lerna/tree/main/commands/publish#--no-verify-access) flag to the publish command). Publish command can be re-run safely multiple times, so if something bad happens mid-release (e.g., your internet goes out), you should be able to safely fiinish the process. After publish finishes successfully the script will push version update commit and tags created in step 1. We do it automatically only post-release so that when evergreen picks up a commit in the main branch, all the tasks can run with the packages already published.
84+
Some of the packages, however, are used externally by other MongoDB products and by the javascript community. These packages are published through CI workflows.
85+
86+
In particular each change to the `main` branch is analyzed to calculate a new version based on changes since the last time it was published. A pr with the new versions of each changed package is opened and updated on each new change.
87+
88+
Merging that PR will trigger another CI job that will publish to NPM any package which version is not yet present on the registry.
89+
90+
The version of packages is calculated following conventional bumps: See https://github.com/mongodb-js/devtools-shared/tree/main/packages/bump-monorepo-packages for details.
8691

8792
### Add / Update / Remove Dependencies in Packages
8893

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **compass**.
2-
This document was automatically generated on Fri Aug 12 2022.
2+
This document was automatically generated on Mon Aug 15 2022.
33

44
## List of dependencies
55

0 commit comments

Comments
 (0)