Skip to content

Commit 49766a3

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents 4de3edd + 08edb1f commit 49766a3

File tree

6 files changed

+71
-12
lines changed

6 files changed

+71
-12
lines changed

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 **Mongodb Compass**.
2-
This document was automatically generated on Wed Apr 02 2025.
2+
This document was automatically generated on Sun Apr 06 2025.
33

44
## List of dependencies
55

docs/tracking-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
> the tracking plan for the specific Compass version you can use the following
77
> URL: `https://github.com/mongodb-js/compass/blob/<compass version>/docs/tracking-plan.md`
88
9-
Generated on Wed, Apr 2, 2025
9+
Generated on Sun, Apr 6, 2025
1010

1111
## Table of Contents
1212

packages/compass-components/src/components/bson-value.spec.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ describe('BSONValue', function () {
4545
value: Binary.createFromHexString('3132303d', Binary.SUBTYPE_UUID),
4646
expected: "UUID('3132303d')",
4747
},
48+
{
49+
type: 'Binary',
50+
value: Binary.fromInt8Array(new Int8Array([1, 2, 3])),
51+
expected: 'Binary.fromInt8Array(new Int8Array([1, 2, 3]))',
52+
},
53+
{
54+
type: 'Binary',
55+
value: Binary.fromFloat32Array(new Float32Array([1.1, 2.2, 3.3])),
56+
expected: 'Binary.fromFloat32Array(new Float32Array([1.1, 2.2, 3.3]))',
57+
},
58+
{
59+
type: 'Binary',
60+
value: Binary.fromPackedBits(new Uint8Array([1, 2, 3])),
61+
expected: 'Binary.fromPackedBits(new Uint8Array([1, 2, 3]))',
62+
},
4863
{
4964
type: 'Code',
5065
value: new Code('var a = 1', { foo: 2 }),

packages/compass-components/src/components/bson-value.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,37 @@ const BinaryValue: React.FunctionComponent<PropsByValueType<'Binary'>> = ({
157157

158158
return { stringifiedValue: `UUID('${uuid}')` };
159159
}
160+
if (value.sub_type === Binary.SUBTYPE_VECTOR) {
161+
const vectorType = value.buffer[0];
162+
if (vectorType === Binary.VECTOR_TYPE.Int8) {
163+
const truncatedSerializedBuffer = truncate(
164+
value.toInt8Array().slice(0, 100).join(', '),
165+
100
166+
);
167+
return {
168+
stringifiedValue: `Binary.fromInt8Array(new Int8Array([${truncatedSerializedBuffer}]))`,
169+
};
170+
} else if (vectorType === Binary.VECTOR_TYPE.Float32) {
171+
const truncatedSerializedBuffer = truncate(
172+
[...value.toFloat32Array().slice(0, 100)]
173+
// Using a limited precision and removing trailing zeros for better displaying
174+
.map((num) => num.toPrecision(8).replace(/\.?0+$/, ''))
175+
.join(', '),
176+
100
177+
);
178+
return {
179+
stringifiedValue: `Binary.fromFloat32Array(new Float32Array([${truncatedSerializedBuffer}]))`,
180+
};
181+
} else if (vectorType === Binary.VECTOR_TYPE.PackedBit) {
182+
const truncatedSerializedBuffer = truncate(
183+
value.toPackedBits().slice(0, 100).join(', '),
184+
100
185+
);
186+
return {
187+
stringifiedValue: `Binary.fromPackedBits(new Uint8Array([${truncatedSerializedBuffer}]))`,
188+
};
189+
}
190+
}
160191
return {
161192
stringifiedValue: `Binary.createFromBase64('${truncate(
162193
value.toString('base64'),

packages/compass-crud/src/components/table-view/document-table-view.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,9 @@ class DocumentTableView extends React.Component<DocumentTableViewProps> {
629629

630630
(this.gridApi as any).gridOptionsWrapper.gridOptions.context.path =
631631
params.path;
632-
this.gridApi.setRowData(this.createRowData(this.props.docs, 1));
632+
this.gridApi.setRowData(
633+
this.createRowData(this.props.docs, this.props.start)
634+
);
633635
this.gridApi.setColumnDefs(headers);
634636
}
635637
this.gridApi.refreshCells({ force: true });

packages/hadron-build/commands/upload.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const path = require('path');
1010
const os = require('os');
1111
const { promises: fs } = require('fs');
1212
const { deepStrictEqual } = require('assert');
13+
const semver = require('semver');
1314
const { Octokit } = require('@octokit/rest');
1415
const { GithubRepo } = require('@mongodb-js/devtools-github-repo');
1516
const { diffString } = require('json-diff');
@@ -253,7 +254,7 @@ async function getLatestRelease(channel = 'stable') {
253254
auth: process.env.GITHUB_TOKEN,
254255
});
255256

256-
const page = 1;
257+
let page = 1;
257258

258259
// eslint-disable-next-line no-constant-condition
259260
while (true) {
@@ -279,14 +280,24 @@ async function getLatestRelease(channel = 'stable') {
279280
return null;
280281
}
281282

282-
const latestRelease = releases.find((release) => {
283-
return (
284-
!release.draft &&
285-
(channel === 'beta'
286-
? isBeta(release.tag_name)
287-
: isStable(release.tag_name))
288-
);
289-
});
283+
const latestRelease = releases
284+
.sort((a, b) => {
285+
if (semver.lt(a.tag_name, b.tag_name)) {
286+
return 1;
287+
}
288+
if (semver.gt(a.tag_name, b.tag_name)) {
289+
return -1;
290+
}
291+
return 0;
292+
})
293+
.find((release) => {
294+
return (
295+
!release.draft &&
296+
(channel === 'beta'
297+
? isBeta(release.tag_name)
298+
: isStable(release.tag_name))
299+
);
300+
});
290301

291302
if (latestRelease) {
292303
return latestRelease;

0 commit comments

Comments
 (0)