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 Feb 12, 2024
2 parents 3094654 + 0719486 commit d0dbf35
Show file tree
Hide file tree
Showing 91 changed files with 6,369 additions and 3,881 deletions.
12 changes: 6 additions & 6 deletions .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,16 +331,16 @@ functions:
wait: true
# copy ssh key (this key will be used to connect to ssh server)
- command: shell.exec
silent: true
params:
working_dir: src
shell: bash
env:
__project_aws_ssh_key_value: ${__project_aws_ssh_key_value}
script: |
set -e
{
set +x
echo '${__project_aws_ssh_key_value}' > ~/.ssh/mcipacker.pem
chmod 0600 ~/.ssh/mcipacker.pem
set -x
}
.evergreen/setup-ssh-key.sh
# wait for host to be ready
- command: shell.exec
params:
Expand Down
6 changes: 6 additions & 0 deletions .evergreen/setup-ssh-key.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /usr/bin/env bash

set -e
set +x
echo "${__project_aws_ssh_key_value}" > ~/.ssh/mcipacker.pem
chmod 0600 ~/.ssh/mcipacker.pem
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ Hinson Chan <[email protected]>
Gokul Raam <[email protected]>
Bailey Pearson <[email protected]>
Hao <[email protected]>
Paula Stachova <[email protected]>
768 changes: 475 additions & 293 deletions THIRD-PARTY-NOTICES.md

Large diffs are not rendered by default.

8,507 changes: 5,401 additions & 3,106 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/atlas-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@mongodb-js/compass-logging": "^1.2.12",
"@mongodb-js/compass-utils": "^0.5.11",
"@mongodb-js/devtools-connect": "^2.4.2",
"@mongodb-js/oidc-plugin": "^0.3.0",
"@mongodb-js/oidc-plugin": "^0.3.1",
"compass-preferences-model": "^2.17.4",
"electron": "^28.2.1",
"hadron-ipc": "^3.2.10",
Expand Down
2 changes: 1 addition & 1 deletion packages/atlas-service/src/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ describe('AtlasServiceMain', function () {
preferences,
getUserId: AtlasService['getUserId'],
});
expect(getListenerCount(logger)).to.eq(25);
expect(getListenerCount(logger)).to.eq(26);
// We did all preparations, reset sinon history for easier assertions
sandbox.resetHistory();

Expand Down
4 changes: 2 additions & 2 deletions packages/compass-aggregations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@mongodb-js/explain-plan-helper": "^1.1.8",
"@mongodb-js/mongodb-constants": "^0.9.0",
"@mongodb-js/my-queries-storage": "^0.4.3",
"bson": "^6.2.0",
"bson": "^6.3.0",
"compass-preferences-model": "^2.17.4",
"hadron-app-registry": "^9.1.6",
"hadron-document": "^8.4.7",
Expand Down Expand Up @@ -118,7 +118,7 @@
"@mongodb-js/explain-plan-helper": "^1.1.8",
"@mongodb-js/mongodb-constants": "^0.9.0",
"@mongodb-js/my-queries-storage": "^0.4.3",
"bson": "^6.2.0",
"bson": "^6.3.0",
"compass-preferences-model": "^2.17.4",
"hadron-app-registry": "^9.1.6",
"hadron-document": "^8.4.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@react-aria/utils": "^3.13.1",
"@react-aria/visually-hidden": "^3.3.1",
"@react-stately/tooltip": "^3.0.5",
"bson": "^6.2.0",
"bson": "^6.3.0",
"focus-trap-react": "^8.4.2",
"hadron-document": "^8.4.7",
"hadron-type-checker": "^7.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/compass-crud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@mongodb-js/compass-workspaces": "^0.4.4",
"@mongodb-js/explain-plan-helper": "^1.1.8",
"@mongodb-js/my-queries-storage": "^0.4.3",
"bson": "^6.2.0",
"bson": "^6.3.0",
"compass-preferences-model": "^2.17.4",
"hadron-app-registry": "^9.1.6",
"hadron-document": "^8.4.7",
Expand Down Expand Up @@ -120,7 +120,7 @@
"@mongodb-js/compass-workspaces": "^0.4.4",
"@mongodb-js/explain-plan-helper": "^1.1.8",
"@mongodb-js/my-queries-storage": "^0.4.3",
"bson": "^6.2.0",
"bson": "^6.3.0",
"compass-preferences-model": "^2.17.4",
"hadron-app-registry": "^9.1.6",
"hadron-document": "^8.4.7",
Expand Down
62 changes: 23 additions & 39 deletions packages/compass-e2e-tests/helpers/commands/add-collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export async function addCollection(
const createModalElement = await browser.$(Selectors.CreateCollectionModal);
await createModalElement.waitForDisplayed();

const collectionInput = await browser.$(
Selectors.CreateDatabaseCollectionName
await browser.setValueVisible(
Selectors.CreateDatabaseCollectionName,
collectionName
);
await collectionInput.setValue(collectionName);

if (collectionOptions) {
await browser.clickVisible(
Expand All @@ -54,11 +54,10 @@ export async function addCollection(
if (collectionOptions && collectionOptions.capped) {
await browser.clickVisible(Selectors.CreateCollectionCappedCheckboxLabel);

const sizeElement = await browser.$(
Selectors.CreateCollectionCappedSizeInput
await browser.setValueVisible(
Selectors.CreateCollectionCappedSizeInput,
collectionOptions.capped.size.toString()
);
await sizeElement.waitForDisplayed();
await sizeElement.setValue(collectionOptions.capped.size.toString());
}

if (collectionOptions && collectionOptions.customCollation) {
Expand Down Expand Up @@ -101,18 +100,16 @@ export async function addCollection(
Selectors.CreateCollectionTimeseriesCheckboxLabel
);

const timeField = await browser.$(
Selectors.CreateCollectionTimeseriesTimeField
await browser.setValueVisible(
Selectors.CreateCollectionTimeseriesTimeField,
collectionOptions.timeseries.timeField
);
await timeField.waitForDisplayed();
await timeField.setValue(collectionOptions.timeseries.timeField);

if (collectionOptions.timeseries.metaField) {
const metaField = await browser.$(
Selectors.CreateCollectionTimeseriesMetaField
await browser.setValueVisible(
Selectors.CreateCollectionTimeseriesMetaField,
collectionOptions.timeseries.metaField
);
await metaField.waitForDisplayed();
await metaField.setValue(collectionOptions.timeseries.metaField);
}

if (collectionOptions.timeseries.granularity) {
Expand All @@ -131,31 +128,22 @@ export async function addCollection(
}

if (collectionOptions.timeseries.bucketMaxSpanSeconds) {
const bucketMaxSpanSecondsField = await browser.$(
Selectors.CreateCollectionTimeseriesBucketMaxSpanSeconds
);
await bucketMaxSpanSecondsField.waitForDisplayed();
await bucketMaxSpanSecondsField.setValue(
await browser.setValueVisible(
Selectors.CreateCollectionTimeseriesBucketMaxSpanSeconds,
collectionOptions.timeseries.bucketMaxSpanSeconds.toString()
);
}

if (collectionOptions.timeseries.bucketRoundingSeconds) {
const bucketMaxRoundingSecondsField = await browser.$(
Selectors.CreateCollectionTimeseriesBucketRoundingSeconds
);
await bucketMaxRoundingSecondsField.waitForDisplayed();
await bucketMaxRoundingSecondsField.setValue(
await browser.setValueVisible(
Selectors.CreateCollectionTimeseriesBucketRoundingSeconds,
collectionOptions.timeseries.bucketRoundingSeconds.toString()
);
}

if (collectionOptions.timeseries.expireAfterSeconds) {
const expireField = await browser.$(
Selectors.CreateCollectionTimeseriesExpireAfterSeconds
);
await expireField.waitForDisplayed();
await expireField.setValue(
await browser.setValueVisible(
Selectors.CreateCollectionTimeseriesExpireAfterSeconds,
collectionOptions.timeseries.expireAfterSeconds.toString()
);
}
Expand All @@ -166,17 +154,13 @@ export async function addCollection(
Selectors.CreateCollectionClusteredCheckboxLabel
);

const nameField = await browser.$(
Selectors.CreateCollectionClusteredNameField
await browser.setValueVisible(
Selectors.CreateCollectionClusteredNameField,
collectionOptions.clustered.name
);
await nameField.waitForDisplayed();
await nameField.setValue(collectionOptions.clustered.name);

const expireField = await browser.$(
Selectors.CreateCollectionClusteredExpireAfterSeconds
);
await expireField.waitForDisplayed();
await expireField.setValue(
await browser.setValueVisible(
Selectors.CreateCollectionClusteredExpireAfterSeconds,
collectionOptions.clustered.expireAfterSeconds.toString()
);
}
Expand Down
9 changes: 4 additions & 5 deletions packages/compass-e2e-tests/helpers/commands/add-database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ export async function addDatabase(
): Promise<void> {
const createModalElement = await browser.$(Selectors.CreateDatabaseModal);
await createModalElement.waitForDisplayed();
const dbInput = await browser.$(Selectors.CreateDatabaseDatabaseName);
await dbInput.setValue(dbName);
const collectionInput = await browser.$(
Selectors.CreateDatabaseCollectionName
await browser.setValueVisible(Selectors.CreateDatabaseDatabaseName, dbName);
await browser.setValueVisible(
Selectors.CreateDatabaseCollectionName,
collectionName
);
await collectionInput.setValue(collectionName);
const createButton = await browser.$(Selectors.CreateDatabaseCreateButton);
await createButton.waitForEnabled();

Expand Down
11 changes: 7 additions & 4 deletions packages/compass-e2e-tests/helpers/commands/click-visible.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CompassBrowser } from '../compass-browser';
import type { ChainablePromiseElement, Element } from 'webdriverio';
import type { ChainablePromiseElement } from 'webdriverio';

interface ClickOptions {
scroll?: boolean;
Expand All @@ -8,11 +8,14 @@ interface ClickOptions {

export async function clickVisible(
browser: CompassBrowser,
selector: string | ChainablePromiseElement<Promise<Element<'async'>>>,
selector:
| string
| ChainablePromiseElement<WebdriverIO.Element>
| WebdriverIO.Element,
options?: ClickOptions
): Promise<void> {
function getElement() {
return typeof selector === 'string' ? browser.$(selector) : selector;
async function getElement() {
return typeof selector === 'string' ? await browser.$(selector) : selector;
}

const displayElement = await getElement();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ async function navigateToCollection(

// search for the collection and wait for the collection to be there and visible
await browser.clickVisible(Selectors.SidebarFilterInput);
const sidebarFilterInputElement = await browser.$(
Selectors.SidebarFilterInput
);
await sidebarFilterInputElement.clearValue();
await sidebarFilterInputElement.setValue(collectionName);
await browser.setValueVisible(Selectors.SidebarFilterInput, collectionName);
const collectionElement = await browser.$(collectionSelector);

await collectionElement.waitForDisplayed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ export async function dropCollectionFromSidebar(
): Promise<void> {
// search for the collecton in the sidebar filter
await browser.clickVisible(Selectors.SidebarFilterInput);
const sidebarFilterInputElement = await browser.$(
Selectors.SidebarFilterInput
);
await sidebarFilterInputElement.setValue(collectionName);
await browser.setValueVisible(Selectors.SidebarFilterInput, collectionName);
const dbElement = await browser.$(Selectors.sidebarDatabase(dbName));
await dbElement.waitForDisplayed();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ export async function dropDatabaseFromSidebar(
): Promise<void> {
// search for the database in the sidebar filter
await browser.clickVisible(Selectors.SidebarFilterInput);
const sidebarFilterInputElement = await browser.$(
Selectors.SidebarFilterInput
);
await sidebarFilterInputElement.setValue(dbName);
await browser.setValueVisible(Selectors.SidebarFilterInput, dbName);
await browser.$(Selectors.sidebarDatabase(dbName)).waitForDisplayed();

// open the drop database modal from the sidebar
Expand Down
7 changes: 3 additions & 4 deletions packages/compass-e2e-tests/helpers/commands/drop-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ export async function dropIndex(
const dropModal = await browser.$(Selectors.DropIndexModal);
await dropModal.waitForDisplayed();

const confirmInput = await browser.$(
Selectors.DropIndexModalConfirmNameInput
await browser.setValueVisible(
Selectors.DropIndexModalConfirmNameInput,
indexName
);
await confirmInput.waitForDisplayed();
await confirmInput.setValue(indexName);

if (screenshotName) {
await browser.screenshot(screenshotName);
Expand Down
6 changes: 4 additions & 2 deletions packages/compass-e2e-tests/helpers/commands/drop-namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export async function dropNamespace(
): Promise<void> {
const dropModalElement = await browser.$(Selectors.DropNamespaceModal);
await dropModalElement.waitForDisplayed();
const confirmInput = await browser.$(Selectors.DropNamespaceConfirmNameInput);
await confirmInput.setValue(collectionName);
await browser.setValueVisible(
Selectors.DropNamespaceConfirmNameInput,
collectionName
);
const confirmButton = await browser.$(Selectors.DropNamespaceDropButton);
await confirmButton.waitForEnabled();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ export async function exportToLanguage(
await exportModal.waitForDisplayed({ reverse: true });

// normalize copied text so that it's the same for all platforms
return text.replace(/\r\n/g, '\n');
return text.replace(/\r\n/g, '\n').replace(/\n+/g, '\n');
}
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,8 @@ async function getMultipleValues(
browser: CompassBrowser,
selector: string
): Promise<string[] | null> {
const elements = await browser.$$(selector);
const results = (
await Promise.all(
elements.map((element) => {
return element.getValue();
})
)
await browser.$$(selector).map((element) => element.getValue())
).filter((result) => result !== '');

return results.length ? results : null;
Expand Down
1 change: 0 additions & 1 deletion packages/compass-e2e-tests/helpers/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export * from './select-stage-operator';
export * from './close-workspace-tabs';
export * from './set-validation';
export * from './wait-for-animations';
export * from './set-or-clear-value';
export * from './listen-for-telemetry-events';
export * from './select-file';
export * from './do-connect';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ export async function navigateToInstanceTab(
browser: CompassBrowser,
tabName: 'My Queries' | 'Performance' | 'Databases' = 'My Queries'
): Promise<void> {
const sidebarNavigationItem = browser.$(
Selectors.sidebarInstanceNavigationItem(tabName)
);
await browser.clickVisible(sidebarNavigationItem);
const itemSelector = Selectors.sidebarInstanceNavigationItem(tabName);
await browser.clickVisible(itemSelector);
await waitUntilActiveInstanceTab(browser, tabName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async function setMaxTimeMS(
) {
const selector = Selectors.queryBarOptionInputMaxTimeMS(tabName);
await browser.clickVisible(selector);
await browser.setOrClearValue(selector, value);
await browser.setValueVisible(selector, value);
}

async function setSkip(
Expand All @@ -62,7 +62,7 @@ async function setSkip(
) {
const selector = Selectors.queryBarOptionInputSkip(tabName);
await browser.clickVisible(selector);
await browser.setOrClearValue(selector, value);
await browser.setValueVisible(selector, value);
}

export async function setLimit(
Expand All @@ -72,7 +72,7 @@ export async function setLimit(
) {
const selector = Selectors.queryBarOptionInputLimit(tabName);
await browser.clickVisible(selector);
await browser.setOrClearValue(selector, value);
await browser.setValueVisible(selector, value);
}

async function isOptionsExpanded(browser: CompassBrowser, tabName: string) {
Expand Down
Loading

0 comments on commit d0dbf35

Please sign in to comment.