Skip to content

Commit fbe0b31

Browse files
committed
Merge branch 'main' into 1.32-releases
2 parents b1c7d2b + 3e93295 commit fbe0b31

File tree

101 files changed

+2080
-309
lines changed

Some content is hidden

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

101 files changed

+2080
-309
lines changed

.evergreen/buildvariants.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ buildvariants:
6464
- name: test-packaged-app-44x-enterprise
6565
- name: test-packaged-app-5x-community
6666
- name: test-packaged-app-5x-enterprise
67+
- name: test-packaged-app-60x-enterprise
6768

6869
- name: ubuntu
6970
display_name: Ubuntu (Test and Package)
@@ -100,3 +101,4 @@ buildvariants:
100101
- name: test-packaged-app-44x-enterprise
101102
- name: test-packaged-app-5x-community
102103
- name: test-packaged-app-5x-enterprise
104+
- name: test-packaged-app-60x-enterprise

.evergreen/functions.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ functions:
200200
# debugging any issues with tests. Set to "mocha*", "hadron*", or
201201
# "mongo*" for some helpful output from the test tooling we are using
202202
DEBUG=${debug} \
203-
MONGODB_VERSION=${mongodb_version|4.4.x} \
204-
MONGODB_USE_ENTERPRISE=${mongodb_use_enterprise|} \
203+
MONGODB_VERSION="${mongodb_version|4.4.x}" \
204+
MONGODB_USE_ENTERPRISE="${mongodb_use_enterprise|}" \
205205
npm run --unsafe-perm test-ci -- --stream --ignore="$IGNORE_TESTS"
206206
207207
test-electron:
@@ -225,8 +225,8 @@ functions:
225225
npm run --unsafe-perm electron-rebuild
226226
227227
DEBUG=${debug} \
228-
MONGODB_VERSION=${mongodb_version|4.4.x} \
229-
MONGODB_USE_ENTERPRISE=${mongodb_use_enterprise|} \
228+
MONGODB_VERSION="${mongodb_version|4.4.x}" \
229+
MONGODB_USE_ENTERPRISE="${mongodb_use_enterprise|}" \
230230
npm run --unsafe-perm test-ci-electron -- --stream
231231
232232
apply-compass-target-expansion:
@@ -335,8 +335,8 @@ functions:
335335
336336
337337
DEBUG=${debug} \
338-
MONGODB_VERSION=${mongodb_version|4.4.x} \
339-
MONGODB_USE_ENTERPRISE=${mongodb_use_enterprise|} \
338+
MONGODB_VERSION="${mongodb_version|4.4.x}" \
339+
MONGODB_USE_ENTERPRISE="${mongodb_use_enterprise|}" \
340340
npm run --unsafe-perm --workspace compass-e2e-tests test-ci
341341
342342
test-packaged-app:
@@ -359,8 +359,8 @@ functions:
359359
echo "Running tests against packaged app at $COMPASS_APP_PATH..."
360360
361361
DEBUG=${debug} \
362-
MONGODB_VERSION=${mongodb_version|4.4.x} \
363-
MONGODB_USE_ENTERPRISE=${mongodb_use_enterprise|} \
362+
MONGODB_VERSION="${mongodb_version|4.4.x}" \
363+
MONGODB_USE_ENTERPRISE="${mongodb_use_enterprise|}" \
364364
npm run --unsafe-perm --workspace compass-e2e-tests test-packaged-ci
365365
366366
test-connectivity:

.evergreen/tasks.in.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ tasks:
295295
compass_distribution: compass
296296
- func: test-packaged-app
297297
vars: <% for (const [key, value] of Object.entries(task['test-packaged-app'].vars)) { %>
298-
<% out(`${key}: ${value}`) } %>
298+
<% out(`${key}: '${value}'`) } %>
299299
compass_distribution: compass
300300
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
301301
<% } %>

.evergreen/tasks.yml

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ tasks:
275275
target_platform: '--platform=darwin'
276276

277277
# copied as test-packaged-app-macos due to depends_on variation
278-
278+
279279

280280
- name: test-packaged-app-40x-community
281281
tags: ['required-for-publish', 'run-on-pr']
@@ -294,11 +294,11 @@ tasks:
294294
vars:
295295
compass_distribution: compass
296296
- func: test-packaged-app
297-
vars:
298-
mongodb_version: 4.0.x
297+
vars:
298+
mongodb_version: '4.0.x'
299299
compass_distribution: compass
300300
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
301-
301+
302302

303303
- name: test-packaged-app-40x-enterprise
304304
tags: ['required-for-publish', 'run-on-pr']
@@ -317,12 +317,12 @@ tasks:
317317
vars:
318318
compass_distribution: compass
319319
- func: test-packaged-app
320-
vars:
321-
mongodb_version: 4.0.x
322-
mongodb_use_enterprise: yes
320+
vars:
321+
mongodb_version: '4.0.x'
322+
mongodb_use_enterprise: 'yes'
323323
compass_distribution: compass
324324
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
325-
325+
326326

327327
- name: test-packaged-app-42x-community
328328
tags: ['required-for-publish', 'run-on-pr']
@@ -341,11 +341,11 @@ tasks:
341341
vars:
342342
compass_distribution: compass
343343
- func: test-packaged-app
344-
vars:
345-
mongodb_version: 4.2.x
344+
vars:
345+
mongodb_version: '4.2.x'
346346
compass_distribution: compass
347347
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
348-
348+
349349

350350
- name: test-packaged-app-42x-enterprise
351351
tags: ['required-for-publish', 'run-on-pr']
@@ -364,12 +364,12 @@ tasks:
364364
vars:
365365
compass_distribution: compass
366366
- func: test-packaged-app
367-
vars:
368-
mongodb_version: 4.2.x
369-
mongodb_use_enterprise: yes
367+
vars:
368+
mongodb_version: '4.2.x'
369+
mongodb_use_enterprise: 'yes'
370370
compass_distribution: compass
371371
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
372-
372+
373373

374374
- name: test-packaged-app-44x-community
375375
tags: ['required-for-publish', 'run-on-pr']
@@ -388,11 +388,11 @@ tasks:
388388
vars:
389389
compass_distribution: compass
390390
- func: test-packaged-app
391-
vars:
392-
mongodb_version: 4.4.x
391+
vars:
392+
mongodb_version: '4.4.x'
393393
compass_distribution: compass
394394
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
395-
395+
396396

397397
- name: test-packaged-app-44x-enterprise
398398
tags: ['required-for-publish', 'run-on-pr']
@@ -411,12 +411,12 @@ tasks:
411411
vars:
412412
compass_distribution: compass
413413
- func: test-packaged-app
414-
vars:
415-
mongodb_version: 4.4.x
416-
mongodb_use_enterprise: yes
414+
vars:
415+
mongodb_version: '4.4.x'
416+
mongodb_use_enterprise: 'yes'
417417
compass_distribution: compass
418418
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
419-
419+
420420

421421
- name: test-packaged-app-5x-community
422422
tags: ['required-for-publish', 'run-on-pr']
@@ -435,11 +435,11 @@ tasks:
435435
vars:
436436
compass_distribution: compass
437437
- func: test-packaged-app
438-
vars:
439-
mongodb_version: 5.x.x
438+
vars:
439+
mongodb_version: '5.x.x'
440440
compass_distribution: compass
441441
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
442-
442+
443443

444444
- name: test-packaged-app-5x-enterprise
445445
tags: ['required-for-publish', 'run-on-pr']
@@ -458,9 +458,33 @@ tasks:
458458
vars:
459459
compass_distribution: compass
460460
- func: test-packaged-app
461-
vars:
462-
mongodb_version: 5.x.x
463-
mongodb_use_enterprise: yes
461+
vars:
462+
mongodb_version: '5.x.x'
463+
mongodb_use_enterprise: 'yes'
464464
compass_distribution: compass
465465
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
466+
466467

468+
- name: test-packaged-app-60x-enterprise
469+
tags: ['required-for-publish', 'run-on-pr']
470+
depends_on:
471+
- name: package
472+
commands:
473+
- func: prepare
474+
- func: install
475+
- func: bootstrap
476+
vars:
477+
scope: 'compass-e2e-tests'
478+
- func: apply-compass-target-expansion
479+
vars:
480+
compass_distribution: compass
481+
- func: get-packaged-app
482+
vars:
483+
compass_distribution: compass
484+
- func: test-packaged-app
485+
vars:
486+
mongodb_version: '>6.0.0-rc0'
487+
mongodb_use_enterprise: 'yes'
488+
compass_distribution: compass
489+
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
490+

.evergreen/template-yml.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ const testPackagedAppVariations = [
100100
mongodb_use_enterprise: 'yes'
101101
}
102102
}
103+
},
104+
{
105+
name: 'test-packaged-app-60x-enterprise',
106+
'test-packaged-app': {
107+
vars: {
108+
mongodb_version: '>6.0.0-rc0',
109+
mongodb_use_enterprise: 'yes'
110+
}
111+
}
103112
}
104113
];
105114

@@ -127,7 +136,10 @@ for (const buildVariant of buildVariants) {
127136
// TODO: The version of ubuntu we're using is not supported by mongodb 5 so
128137
// for now skip mongodb 5 on ubuntu. We'll upgrade (hopefully) soon and then
129138
// we can remove this.
130-
if (task.name.startsWith('test-packaged-app-5x') && buildVariant.name === 'ubuntu') {
139+
if (
140+
(task.name.startsWith('test-packaged-app-5x') || task.name.startsWith('test-packaged-app-60x')) &&
141+
buildVariant.name === 'ubuntu'
142+
) {
131143
continue;
132144
}
133145
buildVariant.tasks.push(task);

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compass-aggregations/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
},
102102
"dependencies": {
103103
"@mongodb-js/compass-logging": "^0.12.0",
104+
"@mongodb-js/explain-plan-helper": "^0.9.0",
104105
"@mongodb-js/mongodb-redux-common": "^1.12.0",
105106
"acorn-loose": "^8.0.2",
106107
"astring": "^1.7.0",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
import { Badge, BadgeVariant, Body } from '@mongodb-js/compass-components';
3+
import type { IndexInformation } from '@mongodb-js/explain-plan-helper';
4+
5+
type ExplainIndexesProps = {
6+
indexes: IndexInformation[];
7+
};
8+
9+
export const ExplainIndexes: React.FunctionComponent<ExplainIndexesProps> = ({
10+
indexes,
11+
}) => {
12+
if (indexes.filter(({ index }) => index).length === 0) {
13+
return <Body weight="medium">No index available for this query.</Body>;
14+
}
15+
16+
return (
17+
<div>
18+
{indexes.map((info, idx) => (
19+
<Badge key={idx} variant={BadgeVariant.LightGray}>
20+
{info.index} {info.shard && <>({info.shard})</>}
21+
</Badge>
22+
))}
23+
</div>
24+
);
25+
};
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import React from 'react';
2+
import { Body, Subtitle, css, spacing } from '@mongodb-js/compass-components';
3+
import type { IndexInformation } from '@mongodb-js/explain-plan-helper';
4+
5+
import { ExplainIndexes } from './explain-indexes';
6+
7+
type ExplainQueryPerformanceProps = {
8+
executionTimeMillis: number;
9+
nReturned: number;
10+
usedIndexes: IndexInformation[];
11+
};
12+
13+
const containerStyles = css({
14+
display: 'flex',
15+
gap: spacing[3],
16+
flexDirection: 'column',
17+
});
18+
19+
const statsStyles = css({
20+
gap: spacing[1],
21+
display: 'flex',
22+
flexDirection: 'column',
23+
});
24+
25+
const statItemStyles = css({
26+
display: 'flex',
27+
gap: spacing[1],
28+
});
29+
30+
const statTitleStyles = css({
31+
whiteSpace: 'nowrap',
32+
});
33+
34+
export const ExplainQueryPerformance: React.FunctionComponent<ExplainQueryPerformanceProps> =
35+
({ nReturned, executionTimeMillis, usedIndexes }) => {
36+
return (
37+
<div
38+
className={containerStyles}
39+
data-testid="pipeline-explain-results-summary"
40+
>
41+
<Subtitle>Query Performance Summary</Subtitle>
42+
<div className={statsStyles}>
43+
{typeof nReturned === 'number' && (
44+
<div className={statItemStyles}>
45+
<Body>Documents returned:</Body>
46+
<Body weight="medium">{nReturned}</Body>
47+
</div>
48+
)}
49+
{executionTimeMillis > 0 && (
50+
<div className={statItemStyles}>
51+
<Body>Actual query execution time(ms):</Body>
52+
<Body weight="medium">{executionTimeMillis}</Body>
53+
</div>
54+
)}
55+
<div className={statItemStyles}>
56+
<Body className={statTitleStyles}>
57+
Query used the following indexes:
58+
</Body>
59+
<ExplainIndexes indexes={usedIndexes} />
60+
</div>
61+
</div>
62+
</div>
63+
);
64+
};

0 commit comments

Comments
 (0)