Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/beta-releases' into ga-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 22, 2024
2 parents 2be255d + 9a94a8e commit 7c569f8
Show file tree
Hide file tree
Showing 381 changed files with 17,895 additions and 10,248 deletions.
2 changes: 1 addition & 1 deletion .evergreen/compass_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [[ "$OSTYPE" == "cygwin" ]]; then
fi

echo "Creating signed release build..."
npm run package-compass-nocompile $COMPASS_DISTRIBUTION
npm run package-compass-nocompile
npm run generate-first-party-deps-json

ls -la packages/compass/dist
Expand Down
3 changes: 2 additions & 1 deletion .evergreen/connectivity-tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# "bullseye" is the debian distribution that ubuntu:20.04 is based on
FROM node:18-bullseye
ARG NODE_JS_VERSION=20
FROM node:${NODE_JS_VERSION}-bullseye

COPY .evergreen/connectivity-tests/krb5.conf /etc/krb5.conf

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/connectivity-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MONOREPO_ROOT_DIR="$(cd $(dirname "$0")/../..; pwd)"
cd $MONOREPO_ROOT_DIR

echo "building connectivity tests image from ${PWD}"
docker build -t devtools-connectivity-tests -f "./.evergreen/connectivity-tests/Dockerfile" .
docker build -t devtools-connectivity-tests --build-arg "NODE_JS_VERSION=$NODE_JS_VERSION" -f "./.evergreen/connectivity-tests/Dockerfile" .
echo "connectivity tests image built"

echo running connectivity tests image
Expand Down
21 changes: 12 additions & 9 deletions .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ variables:
EVERGREEN_VERSION_ID: ${version_id}
EVERGREEN_WORKDIR: ${workdir}
EVERGREEN_CREATED_AT: ${created_at}
# WARN: This version is behind our electron runtime, but updating it will
# drop support for some older linux platforms, so we are keeping them out of
# sync for now
# TODO: https://jira.mongodb.org/browse/COMPASS-6915
NODE_JS_VERSION: '18.19.1'
NODE_JS_VERSION: '20.16.0'
NPM_VERSION: '10.2.4'
# secrets
HADRON_METRICS_INTERCOM_APP_ID: ${metrics_intercom_app_id}
Expand Down Expand Up @@ -305,12 +301,13 @@ functions:
shell: bash
env:
<<: *compass-env
HADRON_DISTRIBUTION: ${compass_distribution}
script: |
set -e
# Load environment variables
eval $(.evergreen/print-compass-env.sh)
# Generates and expansion file with build target metadata in packages/compass/expansions.yml
npm run --workspace mongodb-compass build-info -- ${target_platform} ${target_arch} --format=yaml --flatten ${compass_distribution} --out expansions.raw.yml
npm run --workspace mongodb-compass build-info -- ${target_platform} ${target_arch} --format=yaml --flatten --out expansions.raw.yml
# the 'author' key conflicts with evergreen's own expansion
grep -v '^author:' < packages/compass/expansions.raw.yml > packages/compass/expansions.yml
- command: expansions.update
Expand Down Expand Up @@ -409,7 +406,7 @@ functions:
<<: *compass-env
DEBUG: ${debug}
npm_config_loglevel: ${npm_loglevel}
COMPASS_DISTRIBUTION: ${compass_distribution}
HADRON_DISTRIBUTION: ${compass_distribution}
script: |
set -e
Expand Down Expand Up @@ -447,7 +444,7 @@ functions:
<<: *compass-env
DEBUG: ${debug}
npm_config_loglevel: ${npm_loglevel}
COMPASS_DISTRIBUTION: ${compass_distribution}
HADRON_DISTRIBUTION: ${compass_distribution}
SIGNING_SERVER_HOSTNAME: ${SIGNING_SERVER_HOSTNAME}
SIGNING_SERVER_PRIVATE_KEY: ${SIGNING_SERVER_PRIVATE_KEY}
SIGNING_SERVER_PRIVATE_KEY_CYGPATH: ${SIGNING_SERVER_PRIVATE_KEY_CYGPATH}
Expand Down Expand Up @@ -589,11 +586,16 @@ functions:
MONGODB_RUNNER_VERSION: ${mongodb_version|}
E2E_TEST_GROUPS: ${e2e_test_groups}
E2E_TEST_GROUP: ${e2e_test_group}
ATLAS_LOCAL_VERSION: latest
HADRON_DISTRIBUTION: compass
script: |
set -e
# Load environment variables
eval $(.evergreen/print-compass-env.sh)
# Start atlas local to test Atlas Search
source .evergreen/start-atlas-local.sh
echo "Running E2E tests while collecting coverage..."
npm run --unsafe-perm --workspace compass-e2e-tests test-ci
Expand All @@ -614,6 +616,7 @@ functions:
MONGODB_RUNNER_VERSION: ${mongodb_version|}
E2E_TEST_GROUPS: ${e2e_test_groups}
E2E_TEST_GROUP: ${e2e_test_group}
HADRON_DISTRIBUTION: compass
script: |
set -e
# Load environment variables
Expand All @@ -623,7 +626,6 @@ functions:
npm run --unsafe-perm --workspace compass-e2e-tests test-ci -- -- --test-multiple-connections
test-packaged-app:
- command: shell.exec
# Fail the task if it's idle for 10 mins
Expand Down Expand Up @@ -946,6 +948,7 @@ functions:
DEBUG: ${debug}
SNYK_TOKEN: ${snyk_token}
JIRA_API_TOKEN: ${jira_api_token}
HADRON_DISTRIBUTION: compass
script: |
set -e
# Load environment variables
Expand Down
7 changes: 7 additions & 0 deletions .evergreen/print-compass-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ function printCompassEnv() {
printVar('DEV_VERSION_IDENTIFIER', process.env.DEV_VERSION_IDENTIFIER);
printVar('EVERGREEN_REVISION', process.env.EVERGREEN_REVISION);
printVar('EVERGREEN_REVISION_ORDER_ID', process.env.EVERGREEN_REVISION_ORDER_ID);

if (process.platform === 'darwin') {
// Without this, kerberos 2.1.1 is broken on macOS, but this flag is only
// really relevant for Linux.
// https://jira.mongodb.org/browse/NODE-6320
printVar('GYP_DEFINES', 'kerberos_use_rtld=false');
}
}

printCompassEnv();
72 changes: 72 additions & 0 deletions .evergreen/start-atlas-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# Check if ATLAS_LOCAL_VERSION is set
if [ -z "$ATLAS_LOCAL_VERSION" ]; then
echo "ATLAS_LOCAL_VERSION is not set. Skipping script."
return
fi

# Container name
CONTAINER_NAME=compass-e2e-tests-atlas-local

docker rm -f $CONTAINER_NAME || true

cleanup() {
echo "Stopping and removing container..."
docker stop $CONTAINER_NAME || true
docker rm -f $CONTAINER_NAME || true
}

trap cleanup EXIT

# Image name with version
IMAGE_NAME="mongodb/mongodb-atlas-local:$ATLAS_LOCAL_VERSION"
echo docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$IMAGE_NAME"

# Start the Docker container
docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$IMAGE_NAME"

echo "Waiting for container to become healthy..."

STATUS=""
CONSECUTIVE_FAILED_ATTEMPTS=0
MAX_CONSECUTIVE_FAILED_ATTEMPTS=20

while true; do
INSPECT_OUTPUT=$(docker inspect --format='{{.State.Health.Status}}' $CONTAINER_NAME 2>&1)
if [[ $? -ne 0 ]]; then
echo "Inspect Failed: ${INSPECT_OUTPUT}"
STATUS="failed"
else
STATUS="$INSPECT_OUTPUT"
fi

echo "Status: $STATUS"

if [[ "$STATUS" != "starting" && "$STATUS" != "failed" ]]; then
break
fi

if [[ "$STATUS" == "failed" ]]; then
CONSECUTIVE_FAILED_ATTEMPTS=$((CONSECUTIVE_FAILED_ATTEMPTS + 1))
else
CONSECUTIVE_FAILED_ATTEMPTS=0
fi

if [[ $CONSECUTIVE_FAILED_ATTEMPTS -ge $MAX_CONSECUTIVE_FAILED_ATTEMPTS ]]; then
echo "Maximum number of consecutive failed attempts reached. Exiting."
exit 1
fi

sleep 2
done

if [[ "$STATUS" != "healthy" ]]; then
echo "Atlas Local is not healthy, exiting."
exit 1
fi

EXPOSED_PORT=$(docker inspect --format='{{ (index (index .NetworkSettings.Ports "27017/tcp") 0).HostPort }}' $CONTAINER_NAME)

export ATLAS_LOCAL_URL="mongodb://127.0.0.1:$EXPOSED_PORT/test?directConnection=true"
echo "ATLAS_LOCAL_URL set to $ATLAS_LOCAL_URL"
2 changes: 1 addition & 1 deletion .github/workflows/authors-and-third-party-notices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

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

- name: Install [email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bump-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18.19.1
node-version: 20.16.0
cache: 'npm'

- name: Install [email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-compass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Node.js Environment
uses: actions/setup-node@v3
with:
node-version: 18.19.1
node-version: 20.16.0
cache: 'npm'

- name: Install [email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: "Use Node.js 14"
uses: actions/setup-node@v3
with:
node-version: 18.19.1
node-version: 20.16.0

- name: Install [email protected]
run: npm install -g [email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/start-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18.19.1
node-version: 20.16.0
cache: 'npm'

- name: Install [email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/start-ga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18.19.1
node-version: 20.16.0
cache: 'npm'

- name: Install [email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-electron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
git config --local user.name "github-actions[bot]"
- uses: actions/setup-node@v3
with:
node-version: 18.19.1
node-version: 20.16.0
cache: 'npm'

- name: Install [email protected]
Expand All @@ -50,4 +50,4 @@ jobs:
branch: ci/update-electron
title: 'chore: update electron'
body: |
- Update electron
- Update electron
2 changes: 1 addition & 1 deletion .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ignore:
reason: >-
Not applicable as we do not use a valueFormatter or cellRenderer
function
expires: 2024-08-17T18:27:24.346Z
expires: 2024-11-15T18:27:24.346Z
created: 2024-01-18T18:27:24.353Z
SNYK-JS-AXIOS-6032459:
- '*':
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@ Mingjun Yin <[email protected]>
Ben Radcliffe <[email protected]>
Betsy Button <[email protected]>
Vivian Xiao <[email protected]>
admin-token-bot <[email protected]>
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Getting Started

You'll need node `^18` and npm `^10` installed on your machine to work with the repository locally.
You'll need node `^20` and npm `^10` installed on your machine to work with the repository locally.
After your environment is ready, navigate to the repository and run `npm run bootstrap`, this will install dependencies and will compile all packages.

After bootstrap is finished, you should be able to run `npm run start` and see Compass application running locally. Alternatively you can start a web version of the app by running `npm run start-web`.
Expand Down Expand Up @@ -56,10 +56,10 @@ In addition to running lerna commands directly, there are a few convenient npm s
To build compass you can run `package-compass` script:

```sh
npm run package-compass
HADRON_DISTRIBUTION='compass' npm run package-compass
```

You can change the type of distribution you are building with `HADRON_DISTRIBUTION` environmental variable:
It is required to provide `HADRON_DISTRIBUTION` env variable explicitly. You can change the type of distribution you are building by setting a different `HADRON_DISTRIBUTION` value:

```sh
HADRON_DISTRIBUTION='compass-readonly' npm run package-compass
Expand Down
Loading

0 comments on commit 7c569f8

Please sign in to comment.