Skip to content

Commit 8e2e372

Browse files
committed
Merge remote-tracking branch 'origin/main' into 1.32-releases
2 parents 7b74efd + a3b548e commit 8e2e372

File tree

34 files changed

+1486
-6950
lines changed

34 files changed

+1486
-6950
lines changed

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

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,44 @@ jobs:
1313
name: Update automatically generated files
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v1
16+
- uses: actions/checkout@v3
17+
with:
18+
# don't checkout a detatched HEAD
19+
ref: ${{ github.head_ref }}
20+
21+
# this is important so git log can pick up on
22+
# the whole history to generate the list of AUTHORS
23+
fetch-depth: '0'
24+
25+
1726
- uses: actions/setup-node@v2
1827
with:
1928
node-version: ^14.17.5
2029
cache: 'npm'
2130

22-
- name: Install Deps Ubuntu
23-
run: sudo apt-get -y install libkrb5-dev libsecret-1-dev net-tools libstdc++6 gnome-keyring
24-
2531
- name: Install [email protected]
2632
run: |
2733
npm install -g [email protected]
2834
29-
- name: Run node-gyp bug workaround script
30-
run: |
31-
bash .evergreen/node-gyp-bug-workaround.sh
32-
3335
- name: Install Dependencies
3436
run: |
3537
npm -v
3638
npm ci
3739
38-
- name: Set up Git
39-
run: |
40-
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
41-
git config --local user.name "github-actions[bot]"
40+
- name: Update AUTHORS
41+
run: npm run update-authors
4242

4343
- name: Update THIRD-PARTY-NOTICES.md
4444
run: npm run update-third-party-notices
4545

46-
- name: Commit THIRD-PARTY-NOTICES changes
47-
run: |
48-
git add THIRD-PARTY-NOTICES.md
49-
git commit --no-allow-empty -m "chore: update THIRD-PARTY-NOTICES" THIRD-PARTY-NOTICES.md || true
50-
51-
- name: Update AUTHORS
52-
run: npm run update-authors
53-
- name: Commit AUTHORS changes
54-
run: |
55-
git add AUTHORS
56-
git commit --no-allow-empty -m "chore: update AUTHORS" AUTHORS || true
57-
- name: Push updates
58-
uses: ad-m/[email protected]
46+
- name: Create Pull Request
47+
uses: peter-evans/create-pull-request@v4
5948
with:
60-
github_token: ${{ secrets.GITHUB_TOKEN }}
61-
branch: main
49+
commit-message: Update report
50+
branch: ci/update-3rd-party-notices-and-authors
51+
title: 'chore: update AUTHORS and THIRD-PARTY-NOTICES'
52+
add-paths: |
53+
THIRD-PARTY-NOTICES.md
54+
AUTHORS
55+
body: |
56+
- Update `AUTHORS` and `THIRD-PARTY-NOTICES`

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Maurizio Casimirri <[email protected]> [email protected] <maurizio.cas
2929
Maurizio Casimirri <[email protected]> mcasimir <[email protected]>
3030
Michael Rose <[email protected]> rosem <[email protected]>
3131
Paul Thurlow <[email protected]> Paul Thurlow <[email protected]>
32+
Preston Vasquez <[email protected]> Preston Vasquez <[email protected]>
3233
Rhys Howell <rhys@[email protected]> Anemy <rhys@[email protected]>
3334
Rhys Howell <rhys@[email protected]> Rhys <[email protected]>
3435
Rhys Howell <rhys@[email protected]> Rhys Howell <[email protected]>

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ Leonardo Rossi <[email protected]>
6161
Neil Shweky <[email protected]>
6262
Rohan Antony <[email protected]>
6363
64+
Abraham Egnor <[email protected]>
65+
Preston Vasquez <[email protected]>

THIRD-PARTY-NOTICES.md

Lines changed: 658 additions & 6704 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/collection-model/lib/collection-properties.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,44 @@ function getProperties(coll) {
1111

1212
if (coll.collation) {
1313
properties.push({
14-
name: PROPERTIES_COLLATION,
14+
id: PROPERTIES_COLLATION,
1515
options: coll.collation,
1616
});
1717
}
1818

1919
if (coll.type === 'timeseries') {
2020
properties.push({
21-
name: PROPERTIES_TIME_SERIES,
21+
id: PROPERTIES_TIME_SERIES,
2222
});
2323
}
2424

2525
if (coll.type === 'view') {
2626
properties.push({
27-
name: PROPERTIES_VIEW,
27+
id: PROPERTIES_VIEW,
2828
});
2929
}
3030

3131
if (coll.capped) {
3232
properties.push({
33-
name: PROPERTIES_CAPPED,
33+
id: PROPERTIES_CAPPED,
3434
});
3535
}
3636

3737
if (coll.clustered) {
3838
properties.push({
39-
name: PROPERTIES_CLUSTERED,
39+
id: PROPERTIES_CLUSTERED,
4040
});
4141
}
4242

4343
if (coll.readonly) {
4444
properties.push({
45-
name: PROPERTIES_READ_ONLY,
45+
id: PROPERTIES_READ_ONLY,
4646
});
4747
}
4848

4949
if (coll.fle2) {
5050
properties.push({
51-
name: PROPERTIES_FLE2,
51+
id: PROPERTIES_FLE2,
5252
});
5353
}
5454

packages/compass-aggregations/src/components/pipeline-explain/explain-query-performance.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const statsStyles = css({
2525
const statItemStyles = css({
2626
display: 'flex',
2727
gap: spacing[1],
28+
alignItems: 'baseline',
2829
});
2930

3031
const statTitleStyles = css({

packages/compass-aggregations/src/components/pipeline-explain/explain-results.tsx

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { css, spacing, Card } from '@mongodb-js/compass-components';
2+
import { css, cx, spacing, Card } from '@mongodb-js/compass-components';
33
import { Document } from '@mongodb-js/compass-crud';
44
import HadronDocument from 'hadron-document';
55

@@ -12,15 +12,32 @@ type ExplainResultsProps = {
1212
};
1313

1414
const containerStyles = css({
15-
display: 'flex',
16-
flexDirection: 'column',
1715
gap: spacing[4],
16+
display: 'grid',
17+
gridTemplateRows: 'auto 1fr',
18+
height: '100%',
19+
});
20+
21+
const withStatsGrid = css({
22+
gridTemplateAreas: `
23+
'stats'
24+
'card'
25+
`,
26+
});
27+
28+
const withoutStatsGrid = css({
29+
gridTemplateAreas: `
30+
'card'
31+
`,
32+
});
33+
34+
const statsStyles = css({
35+
gridArea: 'stats',
1836
});
1937

2038
const cardStyles = css({
21-
// 170px works with minimum-height of compass
22-
// todo: handle height for bigger sized compass
23-
height: '170px',
39+
gridArea: 'card',
40+
maxHeight: '50vh',
2441
overflowY: 'scroll',
2542
});
2643

@@ -29,13 +46,18 @@ export const ExplainResults: React.FunctionComponent<ExplainResultsProps> = ({
2946
stats,
3047
}) => {
3148
return (
32-
<div className={containerStyles} data-testid="pipeline-explain-results">
49+
<div
50+
className={cx(stats ? withStatsGrid : withoutStatsGrid, containerStyles)}
51+
data-testid="pipeline-explain-results"
52+
>
3353
{stats && (
34-
<ExplainQueryPerformance
35-
nReturned={stats.nReturned}
36-
executionTimeMillis={stats.executionTimeMillis}
37-
usedIndexes={stats.usedIndexes}
38-
/>
54+
<div className={statsStyles}>
55+
<ExplainQueryPerformance
56+
nReturned={stats.nReturned}
57+
executionTimeMillis={stats.executionTimeMillis}
58+
usedIndexes={stats.usedIndexes}
59+
/>
60+
</div>
3961
)}
4062
<Card className={cardStyles} data-testid="pipeline-explain-results-json">
4163
<Document

packages/compass-aggregations/src/components/pipeline-explain/index.tsx

Lines changed: 76 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import React from 'react';
1+
import React, { useEffect, useState } from 'react';
22
import {
33
css,
4+
cx,
45
spacing,
56
Modal,
67
CancelLoader,
78
H3,
89
ModalFooter,
910
Button,
1011
ErrorSummary,
12+
breakpoints,
1113
} from '@mongodb-js/compass-components';
1214
import { connect } from 'react-redux';
1315

@@ -25,16 +27,51 @@ type PipelineExplainProps = {
2527
onCancelExplain: () => void;
2628
};
2729

30+
const modalStyles = css({
31+
display: 'grid',
32+
gap: spacing[3],
33+
gridTemplateRows: 'auto 1fr auto',
34+
});
35+
36+
const gridWithFooter = css({
37+
gridTemplateAreas: `
38+
'header'
39+
'content'
40+
'footer'
41+
`,
42+
});
43+
44+
const gridWithoutFooter = css({
45+
gridTemplateAreas: `
46+
'header'
47+
'content'
48+
`,
49+
});
50+
51+
const headerStyles = css({
52+
gridArea: 'header',
53+
});
54+
2855
const contentStyles = css({
29-
marginTop: spacing[3],
30-
marginBottom: spacing[3],
56+
gridArea: 'content',
3157
});
3258

3359
const footerStyles = css({
60+
gridArea: 'footer',
3461
paddingRight: 0,
3562
paddingBottom: 0,
3663
});
3764

65+
const loadingStyles = css({
66+
display: 'flex',
67+
justifyContent: 'center',
68+
height: '100%',
69+
});
70+
71+
const getModalSize = (): 'default' | 'large' => {
72+
return window.innerWidth <= breakpoints.XLDesktop ? 'default' : 'large';
73+
};
74+
3875
export const PipelineExplain: React.FunctionComponent<PipelineExplainProps> = ({
3976
isModalOpen,
4077
isLoading,
@@ -43,15 +80,39 @@ export const PipelineExplain: React.FunctionComponent<PipelineExplainProps> = ({
4380
onCloseModal,
4481
onCancelExplain,
4582
}) => {
83+
const [modalSize, setModalSize] = useState(getModalSize());
84+
useEffect(() => {
85+
if (!isModalOpen) {
86+
return;
87+
}
88+
const resizeListener = () => {
89+
setModalSize(getModalSize());
90+
};
91+
window.addEventListener('resize', resizeListener);
92+
return () => {
93+
window.removeEventListener('resize', resizeListener);
94+
};
95+
}, [isModalOpen]);
96+
97+
// The resize listener is only added when the modal is open.
98+
// As the modal closes, the state persists the last value.
99+
// If the user changes window size while the modal is closed,
100+
// upon next open it uses the last known value. So we reset it here.
101+
useEffect(() => {
102+
setModalSize(getModalSize());
103+
}, [isModalOpen]);
104+
46105
let content = null;
47106
if (isLoading) {
48107
content = (
49-
<CancelLoader
50-
data-testid="pipeline-explain-cancel"
51-
cancelText="Cancel"
52-
onCancel={() => onCancelExplain()}
53-
progressText="Running explain"
54-
/>
108+
<div className={loadingStyles}>
109+
<CancelLoader
110+
data-testid="pipeline-explain-cancel"
111+
cancelText="Cancel"
112+
onCancel={() => onCancelExplain()}
113+
progressText="Running explain"
114+
/>
115+
</div>
55116
);
56117
} else if (error) {
57118
content = (
@@ -67,11 +128,16 @@ export const PipelineExplain: React.FunctionComponent<PipelineExplainProps> = ({
67128

68129
return (
69130
<Modal
131+
size={modalSize}
70132
setOpen={onCloseModal}
71133
open={isModalOpen}
72134
data-testid="pipeline-explain-modal"
135+
contentClassName={cx(
136+
isLoading ? gridWithoutFooter : gridWithFooter,
137+
modalStyles
138+
)}
73139
>
74-
<H3>Explain</H3>
140+
<H3 className={headerStyles}>Explain Plan</H3>
75141
<div className={contentStyles}>{content}</div>
76142
{!isLoading && (
77143
<ModalFooter className={footerStyles}>

0 commit comments

Comments
 (0)