Skip to content

Commit 47a7ef9

Browse files
authored
Merge branch 'main' into COMPASS-8376-add-gen-ai-endpoints-compass-web
2 parents b195a5d + 3e48138 commit 47a7ef9

File tree

44 files changed

+1132
-692
lines changed

Some content is hidden

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

44 files changed

+1132
-692
lines changed

.evergreen/functions.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,6 @@ functions:
683683
env:
684684
<<: *compass-env
685685
DEBUG: ${debug|}
686-
COMPASS_E2E_ATLAS_CLOUD_SANDBOX_CLOUD_CONFIG: 'qa'
687686
COMPASS_E2E_ATLAS_CLOUD_SANDBOX_USERNAME: ${e2e_tests_compass_web_atlas_username}
688687
COMPASS_E2E_ATLAS_CLOUD_SANDBOX_PASSWORD: ${e2e_tests_compass_web_atlas_password}
689688
COMPASS_E2E_ATLAS_CLOUD_SANDBOX_DBUSER_USERNAME: ${e2e_tests_compass_web_atlas_db_username}
Lines changed: 79 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,61 @@
11
#!/bin/bash
22

3+
# This script helps to automatically provision Atlas cluster for running the e2e
4+
# tests against. In CI this will always create a new cluster and delete it when
5+
# the test run is finished. You can also use this script locally to run e2e
6+
# tests against a "logged in" Atlas Cloud experience in compass-web sandbox.
7+
#
8+
# While the provisioning of clusters is automated, you should be aware that it
9+
# requires some extra environmental variables to be available when you are
10+
# running it. If you want to be able to run these e2e tests locally, following
11+
# steps are required:
12+
#
13+
# - Create a test Atlas user on one of the testing environments (-dev / -qa).
14+
# You can only use your work emails with a subaddress to create those (e.g,
15+
16+
#
17+
# - Setup a new org and project. Save the org id and project id for later.
18+
#
19+
# - Create new db user with username / password auth and admin role. This user
20+
# will be used to prepopulate dbs with data in tests. Save the credentials.
21+
#
22+
# - Create a new API key (Access Manager > Project Access > Create Application >
23+
# API Key) for the project you created and save the public and private keys.
24+
#
25+
# - (Optional) Deploy a cluster with a required configuration through Atlas
26+
# Cloud UI. If you skip the step, the script will deploy a default cluster for
27+
# you.
28+
#
29+
# - Make sure that you have the following environmental variables provided to
30+
# the script below:
31+
#
32+
# MCLI_OPS_MANAGER_URL API base url matching the environment you used to
33+
# create your user (https://cloud{-dev,-qa}.mongodb.com/)
34+
# MCLI_PUBLIC_API_KEY Public API key
35+
# MCLI_PRIVATE_API_KEY Private API key
36+
# MCLI_ORG_ID Org ID
37+
# MCLI_PROJECT_ID Project ID
38+
#
39+
# COMPASS_E2E_ATLAS_CLOUD_SANDBOX_USERNAME Cloud user you created
40+
# COMPASS_E2E_ATLAS_CLOUD_SANDBOX_PASSWORD Cloud user password
41+
# COMPASS_E2E_ATLAS_CLOUD_SANDBOX_DBUSER_USERNAME Db user for the project
42+
# COMPASS_E2E_ATLAS_CLOUD_SANDBOX_DBUSER_PASSWORD Db user password
43+
#
44+
# - Source the script followed by running the tests to make sure that some
45+
# variables exported from this script are available for the test env:
46+
#
47+
# (ATLAS_CLOUD_TEST_CLUSTER_NAME="TestCluster" source .evergreen/start-atlas-cloud-cluster.sh \
48+
# && npm run -w compass-e2e-tests test web -- --test-atlas-cloud-sandbox --test-filter="atlas-cloud/**/*")
49+
50+
_ATLAS_CLOUD_TEST_CLUSTER_NAME=${ATLAS_CLOUD_TEST_CLUSTER_NAME:-""}
51+
352
# Atlas limits the naming to something like /^[\w\d-]{,23}$/ (and will auto
453
# truncate if it's too long) so we're very limited in terms of how unique this
554
# name can be. Hopefully the epoch + part of git hash is enough for these to not
655
# overlap when tests are running
7-
ATLAS_CLOUD_TEST_CLUSTER_NAME="e2e-$(date +"%s")-$(git rev-parse HEAD)"
56+
DEFAULT_ATLAS_CLOUD_TEST_CLUSTER_NAME="e2e-$(date +"%s")-$(git rev-parse HEAD)"
57+
58+
ATLAS_CLUSTER_NAME="${_ATLAS_CLOUD_TEST_CLUSTER_NAME:-$DEFAULT_ATLAS_CLOUD_TEST_CLUSTER_NAME}"
859

960
function atlascli() {
1061
docker run \
@@ -17,23 +68,43 @@ function atlascli() {
1768
}
1869

1970
cleanup() {
20-
echo "Scheduling Atlas deployment \`$ATLAS_CLOUD_TEST_CLUSTER_NAME\` for deletion..."
21-
atlascli clusters delete $ATLAS_CLOUD_TEST_CLUSTER_NAME --force
71+
# Assuming that we want to preserve the cluster if the name was provided
72+
# outside of script. Helpful when trying to run the tests locally, you can
73+
# automatically create a cluster with a custom name for the first time, but
74+
# then re-use it when running the tests again. Don't forget to clean it up
75+
# after you're done!
76+
if [ -z "$_ATLAS_CLOUD_TEST_CLUSTER_NAME" ]; then
77+
echo "Scheduling Atlas deployment \`$ATLAS_CLUSTER_NAME\` for deletion..."
78+
atlascli clusters delete $ATLAS_CLUSTER_NAME --force
79+
else
80+
echo "Custom cluster name provided ($_ATLAS_CLOUD_TEST_CLUSTER_NAME), skipping cluster cleanup"
81+
fi
2282
}
2383

2484
trap cleanup EXIT
2585

26-
echo "Creating Atlas deployment \`$ATLAS_CLOUD_TEST_CLUSTER_NAME\` to test against..."
27-
atlascli clusters create $ATLAS_CLOUD_TEST_CLUSTER_NAME \
86+
echo "Creating Atlas deployment \`$ATLAS_CLUSTER_NAME\` to test against..."
87+
atlascli clusters create $ATLAS_CLUSTER_NAME \
2888
--provider AWS \
2989
--region US_EAST_1 \
3090
--tier M10
3191

3292
echo "Waiting for the deployment to be provisioned..."
33-
atlascli clusters watch "$ATLAS_CLOUD_TEST_CLUSTER_NAME"
93+
atlascli clusters watch $ATLAS_CLUSTER_NAME
3494

3595
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)"
96+
CONNECTION_STRINGS_JSON="$(atlascli clusters connectionStrings describe $ATLAS_CLUSTER_NAME -o json)"
97+
98+
export COMPASS_E2E_ATLAS_CLOUD_SANDBOX_CLOUD_CONFIG=$(
99+
if [[ "$MCLI_OPS_MANAGER_URL" =~ "-dev" ]]; then
100+
echo "dev"
101+
elif [[ "$MCLI_OPS_MANAGER_URL" =~ "-qa" ]]; then
102+
echo "qa"
103+
else
104+
echo "prod"
105+
fi
106+
)
107+
echo "Cloud config: $COMPASS_E2E_ATLAS_CLOUD_SANDBOX_CLOUD_CONFIG"
37108

38-
export COMPASS_E2E_ATLAS_CLOUD_SANDBOX_DEFAULT_CONNECTIONS="{\"$ATLAS_CLOUD_TEST_CLUSTER_NAME\": $ATLAS_CLOUD_TEST_CLUSTER_CONNECTION_STRING_JSON}"
109+
export COMPASS_E2E_ATLAS_CLOUD_SANDBOX_DEFAULT_CONNECTIONS="{\"$ATLAS_CLUSTER_NAME\": $CONNECTION_STRINGS_JSON}"
39110
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

.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

THIRD-PARTY-NOTICES.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **Mongodb Compass**.
2-
This document was automatically generated on Tue Oct 29 2024.
2+
This document was automatically generated on Wed Oct 30 2024.
33

44
## List of dependencies
55

@@ -211,6 +211,7 @@ Package|Version|License
211211
**[cookie-signature](#28f6116b52488ac66a14424869fc346f611bea6c894e7d0f7f2ca701deb8e49c)**|1.0.6|MIT
212212
**[cookie](#6fffbd43d8f0d9a659c21e31a0935f0a1226c9990be593a9649dcd61e4db1204)**|0.7.1|MIT
213213
**[core-js](#2d0305d15eab4ad23db10b97faf9d8e8e0d5ad30a616c5892d1edd535d8a08c8)**|3.17.3|MIT
214+
**[cpu-features](#fa992e00865a6ed732ac63bbf64c89ee2da4ec39944684e6002a3a34b5adb65c)**|0.0.9|MIT
214215
**[crelt](#9eba7acaba2af9d27a0a18fcf40d1f133ffa888d85321e4633e7dac58cab2db9)**|1.0.5|MIT
215216
**[cross-fetch](#2cd4375069c47bf89a4b399cd21cd9573086803b2cb9fc56c29df5a598e051e5)**|3.1.8|MIT
216217
**[cross-spawn](#67de3a765808182ee1018c35bc07d7a023a8d645e98cc32814dcac2fc2c427ff)**|7.0.3|MIT
@@ -247,7 +248,7 @@ Package|Version|License
247248
**[ee-first](#e2746902c758ae8a6f91ffb9618cd53717f936cb33c6323e65b6b7b24f7ebefe)**|1.1.1|MIT
248249
**[electron-dl](#e97e034c7b93c63e7a433d75f6f1de3e0668764225ebbd61dbde8d1b55d6f3b7)**|3.5.0|MIT
249250
**[electron-squirrel-startup](#09fb8168e8fda2e174f8d1a1c392ffd8f762c5637c788edd00d1e2486d060349)**|1.0.1|Apache-2.0
250-
**[electron](#4dac8b39331bcb6b30b99afe0849c00e3153935fcab1f1086622b9a2ccb4afc8)**|32.2.1|MIT
251+
**[electron](#ddfad0a406da8c661d832155ebc87c378ac67db5d3c70f33126149f0084c639b)**|32.2.2|MIT
251252
**[encodeurl](#b89152db475e86531e570f87b45d8a51aa5e5d87d4cc3b960cee7b8febf1d26a)**|1.0.2|MIT
252253
**[encodeurl](#177948a319ae0aeebbd65742c53c62b37c75ec1d021afa5a188d10a7ceae6623)**|2.0.0|MIT
253254
**[end-of-stream](#fadc10994f5fa767d06fb25cfff35fb17a895daf3bc3477c782907668ed16563)**|1.4.4|MIT
@@ -17717,6 +17718,34 @@ License files:
1771717718

1771817719

1771917720

17721+
<a id="fa992e00865a6ed732ac63bbf64c89ee2da4ec39944684e6002a3a34b5adb65c"></a>
17722+
### [cpu-features](https://www.npmjs.com/package/cpu-features) (version 0.0.9)
17723+
License tags: MIT
17724+
17725+
License files:
17726+
* LICENSE:
17727+
17728+
Copyright Brian White. All rights reserved.
17729+
17730+
Permission is hereby granted, free of charge, to any person obtaining a copy
17731+
of this software and associated documentation files (the "Software"), to
17732+
deal in the Software without restriction, including without limitation the
17733+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
17734+
sell copies of the Software, and to permit persons to whom the Software is
17735+
furnished to do so, subject to the following conditions:
17736+
17737+
The above copyright notice and this permission notice shall be included in
17738+
all copies or substantial portions of the Software.
17739+
17740+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17741+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17742+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17743+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17744+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17745+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17746+
IN THE SOFTWARE.
17747+
17748+
1772017749
<a id="9eba7acaba2af9d27a0a18fcf40d1f133ffa888d85321e4633e7dac58cab2db9"></a>
1772117750
### [crelt](https://www.npmjs.com/package/crelt) (version 1.0.5)
1772217751
License tags: MIT
@@ -19186,8 +19215,8 @@ License files:
1918619215

1918719216

1918819217

19189-
<a id="4dac8b39331bcb6b30b99afe0849c00e3153935fcab1f1086622b9a2ccb4afc8"></a>
19190-
### [electron](https://www.npmjs.com/package/electron) (version 32.2.1)
19218+
<a id="ddfad0a406da8c661d832155ebc87c378ac67db5d3c70f33126149f0084c639b"></a>
19219+
### [electron](https://www.npmjs.com/package/electron) (version 32.2.2)
1919119220
License tags: MIT
1919219221

1919319222
License files:

configs/webpack-config-compass/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"cli-progress": "^3.9.1",
7474
"core-js": "^3.17.3",
7575
"css-loader": "^4.3.0",
76-
"electron": "^32.2.1",
76+
"electron": "^32.2.2",
7777
"html-webpack-plugin": "^5.6.0",
7878
"less": "^3.13.1",
7979
"less-loader": "^10.0.1",

docs/tracking-plan.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Compass Tracking Plan
33

4-
Generated on Tue, Oct 29, 2024 at 02:12 PM
4+
Generated on Wed, Oct 30, 2024 at 02:38 PM
55

66
## Table of Contents
77

@@ -148,6 +148,7 @@ Generated on Tue, Oct 29, 2024 at 02:12 PM
148148

149149
### Schema
150150
- [Schema Analyzed](#event--SchemaAnalyzedEvent)
151+
- [Schema Exported](#event--SchemaExportedEvent)
151152

152153
### Schema Validation
153154
- [Schema Validation Added](#event--SchemaValidationAddedEvent)
@@ -1801,6 +1802,25 @@ This event is fired when user analyzes the schema.
18011802
- **connection_id** (optional): `string | undefined`
18021803
- The id of the connection associated to this event.
18031804

1805+
<a name="event--SchemaExportedEvent"></a>
1806+
1807+
### Schema Exported
1808+
1809+
This event is fired when user shares the schema.
1810+
1811+
**Properties**:
1812+
1813+
- **has_schema** (required): `boolean`
1814+
- Indicates whether the schema was analyzed before sharing.
1815+
- **schema_width** (required): `number`
1816+
- The number of fields at the top level.
1817+
- **schema_depth** (required): `number`
1818+
- The number of nested levels.
1819+
- **geo_data** (required): `boolean`
1820+
- Indicates whether the schema contains geospatial data.
1821+
- **connection_id** (optional): `string | undefined`
1822+
- The id of the connection associated to this event.
1823+
18041824

18051825
## Schema Validation
18061826

0 commit comments

Comments
 (0)