Skip to content

Commit 2ef302d

Browse files
authored
Merge branch 'main' into kh/schema-shared-event
2 parents 55bdb82 + 2b44d26 commit 2ef302d

File tree

123 files changed

+4471
-4735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+4471
-4735
lines changed

.depalignrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
],
2727
"js-yaml": [
2828
"^3.13.1"
29+
],
30+
"yargs": [
31+
"^4.8.1"
2932
]
3033
}
3134
}

.evergreen/buildvariants-and-tasks.in.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ const PACKAGE_BUILD_VARIANTS = [
2828
name: 'package-ubuntu',
2929
display_name: 'Package Ubuntu',
3030
31-
// # NOTE: We are packaging on Ubuntu 16.04 in order to use glibc 2.23
31+
// # NOTE: We are packaging on Ubuntu 18.04 in order to use glibc 2.27
3232
// # when compiling/re-building addons. This ensures compatibility with other
33-
// # debian platforms that have glibc 2.23 or newer.
34-
run_on: 'ubuntu1604-large',
33+
// # debian platforms that have glibc 2.27 or newer.
34+
run_on: 'ubuntu1804-large',
3535
silk_asset_group: 'compass-ubuntu',
3636
},
3737
{
@@ -275,6 +275,12 @@ buildvariants:
275275
<% } %>
276276
<% } %>
277277

278+
- name: test-web-sandbox-atlas-cloud
279+
display_name: Test Web Sandbox (w/ Atlas Cloud login)
280+
run_on: ubuntu2004-large
281+
tasks:
282+
- name: test-web-sandbox-atlas-cloud
283+
278284
- name: generate-vulnerability-report
279285
display_name: Vulnerability Report
280286
run_on: ubuntu2004-large
@@ -504,6 +510,21 @@ tasks:
504510
<% } %>
505511
<% } %>
506512

513+
- name: test-web-sandbox-atlas-cloud
514+
tags:
515+
- required-for-publish
516+
- run-on-pr
517+
- assigned_to_jira_team_compass_compass
518+
- foliage_check_task_only
519+
commands:
520+
- func: prepare
521+
- func: install
522+
- func: bootstrap
523+
- func: test-web-sandbox-atlas-cloud
524+
vars:
525+
compass_distribution: compass
526+
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
527+
507528
- name: create_static_analysis_report
508529
tags: ['required-for-publish', 'run-on-pr']
509530
depends_on:

.evergreen/buildvariants-and-tasks.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ buildvariants:
3535
expansions:
3636
silk_asset_group: compass-ubuntu
3737
display_name: Package Ubuntu
38-
run_on: ubuntu1604-large
38+
run_on: ubuntu1804-large
3939
tasks:
4040
- name: package-compass
4141
- name: package-compass-isolated
@@ -257,6 +257,11 @@ buildvariants:
257257
- name: test-web-sandbox-firefox-1
258258
- name: test-web-sandbox-firefox-2
259259
- name: test-web-sandbox-firefox-3
260+
- name: test-web-sandbox-atlas-cloud
261+
display_name: Test Web Sandbox (w/ Atlas Cloud login)
262+
run_on: ubuntu2004-large
263+
tasks:
264+
- name: test-web-sandbox-atlas-cloud
260265
- name: generate-vulnerability-report
261266
display_name: Vulnerability Report
262267
run_on: ubuntu2004-large
@@ -1715,6 +1720,20 @@ tasks:
17151720
e2e_test_groups: 3
17161721
e2e_test_group: 3
17171722
debug: compass-e2e-tests*,electron*,hadron*,mongo*
1723+
- name: test-web-sandbox-atlas-cloud
1724+
tags:
1725+
- required-for-publish
1726+
- run-on-pr
1727+
- assigned_to_jira_team_compass_compass
1728+
- foliage_check_task_only
1729+
commands:
1730+
- func: prepare
1731+
- func: install
1732+
- func: bootstrap
1733+
- func: test-web-sandbox-atlas-cloud
1734+
vars:
1735+
compass_distribution: compass
1736+
debug: compass-e2e-tests*,electron*,hadron*,mongo*
17181737
- name: create_static_analysis_report
17191738
tags:
17201739
- required-for-publish

.evergreen/functions.yml

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ post:
8686
target: src/all-e2e-logs.tgz
8787
source_dir: src/packages/compass-e2e-tests/.log
8888
include:
89-
- "**"
89+
- '**'
9090
- command: s3.put
9191
params:
9292
<<: *save-artifact-params-private
@@ -303,7 +303,7 @@ functions:
303303
echo "Running tests in Electron runtime"
304304
305305
# Preparing native addons for electron runtime
306-
npm run --unsafe-perm electron-rebuild
306+
DEBUG=electron-rebuild* npm run --unsafe-perm electron-rebuild
307307
308308
npm run --unsafe-perm test-ci-electron -- --stream
309309
@@ -597,10 +597,9 @@ functions:
597597
DEBUG: ${debug|}
598598
MONGODB_VERSION: ${mongodb_version|}
599599
MONGODB_RUNNER_VERSION: ${mongodb_version|}
600-
E2E_TEST_GROUPS: ${e2e_test_groups}
601-
E2E_TEST_GROUP: ${e2e_test_group}
600+
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
601+
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
602602
ATLAS_LOCAL_VERSION: latest
603-
HADRON_DISTRIBUTION: compass
604603
script: |
605604
set -e
606605
# Load environment variables
@@ -629,8 +628,8 @@ functions:
629628
DEBUG: ${debug|}
630629
MONGODB_VERSION: ${mongodb_version|}
631630
MONGODB_RUNNER_VERSION: ${mongodb_version|}
632-
E2E_TEST_GROUPS: ${e2e_test_groups}
633-
E2E_TEST_GROUP: ${e2e_test_group}
631+
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
632+
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
634633
script: |
635634
set -e
636635
# Load environment variables
@@ -664,14 +663,50 @@ functions:
664663
DEBUG: ${debug|}
665664
MONGODB_VERSION: ${mongodb_version|}
666665
MONGODB_RUNNER_VERSION: ${mongodb_version|}
667-
COMPASS_WEB_BROWSER_NAME: ${browser_name}
668-
E2E_TEST_GROUPS: ${e2e_test_groups}
669-
E2E_TEST_GROUP: ${e2e_test_group}
666+
COMPASS_E2E_BROWSER_NAME: ${browser_name}
667+
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
668+
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
669+
script: |
670+
set -e
671+
# Load environment variables
672+
eval $(.evergreen/print-compass-env.sh)
673+
npm run --unsafe-perm --workspace compass-e2e-tests test-ci web
674+
675+
676+
test-web-sandbox-atlas-cloud:
677+
- command: shell.exec
678+
# It can take a very long time for Atlas cluster to get deployed
679+
timeout_secs: 2400
680+
params:
681+
working_dir: src
682+
shell: bash
683+
env:
684+
<<: *compass-env
685+
DEBUG: ${debug|}
686+
COMPASS_E2E_ATLAS_CLOUD_SANDBOX_CLOUD_CONFIG: 'qa'
687+
COMPASS_E2E_ATLAS_CLOUD_SANDBOX_USERNAME: ${e2e_tests_compass_web_atlas_username}
688+
COMPASS_E2E_ATLAS_CLOUD_SANDBOX_PASSWORD: ${e2e_tests_compass_web_atlas_password}
689+
COMPASS_E2E_ATLAS_CLOUD_SANDBOX_DBUSER_USERNAME: ${e2e_tests_compass_web_atlas_db_username}
690+
COMPASS_E2E_ATLAS_CLOUD_SANDBOX_DBUSER_PASSWORD: ${e2e_tests_compass_web_atlas_password}
691+
MCLI_PUBLIC_API_KEY: ${e2e_tests_mcli_public_api_key}
692+
MCLI_PRIVATE_API_KEY: ${e2e_tests_mcli_private_api_key}
693+
MCLI_ORG_ID: ${e2e_tests_mcli_org_id}
694+
MCLI_PROJECT_ID: ${e2e_tests_mcli_project_id}
695+
MCLI_OPS_MANAGER_URL: ${e2e_tests_mcli_ops_manager_url}
670696
script: |
671697
set -e
672698
# Load environment variables
673699
eval $(.evergreen/print-compass-env.sh)
674-
npm run --unsafe-perm --workspace compass-e2e-tests test-web
700+
# Create Atlas cluster for test project
701+
source .evergreen/start-atlas-cloud-cluster.sh
702+
# Run the tests
703+
echo "Starting e2e tests..."
704+
# We're only running a special subset of tests as provisioning atlas
705+
# clusters in CI is both pricey and flakey, so we want to limit the
706+
# coverage to reduce those factors (at least for now)
707+
npm run --unsafe-perm --workspace compass-e2e-tests test-ci -- -- web \
708+
--test-atlas-cloud-sandbox \
709+
--test-filter="atlas-cloud/**/*"
675710
676711
test-connectivity:
677712
- command: shell.exec

.evergreen/print-compass-env.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function printCompassEnv() {
7171
// To build node modules on linux post electron 13 we need a newer c++
7272
// compiler version and at least python v3.9, this adds it.
7373
// https://jira.mongodb.org/browse/COMPASS-5150
74-
pathsToPrepend.unshift('/opt/mongodbtoolchain/v3/bin');
74+
pathsToPrepend.unshift('/opt/mongodbtoolchain/v4/bin');
7575
}
7676

7777
PATH = maybePrependPaths(PATH, pathsToPrepend);
@@ -111,12 +111,8 @@ function printCompassEnv() {
111111
process.env.EVERGREEN_REVISION_ORDER_ID
112112
);
113113

114-
if (process.platform === 'darwin') {
115-
// Without this, kerberos 2.1.1 is broken on macOS, but this flag is only
116-
// really relevant for Linux.
117-
// https://jira.mongodb.org/browse/NODE-6320
118-
printVar('GYP_DEFINES', 'kerberos_use_rtld=false');
119-
}
114+
// https://jira.mongodb.org/browse/NODE-6320
115+
printVar('GYP_DEFINES', `kerberos_use_rtld=${process.platform === 'linux'}`);
120116
}
121117

122118
printCompassEnv();
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# Atlas limits the naming to something like /^[\w\d-]{,23}$/ (and will auto
4+
# truncate if it's too long) so we're very limited in terms of how unique this
5+
# name can be. Hopefully the epoch + part of git hash is enough for these to not
6+
# overlap when tests are running
7+
ATLAS_CLOUD_TEST_CLUSTER_NAME="e2e-$(date +"%s")-$(git rev-parse HEAD)"
8+
9+
function atlascli() {
10+
docker run \
11+
-e MCLI_PUBLIC_API_KEY \
12+
-e MCLI_PRIVATE_API_KEY \
13+
-e MCLI_ORG_ID \
14+
-e MCLI_PROJECT_ID \
15+
-e MCLI_OPS_MANAGER_URL \
16+
mongodb/atlas atlas $@
17+
}
18+
19+
cleanup() {
20+
echo "Scheduling Atlas deployment \`$ATLAS_CLOUD_TEST_CLUSTER_NAME\` for deletion..."
21+
atlascli clusters delete $ATLAS_CLOUD_TEST_CLUSTER_NAME --force
22+
}
23+
24+
trap cleanup EXIT
25+
26+
echo "Creating Atlas deployment \`$ATLAS_CLOUD_TEST_CLUSTER_NAME\` to test against..."
27+
atlascli clusters create $ATLAS_CLOUD_TEST_CLUSTER_NAME \
28+
--provider AWS \
29+
--region US_EAST_1 \
30+
--tier M10
31+
32+
echo "Waiting for the deployment to be provisioned..."
33+
atlascli clusters watch "$ATLAS_CLOUD_TEST_CLUSTER_NAME"
34+
35+
echo "Getting connection string for provisioned cluster..."
36+
ATLAS_CLOUD_TEST_CLUSTER_CONNECTION_STRING_JSON="$(atlascli clusters connectionStrings describe $ATLAS_CLOUD_TEST_CLUSTER_NAME -o json)"
37+
38+
export COMPASS_E2E_ATLAS_CLOUD_SANDBOX_DEFAULT_CONNECTIONS="{\"$ATLAS_CLOUD_TEST_CLUSTER_NAME\": $ATLAS_CLOUD_TEST_CLUSTER_CONNECTION_STRING_JSON}"
39+
echo "Cluster connections: $COMPASS_E2E_ATLAS_CLOUD_SANDBOX_DEFAULT_CONNECTIONS"

.github/workflows/bump-packages.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ jobs:
5555
commit-message: 'chore(release): bump package versions'
5656
branch: ci/bump-packages
5757
title: 'chore(release): bump package versions'
58+
labels: no-title-validation
5859
body: |
5960
- Bump package versions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Check PR Title"
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled, converted_to_draft, edited]
5+
6+
jobs:
7+
check-pr-title:
8+
name: Check PR Title
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Enforce conventional commit style
12+
uses: realm/ci-actions/title-checker@main
13+
with:
14+
regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|ops){1}(\([\w\-\.]+\))?(!)?: .*'
15+
error-hint: 'Invalid PR title. Make sure it follows the conventional commit specification (i.e. "<type>(<optional scope>): <description>") or add the no-title-validation label'
16+
ignore-labels: 'no-title-validation'
17+
- name: Enforce JIRA ticket in title
18+
uses: realm/ci-actions/title-checker@main
19+
# Skip the JIRA ticket check for PRs opened by bots
20+
if: ${{ !contains(github.event.pull_request.user.login, '[bot]') }}
21+
with:
22+
regex: '[A-Z]{4,10}-[0-9]{1,5}$'
23+
error-hint: 'Invalid PR title. Make sure it ends with a JIRA ticket - i.e. COMPASS-1234 or add the no-title-validation label'
24+
ignore-labels: 'no-title-validation'

.github/workflows/update-electron.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ jobs:
4040
run: |
4141
node scripts/update-electron.js
4242
git add .
43-
git commit --no-allow-empty -m "chore: update electron" || true
43+
git commit --no-allow-empty -m "chore(deps): update electron" || true
4444
- name: Create Pull Request
4545
id: cpr
4646
uses: peter-evans/create-pull-request@v6
4747
with:
4848
token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }}
49-
commit-message: 'chore: update electron'
49+
commit-message: 'chore(deps): update electron'
5050
branch: ci/update-electron
51-
title: 'chore: update electron'
51+
title: 'chore(deps): update electron'
52+
labels: no-title-validation
5253
body: |
5354
- Update electron

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,4 @@ Kræn Hansen <[email protected]>
9393
Kræn Hansen <[email protected]>
9494
Ruchitha Rajaghatta <[email protected]>
9595
96+
Nikola Irinchev <[email protected]>

0 commit comments

Comments
 (0)