Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into beta-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 2, 2024
2 parents ec1b947 + b256877 commit 2c85d2d
Show file tree
Hide file tree
Showing 132 changed files with 2,659 additions and 3,006 deletions.
55 changes: 25 additions & 30 deletions .github/workflows/authors-and-third-party-notices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,27 @@ jobs:
env:
HADRON_DISTRIBUTION: compass
steps:
- uses: actions/checkout@v3
- name: Create Github App Token
uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
id: app-token
with:
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
# don't checkout a detatched HEAD
ref: ${{ github.head_ref }}

# this is important so git log can pick up on
# the whole history to generate the list of AUTHORS
fetch-depth: '0'
fetch-depth: "0"
token: ${{ steps.app-token.outputs.token }}


- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20.16.0
cache: 'npm'
cache: "npm"

- name: Install npm@10.2.4
run: |
Expand All @@ -40,38 +47,26 @@ jobs:
npm run bootstrap-ci
- name: Update AUTHORS
run: npm run update-authors
run: |
npm run update-authors
git add AUTHORS
- name: Update THIRD-PARTY-NOTICES.md
run: npm run update-third-party-notices
run: |
npm run update-third-party-notices
git add THIRD-PARTY-NOTICES.md
- name: Update Security Test Summary
run: |
npm run update-security-test-summary
git add docs/security-test-summary.md
- name: Update tracking-plan.md
run: npm run update-tracking-plan

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update report
branch: ci/update-3rd-party-notices-and-authors
title: 'chore: update AUTHORS, THIRD-PARTY-NOTICES, Security Test Summary'
add-paths: |
THIRD-PARTY-NOTICES.md
AUTHORS
docs/security-test-summary.md
docs/tracking-plan.md
body: |
- Update `AUTHORS`, `THIRD-PARTY-NOTICES`, docs/tracking-plan.md and `docs/security-test-summary.md`
run: |
npm run update-tracking-plan
git add docs/tracking-plan.md
- name: Merge PR
env:
PULL_REQUEST_NUMBER: ${{steps.cpr.outputs.pull-request-number}}
# NOTE: we don't use a PAT so to not trigger further automation
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and push
run: |
gh pr merge $PULL_REQUEST_NUMBER --squash --delete-branch
gh workflow run codeql.yml -r main
git commit --no-allow-empty -m "chore: update AUTHORS, THIRD-PARTY-NOTICES, Security Test Summary [skip actions]" || true
git push
35 changes: 16 additions & 19 deletions .github/workflows/bump-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@ jobs:
name: Bump packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Github App Token
uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
id: app-token
with:
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
# don't checkout a detatched HEAD
ref: ${{ github.head_ref }}

# this is important so git log can pick up on
# the whole history to generate the list of AUTHORS
fetch-depth: '0'

- name: Setup git
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20.16.0
cache: 'npm'
cache: "npm"

- name: Install npm@10.2.4
run: |
Expand All @@ -40,21 +38,20 @@ jobs:
- name: Bump packages
env:
LAST_BUMP_COMMIT_MESSAGE: 'chore(release): bump package versions'
SKIP_BUMP_PACKAGES: 'mongodb-compass'
LAST_BUMP_COMMIT_MESSAGE: "chore(release): bump package versions"
SKIP_BUMP_PACKAGES: "mongodb-compass"
run: |
npm run bump-packages
git add .
git commit --no-allow-empty -m "$LAST_BUMP_COMMIT_MESSAGE" || true
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5
with:
token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }}
commit-message: 'chore(release): bump package versions'
token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }} # TODO: replace with steps.app-token.outputs.token when it gets the PR permissions
commit-message: "chore(release): bump package versions"
branch: ci/bump-packages
title: 'chore(release): bump package versions'
title: "chore(release): bump package versions"
labels: no-title-validation
body: |
- Bump package versions
11 changes: 8 additions & 3 deletions .github/workflows/merge-bump-packages-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ on:
workflow_dispatch:
schedule:
# Each Tuesday at 5 AM UTC
- cron: '0 5 * * 2'
- cron: "0 5 * * 2"

jobs:
merge_bump_packages_pr:
name: Merge bump packages PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Github App Token
uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
id: app-token
with:
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}

- name: Merge PR
env:
GITHUB_TOKEN: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
set -e
PR_NUMBER=$(gh pr list -s open --head=ci/bump-packages --limit=1 --json number | jq '.[0].number')
Expand Down
42 changes: 19 additions & 23 deletions .github/workflows/update-electron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,40 @@ jobs:
name: Update Electron
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Github App Token
uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
id: app-token
with:
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
# don't checkout a detatched HEAD
ref: ${{ github.head_ref }}

# this is important so git log can pick up on
# the whole history to generate the list of AUTHORS
fetch-depth: '0'

- name: Setup git
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20.16.0
cache: 'npm'
cache: "npm"

- name: Install npm@10.2.4
run: |
npm install -g npm@10.2.4
- name: Install Dependencies
run: |
npm -v
npm ci
run: npm ci

- name: Bump packages
run: |
node scripts/update-electron.js
git add .
git commit --no-allow-empty -m "chore(deps): update electron" || true
run: node scripts/update-electron.js

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5
with:
token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }}
commit-message: 'chore(deps): update electron'
token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }} # TODO: replace with steps.app-token.outputs.token when it gets the PR permissions
commit-message: "chore(deps): update electron"
branch: ci/update-electron
title: 'chore(deps): update electron'
title: "chore(deps): update electron"
labels: no-title-validation
body: |
- Update electron
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ In particular each change to the `main` branch is analyzed to calculate a new ve

Merging that PR will trigger another CI job that will publish to NPM any package which version is not yet present on the registry.

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.
The version of packages is calculated following conventional bumps: See https://github.com/mongodb-js/devtools-shared/tree/main/packages/monorepo-tools for details.

## Add / Update / Remove Dependencies in Packages

Expand All @@ -115,6 +115,14 @@ npm run create-workspace [workspace name]

This will do all the initial workspace bootstrapping for you, ensuring that your package has all the standard configs set up and ready, and all the npm scripts aligned with other packages in the monorepo, which is important to get the most out of all the provided helpers in this repository (like `npm run check-changed` commands or to make sure that your tests will not immediately fail in CI because of the test timeout being too small)

## Using Github Actions

Github actions offers an easy way to create workflows that run various automated checks. While our main CI system is Evergreen, we have a number of auxiliary workflows configured to run using github actions. While adding new workflows or updating existing ones, it's important that we follow [the security hardening guidelines](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions) by Github. Those can change over time, so be sure to periodically review them to make sure we're not using insecure workflows. Some notable highlights to pay special attention to are:
1. Avoid using tag or branch refs for untrusted 3rd party actions. Those can easily be recreated by malicious actors and introduce supply chain attacks. As a rule of thumb, first party actions are considered actions by MongoDB, Github, Microsoft, or the primary maintainer of a particular ecosystem - e.g. Amazon for AWS. When using a 3rd party action, always use the full git commit sha as the ref to checkout.
2. Be extra vigilant when using user-supplied data, such as branch name or PR title in scripts as that opens up the possibility of script injection attacks. Instead, prefer to use js actions to achieve the same result or sanitize the input before using it in a script.
3. Never commit secrets in the workflow file directly - instead use github secrets to store them securely at the repo/org level.
4. Avoid using repo-level secrets that grant access to deployment/publishing resources. Instead prefer to store these as environment secrets and ensure the correct environments protections are in place.

## Caveats

### `hdiutil: couldn't unmount "diskn" - Resource busy` or Similar `hdiutil` Errors
Expand Down
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The following third-party software is used by and included in **Mongodb Compass**.
This document was automatically generated on Sun Nov 24 2024.
This document was automatically generated on Sun Dec 01 2024.

## List of dependencies

Expand Down
4 changes: 2 additions & 2 deletions configs/eslint-config-compass/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongodb-js/eslint-config-compass",
"version": "1.1.7",
"version": "1.1.8",
"description": "Shared Compass eslint configuration",
"license": "SSPL",
"main": "index.js",
Expand All @@ -16,7 +16,7 @@
"@babel/core": "^7.21.4",
"@babel/eslint-parser": "^7.14.3",
"@mongodb-js/eslint-config-devtools": "^0.9.9",
"@mongodb-js/eslint-plugin-compass": "^1.0.21",
"@mongodb-js/eslint-plugin-compass": "^1.0.22",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"eslint-config-prettier": "^8.3.0",
Expand Down
6 changes: 3 additions & 3 deletions configs/eslint-plugin-compass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"email": "compass@mongodb.com"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "1.0.21",
"version": "1.0.22",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand All @@ -37,8 +37,8 @@
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
},
"devDependencies": {
"@mongodb-js/mocha-config-compass": "^1.4.2",
"@mongodb-js/prettier-config-compass": "^1.0.2",
"@mongodb-js/mocha-config-compass": "^1.4.3",
"@mongodb-js/prettier-config-compass": "^1.0.3",
"depcheck": "^1.4.1",
"eslint": "^7.25.0",
"mocha": "^10.2.0",
Expand Down
4 changes: 2 additions & 2 deletions configs/mocha-config-compass/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@mongodb-js/mocha-config-compass",
"version": "1.4.2",
"version": "1.4.3",
"description": "Shared mocha mocha configuration for Compass packages",
"license": "SSPL",
"main": "index.js",
"devDependencies": {
"@mongodb-js/prettier-config-compass": "^1.0.2",
"@mongodb-js/prettier-config-compass": "^1.0.3",
"prettier": "^2.7.1"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion configs/prettier-config-compass/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongodb-js/prettier-config-compass",
"version": "1.0.2",
"version": "1.0.3",
"description": "Shared Compass prettier configuration",
"license": "SSPL",
"main": "index.js",
Expand Down
10 changes: 5 additions & 5 deletions configs/testing-library-compass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"email": "compass@mongodb.com"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "1.0.2",
"version": "1.0.3",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -45,10 +45,10 @@
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
},
"devDependencies": {
"@mongodb-js/eslint-config-compass": "^1.1.7",
"@mongodb-js/mocha-config-compass": "^1.4.2",
"@mongodb-js/prettier-config-compass": "^1.0.2",
"@mongodb-js/tsconfig-compass": "^1.0.5",
"@mongodb-js/eslint-config-compass": "^1.1.8",
"@mongodb-js/mocha-config-compass": "^1.4.3",
"@mongodb-js/prettier-config-compass": "^1.0.3",
"@mongodb-js/tsconfig-compass": "^1.0.6",
"@types/chai": "^4.2.21",
"@types/mocha": "^9.0.0",
"@types/sinon-chai": "^3.2.5",
Expand Down
4 changes: 2 additions & 2 deletions configs/tsconfig-compass/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongodb-js/tsconfig-compass",
"version": "1.0.5",
"version": "1.0.6",
"description": "Shared Compass Typescript configuration",
"license": "SSPL",
"files": [
Expand All @@ -11,7 +11,7 @@
"typescript": "^5.0.4"
},
"devDependencies": {
"@mongodb-js/prettier-config-compass": "^1.0.2",
"@mongodb-js/prettier-config-compass": "^1.0.3",
"prettier": "^2.7.1"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions configs/webpack-config-compass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"email": "compass@mongodb.com"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "1.4.6",
"version": "1.4.8",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -45,9 +45,9 @@
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
},
"devDependencies": {
"@mongodb-js/eslint-config-compass": "^1.1.7",
"@mongodb-js/prettier-config-compass": "^1.0.2",
"@mongodb-js/tsconfig-compass": "^1.0.5",
"@mongodb-js/eslint-config-compass": "^1.1.8",
"@mongodb-js/prettier-config-compass": "^1.0.3",
"@mongodb-js/tsconfig-compass": "^1.0.6",
"@types/cli-progress": "^3.9.2",
"@types/html-webpack-plugin": "^3.2.9",
"@types/webpack-bundle-analyzer": "^4.7.0",
Expand Down
Loading

0 comments on commit 2c85d2d

Please sign in to comment.