Skip to content

Commit 71eb134

Browse files
committed
Merge remote-tracking branch 'origin/master' into 1.24-releases
2 parents 9b8ffd4 + dfe29f3 commit 71eb134

Some content is hidden

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

41 files changed

+1247
-12053
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
<!-- Ticket number and a general summary of your changes in the Title above -->
2-
<!-- e.g. COMPASS-1111: updates ace editor width in agg pipeline view -->
1+
<!--
2+
^^^^^
3+
Please fill the title above according to https://www.conventionalcommits.org/en/v1.0.0/.
34
4-
<!--- The following fields are not obligatory. Use your best judgement on what you think is applicable to the work you've done -->
5+
type(scope): message <TICKET-NUMBER>
6+
7+
eg. fix(crud): updates ace editor width in agg pipeline view COMPASS-1111
8+
9+
NOTE: use `feat`, `fix` and `perf` for user facing changes that will be part of
10+
release notes.
11+
-->
512

613
## Description
714
<!--- Describe your changes in detail -->

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ report.json
1515
src/app/compiled-less/
1616
expansions.yml
1717
.nvmrc
18-
.vscode
18+
.vscode
19+
src/app/fonts/akzid*

package-lock.json

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

package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@
221221
]
222222
},
223223
"scripts": {
224+
"install": "node scripts/download-akzidenz.js",
224225
"postinstall": "electron-rebuild --only kerberos,keytar",
225226
"prestart": "rm -rf .compiled-sources",
226227
"start": "hadron-build develop",
@@ -237,7 +238,7 @@
237238
"test-renderer": "npm test -- --renderer",
238239
"test-functional": "npm test -- --functional",
239240
"test-release": "npm test -- --release",
240-
"test-release-tasks": "mocha --timeout 30000 release/*.spec.js",
241+
"test-release-tasks": "cross-env MONGODB_DOWNLOADS_AWS_ACCESS_KEY_ID='' mocha --timeout 30000 release/*.spec.js",
241242
"pretravis": "npm run check",
242243
"travis": "npm test",
243244
"upload": "hadron-build upload",
@@ -249,7 +250,7 @@
249250
"url": "git://github.com/mongodb-js/compass.git"
250251
},
251252
"dependencies": {
252-
"@mongodb-js/compass-aggregations": "^7.1.7",
253+
"@mongodb-js/compass-aggregations": "^7.1.10",
253254
"@mongodb-js/compass-app-stores": "^4.0.2",
254255
"@mongodb-js/compass-auth-kerberos": "^4.0.1",
255256
"@mongodb-js/compass-auth-ldap": "^4.0.1",
@@ -259,7 +260,7 @@
259260
"@mongodb-js/compass-collection-stats": "^5.0.5",
260261
"@mongodb-js/compass-collections-ddl": "^3.0.5",
261262
"@mongodb-js/compass-connect": "^5.4.13",
262-
"@mongodb-js/compass-crud": "^10.0.5",
263+
"@mongodb-js/compass-crud": "^10.1.2",
263264
"@mongodb-js/compass-database": "^1.0.1",
264265
"@mongodb-js/compass-databases-ddl": "^3.0.5",
265266
"@mongodb-js/compass-deployment-awareness": "^10.0.7",
@@ -268,7 +269,7 @@
268269
"@mongodb-js/compass-field-store": "^6.0.3",
269270
"@mongodb-js/compass-find-in-page": "^2.0.4",
270271
"@mongodb-js/compass-home": "^4.2.0",
271-
"@mongodb-js/compass-import-export": "^5.1.21",
272+
"@mongodb-js/compass-import-export": "^5.1.22",
272273
"@mongodb-js/compass-indexes": "^3.0.10",
273274
"@mongodb-js/compass-instance": "^2.0.3",
274275
"@mongodb-js/compass-loading": "^1.0.7",
@@ -280,8 +281,8 @@
280281
"@mongodb-js/compass-schema-validation": "^4.0.5",
281282
"@mongodb-js/compass-server-version": "^4.0.1",
282283
"@mongodb-js/compass-serverstats": "^14.0.0",
283-
"@mongodb-js/compass-shell": "^0.5.0",
284-
"@mongodb-js/compass-sidebar": "^3.2.8",
284+
"@mongodb-js/compass-shell": "^0.5.2",
285+
"@mongodb-js/compass-sidebar": "^3.2.9",
285286
"@mongodb-js/compass-ssh-tunnel-status": "^5.0.1",
286287
"@mongodb-js/compass-status": "^4.0.1",
287288
"ampersand-collection": "^1.5.0",
@@ -319,22 +320,22 @@
319320
"hadron-react-components": "^4.0.5",
320321
"hadron-style-manager": "^0.3.0",
321322
"highlight.js": "^8.9.1",
322-
"jquery": "^2.1.4",
323+
"jquery": "^3.5.0",
323324
"kerberos": "^1.1.3",
324325
"keytar": "^5.1.0",
325326
"less": "^2.6.1",
326327
"local-links": "^1.4.0",
327-
"lodash": "^3.10.1",
328+
"lodash": "^4.17.19",
328329
"marky": "^1.2.0",
329330
"moment": "^2.10.6",
330331
"mongodb": "^3.6.3",
331-
"mongodb-ace-autocompleter": "^0.4.12",
332+
"mongodb-ace-autocompleter": "^0.4.13",
332333
"mongodb-ace-mode": "^0.4.1",
333334
"mongodb-ace-theme": "^0.0.1",
334335
"mongodb-ace-theme-query": "^0.0.2",
335336
"mongodb-collection-model": "^3.1.0",
336-
"mongodb-connection-model": "^17.0.1",
337-
"mongodb-data-service": "^17.0.2",
337+
"mongodb-connection-model": "^17.0.3",
338+
"mongodb-data-service": "^17.0.3",
338339
"mongodb-database-model": "^0.1.3",
339340
"mongodb-explain-plan-model": "^0.2.3",
340341
"mongodb-extended-json": "^1.11.0",
@@ -351,7 +352,7 @@
351352
"numeral": "^1.5.3",
352353
"pluralize": "^1.2.1",
353354
"prop-types": "^15.5.8",
354-
"qs": "^5.2.0",
355+
"qs": "^6.0.4",
355356
"raf": "^3.1.0",
356357
"react": "^16.8.0",
357358
"react-ace": "^6.1.1",
@@ -385,6 +386,7 @@
385386
"cli-ux": "^5.5.0",
386387
"cross-env": "^7.0.0",
387388
"devtron": "^1.4.0",
389+
"download": "^8.0.0",
388390
"electron": "6.1.7",
389391
"electron-rebuild": "^1.10.0",
390392
"enzyme": "^3.11.0",

release/changelog.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
const { cli } = require('cli-ux');
2+
const chalk = require('chalk');
3+
const _ = require('lodash');
4+
const git = require('./git');
5+
const ux = require('./ux');
6+
7+
function capitalize(s) {
8+
if (typeof s !== 'string') return '';
9+
return s.charAt(0).toUpperCase() + s.slice(1);
10+
}
11+
12+
function renderCommit({ scope, message, pr, ticket }) {
13+
let links = [ticket, pr].filter(Boolean).join(', ');
14+
15+
if (links) {
16+
links = ` (${links})`;
17+
}
18+
19+
return `${scope ? `**${scope}**` + ': ' : ''}${capitalize(message)}${links}`;
20+
}
21+
22+
async function render(previousTag, releaseTag) {
23+
cli.info('');
24+
cli.info(`Changes from ${chalk.bold(previousTag)}:`);
25+
26+
const parseCommit = (commit) => {
27+
const PR_RE = /\s+\((#\d+)\)$/;
28+
const pr = (commit.match(PR_RE) || [])[1];
29+
commit = commit.replace(PR_RE, '');
30+
31+
const TICKET_RE_WITH_BRACES = /\s+\((COMPASS-\d+)\)$/;
32+
let ticket = (commit.match(TICKET_RE_WITH_BRACES) || [])[1];
33+
commit = commit.replace(TICKET_RE_WITH_BRACES, '');
34+
35+
const TICKET_RE_WITHOUT_BRACES = /\s+(COMPASS-\d+)$/;
36+
ticket = (commit.match(TICKET_RE_WITHOUT_BRACES) || [])[1];
37+
commit = commit.replace(TICKET_RE_WITHOUT_BRACES, '');
38+
39+
const COMMIT_RE = /^(?<type>feat|fix|perf)(\((?<scope>[^)]*)\))?:\s*(?<message>\S.*)/;
40+
const groups = (commit.match(COMMIT_RE) || []).groups;
41+
if (!groups) {
42+
return;
43+
}
44+
45+
if (groups.scope && groups.scope.match(/COMPASS-\d+/)) {
46+
ticket = groups.scope;
47+
groups.scope = '';
48+
}
49+
50+
groups.message = groups.message.trim();
51+
return {...groups, pr, ticket};
52+
};
53+
54+
const renderLine = (commit) => `- ${renderCommit(commit)}`;
55+
const renderSection = ({ title, commits }) => `## ${title}\n\n${commits.map(renderLine).join('\n')}\n\n`;
56+
57+
const commits = _.uniq(await git.log(previousTag, releaseTag))
58+
.map(parseCommit)
59+
.filter(Boolean); // only conventional commits
60+
61+
const changes = [
62+
{
63+
title: 'Features',
64+
commits: commits.filter(({ type }) => type === 'feat')
65+
},
66+
{
67+
title: 'Bug Fixes',
68+
commits: commits.filter(({ type }) => type === 'fix')
69+
},
70+
{
71+
title: 'Performance Improvements',
72+
commits: commits.filter(({ type }) => type === 'perf')
73+
}
74+
]
75+
.filter((section) => section.commits.length)
76+
.map(renderSection)
77+
.join('\n');
78+
79+
cli.info(
80+
`${changes}You can see the full list of commits here:`,
81+
'\n' + ux.link(`https://github.com/mongodb-js/compass/compare/${previousTag}...${releaseTag}`)
82+
);
83+
}
84+
85+
module.exports = {
86+
render
87+
};
88+

release/commands.js

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable no-console */
2-
const _ = require('lodash');
32
const { cli } = require('cli-ux');
43
const chalk = require('chalk');
54
const pkgUp = require('pkg-up');
@@ -16,6 +15,8 @@ const version = require('./version');
1615

1716
const publishRelease = require('./publish');
1817
const waitForAssets = require('./wait-for-assets');
18+
const ux = require('./ux');
19+
const changelog = require('./changelog');
1920

2021
async function getPackageJsonVersion() {
2122
return require(await pkgUp()).version;
@@ -74,31 +75,30 @@ async function startRelease(bumpFn, evergreenProject) {
7475
return;
7576
}
7677

77-
cli.info('');
7878
cli.info(
79-
chalk.bgYellow(
80-
chalk.gray(
81-
chalk.bold(' MANUAL ACTION REQUIRED!: '))
79+
'\n\n',
80+
ux.manualAction(
81+
`Make sure that ${chalk.bold(evergreenProject)} is building from ${chalk.bold(currentBranch)}:\n`,
82+
ux.link(`https://evergreen.mongodb.com/projects##${evergreenProject}`)
8283
),
83-
`Make sure that ${evergreenProject} is building from ${currentBranch}:\n` +
84-
`\thttps://evergreen.mongodb.com/projects##${evergreenProject}`
84+
'\n'
8585
);
8686

87-
cli.anykey('Press any key to continue.');
87+
cli.info('Press enter to continue or Ctrl+C to abort....');
88+
ux.waitForEnter();
8889

8990
await commitAndPushNewVersion(
9091
newSemver,
9192
currentBranch
9293
);
9394

94-
cli.info('');
9595
cli.info(
96-
chalk.bgYellow(
97-
chalk.gray(
98-
chalk.bold(' MANUAL ACTION REQUIRED!: '))
96+
'\n',
97+
ux.manualAction(
98+
'Make sure that the build is running in evergreen:\n',
99+
ux.link(`https://evergreen.mongodb.com/waterfall/${evergreenProject}`)
99100
),
100-
'Make sure that the build is running in evergreen:\n' +
101-
`\thttps://evergreen.mongodb.com/waterfall/${evergreenProject}`
101+
'\n'
102102
);
103103

104104
await waitForAssets(newSemver, { downloadCenter });
@@ -130,6 +130,21 @@ async function releaseCheckout(versionLike) {
130130
}
131131

132132
await git.checkout(releaseBranchName);
133+
134+
const remoteBranches = await git.getRemoteBranches();
135+
if (!remoteBranches.includes(releaseBranchName)) {
136+
cli.info(
137+
'\n',
138+
ux.manualAction(
139+
'You just checked out a new release branch that does not exist in the remote. Run:\n',
140+
ux.command(`git push -u origin ${releaseBranchName}`), '\n',
141+
'to create the remote branch before proceeding with the release.'
142+
),
143+
'\n'
144+
);
145+
}
146+
147+
cli.info('Switched to branch:', chalk.bold(await git.getCurrentBranch()));
133148
}
134149

135150
async function releaseChangelog() {
@@ -151,18 +166,7 @@ async function releaseChangelog() {
151166
.reverse()
152167
.find((t) => semver.lt(t, releaseTag));
153168

154-
cli.info('');
155-
cli.info(`Changes from ${chalk.bold(previousTag)}:`);
156-
const changes = _.uniq(await git.log(previousTag, releaseTag))
157-
.filter((line) => !semver.valid(line)) // filter out tag commits
158-
.map((line) => `- ${line}`);
159-
160-
cli.info(changes.join('\n'));
161-
162-
cli.info('');
163-
cli.info('You can see the full list of commits here:');
164-
const githubCompareUrl = `https://github.com/mongodb-js/compass/compare/${previousTag}...${releaseTag}`;
165-
cli.url(githubCompareUrl, githubCompareUrl);
169+
await changelog.render(previousTag, releaseTag);
166170
}
167171

168172
async function releasePublish() {
@@ -201,6 +205,15 @@ async function releaseWait() {
201205
await getValidReleaseBranch();
202206
const releaseVersion = await getPackageJsonVersion();
203207

208+
const evergreenProject = version.isGa(releaseVersion) ?
209+
'10gen-compass-stable' : '10gen-compass-testing';
210+
211+
cli.info(
212+
`Waiting ${chalk.bold(releaseVersion)} assets for being built in evergreen:`,
213+
ux.link(`https://evergreen.mongodb.com/waterfall/${evergreenProject}`),
214+
'\n'
215+
);
216+
204217
await waitForAssets(releaseVersion, {
205218
downloadCenter: createDownloadCenter()
206219
});
@@ -221,4 +234,3 @@ function createDownloadCenter() {
221234
secretAccessKey: env.requireEnvVar('MONGODB_DOWNLOADS_AWS_SECRET_ACCESS_KEY')
222235
});
223236
}
224-

release/git.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ async function getTags() {
4444
return stdout.split('\n');
4545
}
4646

47+
async function getRemoteBranches() {
48+
await execa('git', ['fetch', '--all']);
49+
const { stdout } = await execa('git', ['branch', '-a']);
50+
return stdout.split('\n')
51+
.map(s => s.trim())
52+
.filter(s => s.match(/^remotes\/origin/))
53+
.map(s => s.replace(/^remotes\/origin\//, ''));
54+
}
55+
4756
async function log(ref1, ref2) {
4857
const { stdout } = await execa('git', [
4958
'log',
@@ -64,5 +73,6 @@ module.exports = {
6473
pushTags,
6574
getCurrentBranch,
6675
getTags,
76+
getRemoteBranches,
6777
log
6878
};

release/github.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@ async function getRelease(tagOrVersion) {
2121
return releases.find(({ tag_name }) => tag_name === tag);
2222
}
2323

24-
async function waitForReleaseCreated(tagOrVersion) {
25-
return await wait(
26-
() => getRelease(tagOrVersion),
27-
WAIT_OPTIONS
28-
);
29-
}
30-
3124
async function waitForReleasePublished(tagOrVersion) {
3225
return await wait(
33-
() => getRelease(tagOrVersion).then(({ draft }) => !draft),
26+
() => getRelease(tagOrVersion).then((release) => release && !release.draft),
3427
WAIT_OPTIONS
3528
);
3629
}
3730

38-
module.exports = { waitForReleaseCreated, waitForReleasePublished };
31+
module.exports = { waitForReleasePublished };
3932

0 commit comments

Comments
 (0)