Skip to content

Commit 19ab06d

Browse files
authored
Merge branch 'main' into login-docker-hub
2 parents 6c0fb2e + 0886abf commit 19ab06d

File tree

9 files changed

+609
-603
lines changed

9 files changed

+609
-603
lines changed

.evergreen.yml

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

.evergreen/node-20-latest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"version": "20.18.0",
2+
"version": "20.18.1",
33
"major": 20,
44
"minor": 18,
5-
"patch": 0,
5+
"patch": 1,
66
"tag": "",
77
"codename": "iron",
88
"versionName": "v20",
99
"start": "2023-04-18T00:00:00.000Z",
1010
"lts": "2023-10-24T00:00:00.000Z",
1111
"maintenance": "2024-10-22T00:00:00.000Z",
1212
"end": "2026-04-30T00:00:00.000Z",
13-
"releaseDate": "2024-10-03T00:00:00.000Z",
13+
"releaseDate": "2024-11-20T00:00:00.000Z",
1414
"isLts": true,
1515
"files": [
1616
"aix-ppc64",
@@ -40,6 +40,6 @@
4040
"v8": "11.3.244.8",
4141
"uv": "1.46.0",
4242
"zlib": "1.3.0.1-motley",
43-
"openssl": "3.0.13+quic"
43+
"openssl": "3.0.15+quic"
4444
}
4545
}

.github/workflows/cron-tasks.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
update_generated_files:
1313
name: Update automatically generated files
1414
runs-on: ubuntu-latest
15+
env:
16+
npm_config_loglevel: verbose
17+
npm_config_foreground_scripts: "true"
18+
PUPPETEER_SKIP_DOWNLOAD: "true"
1519
steps:
1620
- uses: actions/checkout@v4
1721
with:
@@ -21,11 +25,12 @@ jobs:
2125
# this is important so git log can pick up on
2226
# the whole history to generate the list of AUTHORS
2327
fetch-depth: "0"
28+
token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }}
2429

2530
- name: Set up Git
2631
run: |
27-
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
28-
git config --local user.name "github-actions[bot]"
32+
git config --local user.email "devtoolsbot@users.noreply.github.com"
33+
git config --local user.name "devtoolsbot"
2934
3035
- uses: actions/setup-node@v4
3136
with:
@@ -44,7 +49,7 @@ jobs:
4449
- name: Update THIRD_PARTY_NOTICES.md
4550
run: |
4651
npm run update-third-party-notices
47-
git commit --no-allow-empty -m "chore: update THIRD_PARTY_NOTICES" THIRD_PARTY_NOTICES.md || true
52+
git add THIRD_PARTY_NOTICES.md
4853
4954
- name: Update AUTHORS
5055
run: |
@@ -73,20 +78,7 @@ jobs:
7378
npm run update-cli-usage-text packages/*/*.md *.md
7479
git add packages/*/*.md *.md
7580
76-
- name: Create pull request
77-
id: cpr
78-
uses: peter-evans/create-pull-request@v6
79-
with:
80-
commit-message: Update auto-generated files
81-
branch: ci/cron-tasks-update-files
82-
title: "chore: update auto-generated files"
83-
body: |
84-
- Update auto-generated files
85-
86-
- name: Merge PR
87-
env:
88-
PULL_REQUEST_NUMBER: ${{steps.cpr.outputs.pull-request-number}}
89-
# NOTE: we don't use a PAT so to not trigger further automation
90-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
- name: Commit and push
9182
run: |
92-
gh pr merge $PULL_REQUEST_NUMBER --squash --delete-branch
83+
git commit --no-allow-empty -m "chore: update auto-generated files" || true
84+
git push

.github/workflows/update-node-js.yaml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,40 @@ jobs:
1111
name: Update Node.js versions
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
# don't checkout a detatched HEAD
1717
ref: ${{ github.head_ref }}
1818

1919
# this is important so git log can pick up on
2020
# the whole history to generate the list of AUTHORS
21-
fetch-depth: '0'
21+
fetch-depth: "0"
2222

2323
- name: Setup git
2424
run: |
25-
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
26-
git config --local user.name "github-actions[bot]"
25+
git config --local user.email "devtoolsbot@users.noreply.github.com"
26+
git config --local user.name "devtoolsbot"
2727
28-
- uses: actions/setup-node@v2
28+
- uses: actions/setup-node@v4
2929
with:
30-
node-version: 16.x
31-
cache: 'npm'
30+
node-version: 20.x
31+
cache: "npm"
3232

33-
- name: Install npm@8.19.4
33+
- name: Install npm@10
3434
run: |
35-
npm install -g npm@8.19.4
35+
npm install -g npm@10
3636
3737
- name: Bump packages
3838
run: |
3939
npm run update-node-js-versions
4040
npm run update-evergreen-config
41-
git add .
42-
git commit --no-allow-empty -m "chore: update node.js version" || true
4341
4442
- name: Create Pull Request
45-
id: cpr
46-
uses: peter-evans/create-pull-request@v6
43+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5
4744
with:
48-
token: ${{ secrets.GITHUB_TOKEN }}
49-
commit-message: 'chore: update node.js'
45+
token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }}
46+
commit-message: "chore: update node.js version"
5047
branch: ci/update-node-js-versions
51-
title: 'chore: update node.js'
48+
title: "chore: update node.js"
5249
body: |
5350
- Update node.js

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 **mongosh**.
2-
This document was automatically generated on Thu Nov 21 2024.
2+
This document was automatically generated on Fri Nov 22 2024.
33

44
## List of dependencies
55

package-lock.json

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

packages/shell-api/src/stream-processor.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,30 @@ export default class StreamProcessor extends ShellApiWithMongoClass {
2626
}
2727

2828
@returnsPromise
29-
async start() {
29+
async start(options: Document = {}) {
3030
return await this._streams._runStreamCommand({
3131
startStreamProcessor: this.name,
32+
...options,
3233
});
3334
}
3435

3536
@returnsPromise
36-
async stop() {
37+
async stop(options: Document = {}) {
3738
return await this._streams._runStreamCommand({
3839
stopStreamProcessor: this.name,
40+
...options,
3941
});
4042
}
4143

4244
@returnsPromise
43-
async drop() {
44-
return this._drop();
45+
async drop(options: Document = {}) {
46+
return this._drop(options);
4547
}
4648

47-
async _drop() {
49+
async _drop(options: Document = {}) {
4850
return await this._streams._runStreamCommand({
4951
dropStreamProcessor: this.name,
52+
...options,
5053
});
5154
}
5255

packages/shell-api/src/streams.spec.ts

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,67 @@ describe('Streams', function () {
164164
});
165165
});
166166

167+
// Create a stream processor.
168+
const createProcessor = async (name: string) => {
169+
const runCmdStub = sinon
170+
.stub(mongo._serviceProvider, 'runCommand')
171+
.resolves({ ok: 1 });
172+
const pipeline = [{ $match: { foo: 'bar' } }];
173+
const processor = await streams.createStreamProcessor(name, pipeline);
174+
expect(processor).to.eql(streams.getProcessor(name));
175+
const cmd = { createStreamProcessor: name, pipeline };
176+
expect(runCmdStub.calledOnceWithExactly('admin', cmd, {})).to.be.true;
177+
return { runCmdStub, processor };
178+
};
179+
180+
// Validate supplying options in start,stop, and drop commands.
181+
describe('options', function () {
182+
it('supplies options in start, stop, and drop', async function () {
183+
const name = 'testOptions';
184+
const { runCmdStub, processor } = await createProcessor(name);
185+
186+
// Start the stream processor with an extra option.
187+
await processor.start({ resumeFromCheckpoint: false });
188+
expect(
189+
runCmdStub.calledWithExactly(
190+
'admin',
191+
{ startStreamProcessor: name, resumeFromCheckpoint: false },
192+
{}
193+
)
194+
).to.be.true;
195+
196+
// Stop the stream processor with an extra option.
197+
await processor.stop({ force: true });
198+
expect(
199+
runCmdStub.calledWithExactly(
200+
'admin',
201+
{ stopStreamProcessor: name, force: true },
202+
{}
203+
)
204+
).to.be.true;
205+
206+
// Drop the stream processor with a few extra options.
207+
const opts = {
208+
force: true,
209+
ttl: { unit: 'day', size: 30 },
210+
};
211+
await processor.drop(opts);
212+
expect(
213+
runCmdStub.calledWithExactly(
214+
'admin',
215+
{
216+
dropStreamProcessor: name,
217+
...opts,
218+
},
219+
{}
220+
)
221+
).to.be.true;
222+
});
223+
});
224+
167225
describe('modify', function () {
168226
it('throws with invalid parameters', async function () {
169-
// Create the stream processor.
170-
const runCmdStub = sinon
171-
.stub(mongo._serviceProvider, 'runCommand')
172-
.resolves({ ok: 1 });
173-
const name = 'p1';
174-
const pipeline = [{ $match: { foo: 'bar' } }];
175-
const processor = await streams.createStreamProcessor(name, pipeline);
176-
expect(processor).to.eql(streams.getProcessor(name));
177-
const cmd = { createStreamProcessor: name, pipeline };
178-
expect(runCmdStub.calledOnceWithExactly('admin', cmd, {})).to.be.true;
227+
const { processor } = await createProcessor('testModify');
179228

180229
// No arguments to modify.
181230
const caught = await processor
@@ -206,17 +255,8 @@ describe('Streams', function () {
206255
});
207256

208257
it('works with pipeline and options arguments', async function () {
209-
const runCmdStub = sinon
210-
.stub(mongo._serviceProvider, 'runCommand')
211-
.resolves({ ok: 1 });
212-
213-
// Create the stream processor.
214-
const name = 'p1';
215-
const pipeline = [{ $match: { foo: 'bar' } }];
216-
const processor = await streams.createStreamProcessor(name, pipeline);
217-
expect(processor).to.eql(streams.getProcessor(name));
218-
const cmd = { createStreamProcessor: name, pipeline };
219-
expect(runCmdStub.calledOnceWithExactly('admin', cmd, {})).to.be.true;
258+
const name = 'testModify';
259+
const { runCmdStub, processor } = await createProcessor(name);
220260

221261
// Start the stream processor.
222262
await processor.start();

testing/test-vscode.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ cd vscode
1515
npm install --force
1616
rm -rf node_modules/@mongosh
1717
(cd node_modules && ln -s "$mongosh_root_dir/packages" @mongosh)
18-
npm test
18+
# This test can require a lot of memory so we bump the maximum size.
19+
NODE_OPTIONS=--max-old-space-size=4096 npm test
1920
cd /tmp
2021
rm -rf "$test_root_dir"

0 commit comments

Comments
 (0)