From 6923881e5a40eec64e4236b0deb6d623ca12a7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Fri, 11 Sep 2026 08:47:20 +0100 Subject: [PATCH 01/11] fix(mongodb-constants): update $geoNear template COMPASS-6532 --- .../mongodb-constants/src/stage-operators.ts | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/mongodb-constants/src/stage-operators.ts b/packages/mongodb-constants/src/stage-operators.ts index e0957ace..9b3d4740 100644 --- a/packages/mongodb-constants/src/stage-operators.ts +++ b/packages/mongodb-constants/src/stage-operators.ts @@ -387,22 +387,27 @@ const STAGE_OPERATORS = [ comment: `/** * near: The point to search near. * distanceField: The calculated distance. - * maxDistance: The maximum distance, in meters, documents can be before being excluded from results. - * query: Limits results that match the query + * maxDistance: Optional maximum distance, in meters, documents can be before being excluded from results. + * minDistance: Optional minimum distance from the center point. + * query: Limits results that match the query. * includeLocs: Optional. Labels and includes the point used to match the document. - * num: Optional. The maximum number of documents to return. + * distanceMultiplier: Optional factor to multiply returned distances by. + * key: Optional geospatial indexed field to use. * spherical: Defaults to false. Specifies whether to use spherical geometry. */ `, + snippet: `{ - near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, - distanceField: '\${3:string}', - maxDistance: \${4:number}, - query: {\${5}}, - includeLocs: '\${6}', - num: \${7:number}, - spherical: \${8:boolean} -}`, + near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, + distanceField: '\${3:string}', + maxDistance: \${4:number}, + minDistance: \${5:number}, + query: {\${6}}, + includeLocs: '\${7:string}', + distanceMultiplier: \${8:number}, + key: '\${9:string}', + spherical: \${10:boolean} + }`, }, { name: '$graphLookup', From c40f99d92cf5de5291fa802ea014ba64a999980c Mon Sep 17 00:00:00 2001 From: Lucia Harcekova <119792460+LuciaHarcekova@users.noreply.github.com> Date: Fri, 11 Sep 2026 10:18:21 +0100 Subject: [PATCH 02/11] Update packages/mongodb-constants/src/stage-operators.ts Co-authored-by: Alena Khineika --- packages/mongodb-constants/src/stage-operators.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/mongodb-constants/src/stage-operators.ts b/packages/mongodb-constants/src/stage-operators.ts index 9b3d4740..5edfd880 100644 --- a/packages/mongodb-constants/src/stage-operators.ts +++ b/packages/mongodb-constants/src/stage-operators.ts @@ -396,7 +396,6 @@ const STAGE_OPERATORS = [ * spherical: Defaults to false. Specifies whether to use spherical geometry. */ `, - snippet: `{ near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, distanceField: '\${3:string}', From 9ac8714c4b3e6c138c89cfd6b3b924b94dde6b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Fri, 11 Sep 2026 11:24:13 +0100 Subject: [PATCH 03/11] docs: add " let option" decription for near in $geoNear --- .../mongodb-constants/src/stage-operators.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/mongodb-constants/src/stage-operators.ts b/packages/mongodb-constants/src/stage-operators.ts index 5edfd880..6679dae4 100644 --- a/packages/mongodb-constants/src/stage-operators.ts +++ b/packages/mongodb-constants/src/stage-operators.ts @@ -385,7 +385,7 @@ const STAGE_OPERATORS = [ namespaces: [...ANY_NAMESPACE], description: 'Returns documents based on proximity to a geospatial point.', comment: `/** - * near: The point to search near. + * near: The point to search near, supports the let option and bound let option. * distanceField: The calculated distance. * maxDistance: Optional maximum distance, in meters, documents can be before being excluded from results. * minDistance: Optional minimum distance from the center point. @@ -397,16 +397,16 @@ const STAGE_OPERATORS = [ */ `, snippet: `{ - near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, - distanceField: '\${3:string}', - maxDistance: \${4:number}, - minDistance: \${5:number}, - query: {\${6}}, - includeLocs: '\${7:string}', - distanceMultiplier: \${8:number}, - key: '\${9:string}', - spherical: \${10:boolean} - }`, + near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] }, + distanceField: '\${3:string}', + maxDistance: \${4:number}, + minDistance: \${5:number}, + query: {\${6}}, + includeLocs: '\${7:string}', + distanceMultiplier: \${8:number}, + key: '\${9:string}', + spherical: \${10:boolean} +}`, }, { name: '$graphLookup', From 81b4e7c954240a9fa930357f4a68f51fcff182b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Tue, 6 Oct 2026 15:51:15 +0100 Subject: [PATCH 04/11] Testing uncommented process.platform === 'win32' || process.platform === 'linux') --- .../devtools-proxy-support/src/proxy-options.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/devtools-proxy-support/src/proxy-options.spec.ts b/packages/devtools-proxy-support/src/proxy-options.spec.ts index 98e8d05f..6c850b7d 100644 --- a/packages/devtools-proxy-support/src/proxy-options.spec.ts +++ b/packages/devtools-proxy-support/src/proxy-options.spec.ts @@ -174,12 +174,12 @@ describe('proxy options handling', function () { before(async function () { // TODO: COMPASS-9232 reenable the test on Linux and, ideally, on Windows, after // investigating the failures. - if ( - (process.platform === 'win32' || process.platform === 'linux') && - process.env.CI - ) { - return this.skip(); - } + // if ( + // (process.platform === 'win32' || process.platform === 'linux') && + // process.env.CI + // ) { + // return this.skip(); + // } setup = new HTTPServerProxyTestSetup(); await setup.listen(); From d9bb9d6b832b8e8873cefae58118cacad05200da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Tue, 6 Oct 2026 21:22:23 +0100 Subject: [PATCH 05/11] add skip for windows condition proxy options unit tests --- .../devtools-proxy-support/src/proxy-options.spec.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/devtools-proxy-support/src/proxy-options.spec.ts b/packages/devtools-proxy-support/src/proxy-options.spec.ts index 6c850b7d..8349e7bc 100644 --- a/packages/devtools-proxy-support/src/proxy-options.spec.ts +++ b/packages/devtools-proxy-support/src/proxy-options.spec.ts @@ -174,12 +174,10 @@ describe('proxy options handling', function () { before(async function () { // TODO: COMPASS-9232 reenable the test on Linux and, ideally, on Windows, after // investigating the failures. - // if ( - // (process.platform === 'win32' || process.platform === 'linux') && - // process.env.CI - // ) { - // return this.skip(); - // } + // || process.platform === 'linux' + if (process.platform === 'win32' && process.env.CI) { + return this.skip(); + } setup = new HTTPServerProxyTestSetup(); await setup.listen(); From c75735c8817431f02571ff368612d03a9f009099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Wed, 7 Oct 2026 15:05:34 +0100 Subject: [PATCH 06/11] Added a Linux-only step to check-test.yaml that sets chrome-sandbox to root:root with mode 4755 --- .github/workflows/check-test.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/check-test.yaml b/.github/workflows/check-test.yaml index 6a479fa9..efdc5ead 100644 --- a/.github/workflows/check-test.yaml +++ b/.github/workflows/check-test.yaml @@ -90,6 +90,12 @@ jobs: git checkout -- packages/saslprep/src/code-points-data.ts shell: bash + - name: Configure Electron sandbox + if: ${{ runner.os == 'Linux' }} + run: | + sudo chown root:root node_modules/electron/dist/chrome-sandbox + sudo chmod 4755 node_modules/electron/dist/chrome-sandbox + - name: Info run: | LERNA_VERSION=$(npm ls lerna --json | jq -r .dependencies.lerna.version) From ea280386da45b13bc656fc801d54c32ee308d9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Wed, 7 Oct 2026 17:21:30 +0100 Subject: [PATCH 07/11] remove TODO comment after fix implemented --- packages/devtools-proxy-support/src/proxy-options.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/devtools-proxy-support/src/proxy-options.spec.ts b/packages/devtools-proxy-support/src/proxy-options.spec.ts index 8349e7bc..e77aa07a 100644 --- a/packages/devtools-proxy-support/src/proxy-options.spec.ts +++ b/packages/devtools-proxy-support/src/proxy-options.spec.ts @@ -172,9 +172,6 @@ describe('proxy options handling', function () { let setup: HTTPServerProxyTestSetup; before(async function () { - // TODO: COMPASS-9232 reenable the test on Linux and, ideally, on Windows, after - // investigating the failures. - // || process.platform === 'linux' if (process.platform === 'win32' && process.env.CI) { return this.skip(); } From eaa1c8f42a48970faaad0569691f9a663bdae796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Thu, 8 Oct 2026 11:26:59 +0100 Subject: [PATCH 08/11] uncomment win skip test from proxy options --- packages/devtools-proxy-support/src/proxy-options.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/devtools-proxy-support/src/proxy-options.spec.ts b/packages/devtools-proxy-support/src/proxy-options.spec.ts index e77aa07a..404030a4 100644 --- a/packages/devtools-proxy-support/src/proxy-options.spec.ts +++ b/packages/devtools-proxy-support/src/proxy-options.spec.ts @@ -172,9 +172,6 @@ describe('proxy options handling', function () { let setup: HTTPServerProxyTestSetup; before(async function () { - if (process.platform === 'win32' && process.env.CI) { - return this.skip(); - } setup = new HTTPServerProxyTestSetup(); await setup.listen(); From dfac4f0680e8224e0870386394a83fe45db1c12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Thu, 8 Oct 2026 14:08:28 +0100 Subject: [PATCH 09/11] Fix: proxy-options.spec.ts:184-195: drop the npx hop and run the xvfb-maybe script directly with process.execPath, resolving it via require.resolve('xvfb-maybe/src/xvfb-maybe.js'). --- packages/devtools-proxy-support/src/proxy-options.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/devtools-proxy-support/src/proxy-options.spec.ts b/packages/devtools-proxy-support/src/proxy-options.spec.ts index 404030a4..c5edebe7 100644 --- a/packages/devtools-proxy-support/src/proxy-options.spec.ts +++ b/packages/devtools-proxy-support/src/proxy-options.spec.ts @@ -182,9 +182,13 @@ describe('proxy options handling', function () { await once(server, 'listening'); const connEvent = once(server, 'connection'); childProcess = spawn( - 'npx', + // Resolving the xvfb-maybe script and running it with the current + // Node binary rather than going through `npx`, because on Windows + // spawning `npx` (really `npx.cmd`) fails with ENOENT unless a shell + // is used. + process.execPath, [ - 'xvfb-maybe', + require.resolve('xvfb-maybe/src/xvfb-maybe.js'), // eslint-disable-next-line @typescript-eslint/no-var-requires require('electron') as unknown as string, path.resolve(__dirname, '..', 'test', 'electron-test-server.js'), From d64ce198ae12589358e495c861fd12a5b7bf3bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Thu, 8 Oct 2026 14:37:27 +0100 Subject: [PATCH 10/11] Fix: proxy-options.spec.ts:196-208: unset NODE_OPTIONS and NODE_PATH in the child's env. --- packages/devtools-proxy-support/src/proxy-options.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/devtools-proxy-support/src/proxy-options.spec.ts b/packages/devtools-proxy-support/src/proxy-options.spec.ts index c5edebe7..2cc4037e 100644 --- a/packages/devtools-proxy-support/src/proxy-options.spec.ts +++ b/packages/devtools-proxy-support/src/proxy-options.spec.ts @@ -196,6 +196,13 @@ describe('proxy options handling', function () { { env: { ...process.env, + // nyc injects `--require node-preload.js` into NODE_OPTIONS and + // relies on NODE_PATH to resolve it by bare name. Electron does + // not honour NODE_PATH for preloads, so the child would exit with + // MODULE_NOT_FOUND. We do not need coverage from the Electron + // process, so drop both. + NODE_OPTIONS: undefined, + NODE_PATH: undefined, TEST_SERVER_PORT: String((server.address() as AddressInfo).port), }, stdio: 'inherit', From e262a4e57ff108c72a81b459f50ef0ee8ca861e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucia=20Harcekov=C3=A1?= Date: Thu, 8 Oct 2026 15:18:33 +0100 Subject: [PATCH 11/11] - win 2 test --- packages/devtools-proxy-support/package.json | 2 +- packages/devtools-proxy-support/src/proxy-options.spec.ts | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/devtools-proxy-support/package.json b/packages/devtools-proxy-support/package.json index bb5280fc..d1a23d36 100644 --- a/packages/devtools-proxy-support/package.json +++ b/packages/devtools-proxy-support/package.json @@ -58,7 +58,7 @@ "check": "npm run typecheck && npm run lint && npm run depcheck", "check-ci": "npm run check", "test": "mocha", - "test-cov": "nyc -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test", + "test-cov": "nyc --use-spawn-wrap -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test", "test-watch": "npm run test -- --watch", "test-ci": "npm run test-cov", "reformat": "npm run prettier -- --write ." diff --git a/packages/devtools-proxy-support/src/proxy-options.spec.ts b/packages/devtools-proxy-support/src/proxy-options.spec.ts index 2cc4037e..c5edebe7 100644 --- a/packages/devtools-proxy-support/src/proxy-options.spec.ts +++ b/packages/devtools-proxy-support/src/proxy-options.spec.ts @@ -196,13 +196,6 @@ describe('proxy options handling', function () { { env: { ...process.env, - // nyc injects `--require node-preload.js` into NODE_OPTIONS and - // relies on NODE_PATH to resolve it by bare name. Electron does - // not honour NODE_PATH for preloads, so the child would exit with - // MODULE_NOT_FOUND. We do not need coverage from the Electron - // process, so drop both. - NODE_OPTIONS: undefined, - NODE_PATH: undefined, TEST_SERVER_PORT: String((server.address() as AddressInfo).port), }, stdio: 'inherit',