Skip to content

Commit 3456adc

Browse files
committed
Merge remote-tracking branch 'origin/main' into MONGOSH-1851-create-vector-search-index-w-description
2 parents b50f31b + e48dcea commit 3456adc

File tree

13 files changed

+178
-68
lines changed

13 files changed

+178
-68
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Merge Release Tag
2+
3+
on:
4+
push:
5+
tags:
6+
- 'mongosh@[0-9]+.[0-9]+.[0-9]+'
7+
- 'mongosh@[0-9]+.[0-9]+.[0-9]-rc.[0-9]+'
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: none # We use the github app to checkout and push changes
12+
13+
jobs:
14+
merge-release-tag:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
19+
id: app-token
20+
with:
21+
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
22+
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
23+
24+
- uses: actions/checkout@v4
25+
with:
26+
ref: main
27+
fetch-depth: "0"
28+
token: ${{ steps.app-token.outputs.token }}
29+
30+
- name: Merge release tag into main
31+
run: |
32+
git merge ${{ github.ref }} -m "chore(release): merge changes from ${{ github.ref_name }}"
33+
git push origin main

THIRD_PARTY_NOTICES.md

Lines changed: 4 additions & 4 deletions
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 Tue Feb 18 2025.
2+
This document was automatically generated on Fri Feb 21 2025.
33

44
## List of dependencies
55

@@ -172,7 +172,7 @@ Package|Version|License
172172
**[bplist-parser](#a012056f1b32796d923573a3b1ef72cf36943d95e5e2f6af0f7eeab57a21be24)**|0.2.0|MIT
173173
**[brace-expansion](#2ba3ee23cc6a2718243e9c0c59ce154058f292965f563aa291b459a414e863cb)**|1.1.11|MIT
174174
**[browserslist](#a95274c46e5fc3c90b90fdf6cc259a6b44331ddca76e255afd128465621592ed)**|4.23.3|MIT
175-
**[bson](#88bcf6ee33d70cc1bf263aac89726781fb724e29ba9647909ffb24584ef23cf4)**|6.10.1|Apache-2.0
175+
**[bson](#c2a71e4ed4c66bf769b189dcac6ccdf5afec76968be4a1cc63105fda1d2b2132)**|6.10.3|Apache-2.0
176176
**[buffer-alloc-unsafe](#1022220a813dd092d3ced592ac36121a00bd08a9c2020e08ad370dc29ed217f0)**|1.1.0|MIT
177177
**[buffer-alloc](#d5cbc95b9dde4a46cd45334630efe3bc9025c904074bee845376bd60651441c0)**|1.2.0|MIT
178178
**[buffer-fill](#c3747dfd267829ceeb564a1717d0c65d88d2b366e215f640067abefac59e3fd4)**|1.0.0|MIT
@@ -20471,8 +20471,8 @@ License files:
2047120471

2047220472

2047320473

20474-
<a id="88bcf6ee33d70cc1bf263aac89726781fb724e29ba9647909ffb24584ef23cf4"></a>
20475-
### [bson](https://www.npmjs.com/package/bson) (version 6.10.1)
20474+
<a id="c2a71e4ed4c66bf769b189dcac6ccdf5afec76968be4a1cc63105fda1d2b2132"></a>
20475+
### [bson](https://www.npmjs.com/package/bson) (version 6.10.3)
2047620476
License tags: Apache-2.0
2047720477

2047820478
License files:

package-lock.json

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

packages/browser-runtime-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@mongodb-js/prettier-config-devtools": "^1.0.1",
4343
"@mongodb-js/tsconfig-mongosh": "^1.0.0",
4444
"@mongosh/types": "3.2.0",
45-
"bson": "^6.10.1",
45+
"bson": "^6.10.3",
4646
"depcheck": "^1.4.7",
4747
"eslint": "^7.25.0",
4848
"prettier": "^2.8.8",

packages/build/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Execute the following steps to publish a new release:
3939
```
4040
Follow the instructions and verify the inferred release version is correct.
4141
7. Wait for Evergreen to finish the publication stage.
42-
8. The previous step will have pushed tags for the npm publishes. Check out the tag for `mongosh@<version>` (not `v<version>`), create a branch for it, push that branch and open a PR with it. Then immediately merge that branch **using the `git merge` CLI command into main** and push to main. **NEVER** use the Github PR merge functionality, since that would squash the commit and give it a new commit hash that is different from the one in the tag.
42+
8. Ensure that the version bump was automatically merged into main and that it is synced up with the `[email protected]` tag.
4343
9. Close the Jira ticket for the release, post an update in the `#mongosh` Slack channel and ping the docs team.
4444

4545
### Branches and Tags

packages/cli-repl/src/mongosh-repl.spec.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { Duplex } from 'stream';
1010
import { PassThrough } from 'stream';
1111
import type { StubbedInstance } from 'ts-sinon';
1212
import { stubInterface } from 'ts-sinon';
13-
import { promisify } from 'util';
13+
import { inspect, promisify } from 'util';
1414
import {
1515
expect,
1616
fakeTTYProps,
@@ -526,18 +526,48 @@ describe('MongoshNodeRepl', function () {
526526
]) {
527527
context(mode, function () {
528528
let getHistory: () => string[];
529+
let getAllHistoryItems: () => string[];
529530

530531
beforeEach(function () {
531532
const { history } = mongoshRepl.runtimeState().repl as unknown as {
532533
history: string[];
533534
};
534535
getHistory = () =>
535536
history.filter((line) => !line.startsWith('prefill-'));
537+
getAllHistoryItems = () => history;
536538
for (let i = 0; i < prefill; i++) {
537539
history.unshift(`prefill-${i}`);
538540
}
539541
});
540542

543+
describe('history() command', function () {
544+
it('returns a formatted array of history', async function () {
545+
output = '';
546+
input.write('history()\n');
547+
await waitEval(bus);
548+
expect(output).includes(
549+
inspect(
550+
getAllHistoryItems()
551+
.slice(1, getAllHistoryItems().length)
552+
.reverse(),
553+
{ maxArrayLength: Infinity }
554+
)
555+
);
556+
});
557+
558+
it('works with array operations', async function () {
559+
output = '';
560+
input.write('history().slice(history().length-10).reverse()\n');
561+
await waitEval(bus);
562+
const history = getAllHistoryItems().slice(1).reverse();
563+
expect(output).includes(
564+
inspect(history.slice(history.length - 10).reverse(), {
565+
maxArrayLength: Infinity,
566+
})
567+
);
568+
});
569+
});
570+
541571
it('looks up existing entries, if there are any', async function () {
542572
output = '';
543573
input.write(arrowUp);

packages/cli-repl/src/mongosh-repl.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import { markTime } from './startup-timing';
4747
import type { Context } from 'vm';
4848
import { Script, createContext, runInContext } from 'vm';
4949
import { installPasteSupport } from './repl-paste-support';
50+
import util from 'util';
5051

5152
declare const __non_webpack_require__: any;
5253

@@ -365,6 +366,8 @@ class MongoshNodeRepl implements EvaluationListener {
365366
await this.finishInitializingNodeRepl();
366367
instanceState.setCtx(context);
367368

369+
this.setupHistoryCommand();
370+
368371
if (!this.shellCliOptions.nodb && !this.shellCliOptions.quiet) {
369372
// cf. legacy shell:
370373
// https://github.com/mongodb/mongo/blob/a6df396047a77b90bf1ce9463eecffbee16fb864/src/mongo/shell/mongo_main.cpp#L1003-L1026
@@ -391,6 +394,35 @@ class MongoshNodeRepl implements EvaluationListener {
391394
return { __initialized: 'yes' };
392395
}
393396

397+
setupHistoryCommand(): void {
398+
const history = () => {
399+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
400+
const replHistory: string[] = (this.runtimeState().repl as any).history;
401+
const formattedHistory =
402+
// Remove the history call from the formatted history
403+
replHistory.slice(1).reverse();
404+
405+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
406+
formattedHistory[util.inspect.custom as any] = ((
407+
depth: number | null,
408+
options: util.InspectOptions,
409+
inspect: typeof util.inspect
410+
) => {
411+
// We pass a copy of the array without the util.inspect.custom set
412+
// to prevent infinite recursion.
413+
return inspect(formattedHistory.concat(), {
414+
...options,
415+
depth,
416+
maxArrayLength: Infinity,
417+
});
418+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
419+
}) as any;
420+
return formattedHistory;
421+
};
422+
423+
this.runtimeState().context.history = history;
424+
}
425+
394426
private async finishInitializingNodeRepl(): Promise<void> {
395427
const { repl, instanceState } = this.runtimeState();
396428
if (!repl) return;

packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@types/chai-as-promised": "^7.1.3",
4242
"@types/node": "^14.14.6",
4343
"@types/rimraf": "^3.0.0",
44-
"bson": "^6.10.1",
44+
"bson": "^6.10.3",
4545
"chai-as-promised": "^7.1.1",
4646
"depcheck": "^1.4.7",
4747
"eslint": "^7.25.0",

0 commit comments

Comments
 (0)