Skip to content

Commit b5486be

Browse files
authored
Merge branch 'main' into flakes-fix
2 parents e0ffd57 + ea4869a commit b5486be

File tree

13 files changed

+185
-94
lines changed

13 files changed

+185
-94
lines changed

.evergreen/create-sbom.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ trap_handler() {
1818
}
1919
trap trap_handler ERR EXIT
2020

21-
scp -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -P "$SIGNING_SERVER_PORT" .sbom/dependencies.json /tmp/silkbomb.env /tmp/artifactory_password "$SIGNING_SERVER_USERNAME"@"$SIGNING_SERVER_HOSTNAME":/tmp/
22-
ssh -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -p "$SIGNING_SERVER_PORT" "$SIGNING_SERVER_USERNAME"@"$SIGNING_SERVER_HOSTNAME" \
21+
scp -v -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -P "$SIGNING_SERVER_PORT" .sbom/dependencies.json /tmp/silkbomb.env /tmp/artifactory_password "$SIGNING_SERVER_USERNAME"@"$SIGNING_SERVER_HOSTNAME":/tmp/
22+
ssh -v -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -p "$SIGNING_SERVER_PORT" "$SIGNING_SERVER_USERNAME"@"$SIGNING_SERVER_HOSTNAME" \
2323
"(cat /tmp/dependencies.json | jq -r '.[] | "'"pkg:npm/" + .name + "@" + .version'"' > /tmp/purls.txt) && \
2424
echo "pkg:generic/mongo_crypt_shared@${CRYPT_SHARED_VERSION}" >> /tmp/purls.txt && \
2525
(cat /tmp/artifactory_password | docker login artifactory.corp.mongodb.com --username '${ARTIFACTORY_USERNAME}' --password-stdin ; rm -f /tmp/artifactor_password ) && \
@@ -30,4 +30,4 @@ ssh -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -p "$SIGNING_SERVER_PORT" "$SIGNING
3030
--silk-asset-group "${SILK_ASSET_GROUP}" --sbom-in /tmp/sbom-lite.json && \
3131
docker run --env-file /tmp/silkbomb.env --rm -v /tmp:/tmp artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 download \
3232
--silk-asset-group "${SILK_ASSET_GROUP}" --sbom-out /tmp/sbom.json"
33-
scp -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -P "$SIGNING_SERVER_PORT" "$SIGNING_SERVER_USERNAME"@"$SIGNING_SERVER_HOSTNAME":/tmp/{sbom-lite.json,sbom.json,purls.txt} .sbom/
33+
scp -v -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -P "$SIGNING_SERVER_PORT" "$SIGNING_SERVER_USERNAME"@"$SIGNING_SERVER_HOSTNAME":/tmp/{sbom-lite.json,sbom.json,purls.txt} .sbom/

.github/workflows/authors-and-third-party-notices.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ jobs:
6868
6969
- name: Commit and push
7070
run: |
71-
git commit --no-allow-empty -m "chore: update AUTHORS, THIRD-PARTY-NOTICES, Security Test Summary [skip actions]" || true
71+
git commit --no-allow-empty -m "chore: update AUTHORS, THIRD-PARTY-NOTICES, Security Test Summary" || true
7272
git push

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
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 Jan 14 2025.
2+
This document was automatically generated on Wed Jan 15 2025.
33

44
## List of dependencies
55

docs/tracking-plan.md

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

22
# Compass Tracking Plan
33

4-
Generated on Tue, Jan 14, 2025 at 12:47 PM
4+
Generated on Wed, Jan 15, 2025
55

66
## Table of Contents
77

packages/compass-e2e-tests/helpers/compass.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -949,18 +949,20 @@ async function getCompassBuildMetadata(): Promise<BinPathOptions> {
949949
}
950950

951951
export async function buildCompass(
952-
force = false,
953952
compassPath = COMPASS_DESKTOP_PATH
954953
): Promise<void> {
955-
if (!force) {
956-
try {
957-
await getCompassBuildMetadata();
958-
return;
959-
} catch (e) {
960-
// No compass build found, let's build it
961-
}
954+
try {
955+
await getCompassBuildMetadata();
956+
return;
957+
} catch (e) {
958+
/* ignore */
959+
}
960+
961+
if (process.env.COMPASS_APP_PATH && process.env.COMPASS_APP_NAME) {
962+
throw new Error('We did not expect to have to build Compass');
962963
}
963964

965+
debug("No Compass build found, let's build it");
964966
await packageCompassAsync({
965967
dir: compassPath,
966968
skip_installer: true,

packages/compass-e2e-tests/helpers/test-runner-global-fixtures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export async function mochaGlobalSetup(this: Mocha.Runner) {
139139

140140
if (isTestingDesktop(context)) {
141141
if (context.testPackagedApp) {
142-
debug('Building Compass before running the tests ...');
142+
debug('Maybe building Compass before running the tests ...');
143143
await buildCompass();
144144
} else {
145145
debug('Preparing Compass before running the tests');

packages/compass-e2e-tests/smoke-test.ts

Lines changed: 63 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,47 @@ import {
1919
assertCommonBuildInfo,
2020
} from './helpers/buildinfo';
2121

22+
const SUPPORTED_PLATFORMS = ['win32', 'darwin', 'linux'] as const;
23+
const SUPPORTED_ARCHS = ['x64', 'arm64'] as const;
24+
25+
function isSupportedPlatform(
26+
value: unknown
27+
): value is typeof SUPPORTED_PLATFORMS[number] {
28+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
29+
return SUPPORTED_PLATFORMS.includes(value as any);
30+
}
31+
32+
function isSupportedArch(
33+
value: unknown
34+
): value is typeof SUPPORTED_ARCHS[number] {
35+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
36+
return SUPPORTED_ARCHS.includes(value as any);
37+
}
38+
39+
function getDefaultPlatform() {
40+
const {
41+
platform,
42+
env: { PLATFORM },
43+
} = process;
44+
if (isSupportedPlatform(PLATFORM)) {
45+
return PLATFORM;
46+
} else if (isSupportedPlatform(platform)) {
47+
return platform;
48+
}
49+
}
50+
51+
function getDefaultArch() {
52+
const {
53+
arch,
54+
env: { ARCH },
55+
} = process;
56+
if (isSupportedArch(ARCH)) {
57+
return ARCH;
58+
} else if (isSupportedArch(arch)) {
59+
return arch;
60+
}
61+
}
62+
2263
const argv = yargs(hideBin(process.argv))
2364
.scriptName('smoke-tests')
2465
.detectLocale(false)
@@ -32,26 +73,15 @@ const argv = yargs(hideBin(process.argv))
3273
type: 'string',
3374
default: process.env.EVERGREEN_BUCKET_KEY_PREFIX,
3475
})
35-
.option('version', {
36-
type: 'string',
37-
// For dev versions we need this from evergreen. For beta or stable (or by
38-
// default, ie. when testing a locally packaged app) we get it from the
39-
// package.json
40-
default: process.env.DEV_VERSION_IDENTIFIER,
41-
description:
42-
'Will be read from packages/compass/package.json if not specified',
43-
})
4476
.option('platform', {
45-
type: 'string',
46-
choices: ['win32', 'darwin', 'linux'],
77+
choices: SUPPORTED_PLATFORMS,
4778
demandOption: true,
48-
default: process.env.PLATFORM ?? process.platform,
79+
default: getDefaultPlatform(),
4980
})
5081
.option('arch', {
51-
type: 'string',
52-
choices: ['x64', 'arm64'],
82+
choices: SUPPORTED_ARCHS,
5383
demandOption: true,
54-
default: process.env.ARCH ?? process.arch,
84+
default: getDefaultArch(),
5585
})
5686
.option('package', {
5787
type: 'string',
@@ -65,7 +95,7 @@ const argv = yargs(hideBin(process.argv))
6595
'linux_tar',
6696
'linux_rpm',
6797
'rhel_tar',
68-
],
98+
] as const,
6999
demandOption: true,
70100
description: 'Which package to test',
71101
})
@@ -88,7 +118,6 @@ const argv = yargs(hideBin(process.argv))
88118
type SmokeTestsContext = {
89119
bucketName?: string;
90120
bucketKeyPrefix?: string;
91-
version?: string;
92121
platform: 'win32' | 'darwin' | 'linux';
93122
arch: 'x64' | 'arm64';
94123
package:
@@ -112,48 +141,49 @@ async function readJson<T extends object>(...segments: string[]): Promise<T> {
112141
return result as T;
113142
}
114143

115-
async function readPackageVersion(packagePath: string) {
116-
const pkg = await readJson(packagePath, 'package.json');
117-
assert(
118-
'version' in pkg && typeof pkg.version === 'string',
119-
'Expected a package version'
120-
);
121-
return pkg.version;
122-
}
123-
124144
async function run() {
125-
const parsedArgs = argv.parseSync();
126-
127-
const context = parsedArgs as SmokeTestsContext;
145+
const context: SmokeTestsContext = argv.parseSync();
128146

129147
console.log(
130148
'context',
131149
pick(context, [
132150
'skipDownload',
133151
'bucketName',
134152
'bucketKeyPrefix',
135-
'version',
136153
'platform',
137154
'arch',
138155
'package',
139156
])
140157
);
141158

142159
const compassDir = path.resolve(__dirname, '..', '..', 'packages', 'compass');
143-
// use the specified DEV_VERSION_IDENTIFIER if set or load version from packages/compass/package.json
144-
const version = context.version ?? (await readPackageVersion(compassDir));
145160
const outPath = path.resolve(__dirname, 'hadron-build-info.json');
146161

147162
// build-info
148163
const infoArgs = {
149164
format: 'json',
150165
dir: compassDir,
151-
version,
152166
platform: context.platform,
153167
arch: context.arch,
154168
out: outPath,
155169
};
156170
console.log('infoArgs', infoArgs);
171+
172+
// These are known environment variables that will affect the way
173+
// writeBuildInfo works. Log them as a reminder and for our own sanity
174+
console.log(
175+
'info env vars',
176+
pick(process.env, [
177+
'HADRON_DISTRIBUTION',
178+
'HADRON_APP_VERSION',
179+
'HADRON_PRODUCT',
180+
'HADRON_PRODUCT_NAME',
181+
'HADRON_READONLY',
182+
'HADRON_ISOLATED',
183+
'DEV_VERSION_IDENTIFIER',
184+
'IS_RHEL',
185+
])
186+
);
157187
writeBuildInfo(infoArgs);
158188
const buildInfo = await readJson(infoArgs.out);
159189

packages/compass-e2e-tests/tests/time-to-first-query.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ describe('Time to first query', function () {
2727
});
2828

2929
it('can open compass, connect to a database and run a query on a collection (never seen welcome)', async function () {
30-
// Starting the application with the webdriver.io fails on the first run
31-
// sometimes due to devtools / selenium server failing to start in time.
32-
// While the root cause is unknown, it usually passes just fine on a re-run
33-
// or next application start, so we are just retrying the test here to
34-
// work around the flake.
35-
//
36-
// We re-run the whole test to make sure that the timings for the test run
37-
// are not skewed by waiting for the application to restart multiple times.
38-
this.retries(5);
39-
4030
// start compass inside the test so that the time is measured together
4131
compass = await init(this.test?.fullTitle(), { firstRun: true });
4232

packages/compass-sidebar/src/components/multiple-connections/connections-navigation.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import toNS from 'mongodb-ns';
2-
import React, { useCallback, useEffect, useMemo } from 'react';
2+
import React, {
3+
createContext,
4+
useCallback,
5+
useContext,
6+
useEffect,
7+
useMemo,
8+
} from 'react';
39
import { connect } from 'react-redux';
410
import {
511
ChevronCollapse,
@@ -91,6 +97,12 @@ const noDeploymentStyles = css({
9197
gap: spacing[200],
9298
});
9399

100+
/**
101+
* Indicates only Atlas cluster connections are supported, and the user cannot navigate
102+
* to other types of connections from this UI.
103+
*/
104+
export const AtlasClusterConnectionsOnly = createContext<boolean>(false);
105+
94106
function findCollection(ns: string, databases: Database[]) {
95107
const { database, collection } = toNS(ns);
96108

@@ -477,14 +489,16 @@ const ConnectionsNavigation: React.FC<ConnectionsNavigationProps> = ({
477489
}
478490
}, [activeWorkspace, onDatabaseToggle, onConnectionToggle]);
479491

492+
const isAtlasConnectionStorage = useContext(AtlasClusterConnectionsOnly);
493+
480494
return (
481495
<div className={connectionsContainerStyles}>
482496
<div
483497
className={connectionListHeaderStyles}
484498
data-testid="connections-header"
485499
>
486500
<Subtitle className={connectionListHeaderTitleStyles}>
487-
Connections
501+
{isAtlasConnectionStorage ? 'Clusters' : 'Connections'}
488502
{connections.length !== 0 && (
489503
<span className={connectionCountStyles}>
490504
({connections.length})
@@ -503,7 +517,11 @@ const ConnectionsNavigation: React.FC<ConnectionsNavigationProps> = ({
503517
{connections.length > 0 && (
504518
<>
505519
<NavigationItemsFilter
506-
placeholder="Search connections"
520+
placeholder={
521+
isAtlasConnectionStorage
522+
? 'Search clusters'
523+
: 'Search connections'
524+
}
507525
filter={filter}
508526
onFilterChange={onFilterChange}
509527
/>

0 commit comments

Comments
 (0)