Repository navigation
refactor: Replace deprecated mongodb-runner with @mongodb-js/mongodb-runner 8.4.3 - #3512
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code. |
Replaces the deprecated development dependency
mongodb-runner6.7.3 with its successor@mongodb-js/mongodb-runner8.4.3 (exact pin, latest release). The browser-control module loads the runner by package name, so it is updated as well.mongodb-runneris deprecated on npm ("This package is not maintained anymore. Please use @mongodb-js/mongodb-runner instead"). It installsdecompress4.2.1 through@mongodb-js/mongodb-downloader1.1.9, anddecompresshas no patched release.@mongodb-js/mongodb-runner8.4.3 uses@mongodb-js/mongodb-downloader3.0.5, which replaceddecompresswith the maintained fork@xhmikosr/decompressin 3.0.3 (mongodb-js/devtools-shared#927). No copy ofdecompressremains in the lock file.Security
This resolves the following Dependabot alerts. They all concern a development dependency, so the published package and the Docker image are not affected.
decompressremoved;@xhmikosr/decompress11.1.4 is the first patched 11.x releasedecompressremoved;@xhmikosr/decompress11.1.4 is newer than the first patched 11.x release 11.1.3decompressremoveddecompressremoved@xhmikosr/decompress11.1.4 is the first 11.x version that fixes both GHSA-mp2f-45pm-3cg9 (fixed since 11.1.3) and GHSA-hrh2-vp3x-79xf (fixed since 11.1.4). In the 10.x line, 10.2.2 fixes both.npm audit: 34 → 31 findings (critical 1 → 0, moderate 12 → 10, high unchanged at 21). The removed findings aredecompress,@mongodb-js/mongodb-downloaderandmongodb-runner. There are no new findings..tgzarchives withtarand use the decompress library only for other formats, such as the Windows.zipbuilds. On Linux and macOS, the vulnerable extraction code is not reached.Changes
Browser control (
Parse-Dashboard/browser-control/setup.js,README.md)Browser control (
npm run browser-control) is a development-only feature that cannot be enabled withNODE_ENV=production. When enabled, it starts MongoDB through the runner's programmatic API, not its CLI. No npm script, workflow or test usesmongodb-runner.require('mongodb-runner')becomesrequire('@mongodb-js/mongodb-runner'). Without this change, browser control would be disabled silently:Parse-Dashboard/server.jsignoresMODULE_NOT_FOUNDerrors from the browser-control setup, because it treats them as a production build without the module.MongoCluster.start({ topology: 'standalone', version, tmpDir, args: ['--port', port] }), theconnectionStringgetter andclose()work the same for a standalone server in 8.4.3. Two differences apply to this call:MONGODB_RUNNER_DOWNLOAD_DIRis set, MongoDB is downloaded there instead of totmpDir(feat(mongodb-runner): add download dir as env, cache mongodb download on windows ci COMPASS-10932 mongodb-js/devtools-shared#856).Parse-Dashboard/is part of the published npm package, but the runner is a development dependency and is not installed for consumers. Anyone who installedmongodb-runnerseparately to use browser control from the npm package needs@mongodb-js/mongodb-runnerinstead.Lock file
All 126 changed entries are development-only (
dev: true), not counting the root package entry, whosedevDependencieschange. Each one is in the dependency tree of the removed or the added runner, and each version change is required by a range in the new tree. No production entry changes, so the Docker image is unchanged: its release stage copies only thenpm ci --omit=dev --ignore-scriptsinstall. No added or updated entry has an install script.mongodb-runner6.7.3decompress4.2.1, withdecompress-tar,decompress-tarbz2,decompress-targz,decompress-unzipand their helpersmongodb-download-url1.8.8@mongodb-js/mongodb-runner8.4.3, with its ownyargs18.2.0 tree and its ownmongodb7.5.0@xhmikosr/decompress11.1.4 and its plugins@mongodb-js/mongodb-artifact-url2.0.4@aws-sdk/client-s33.1158.0 and its@aws-sdk/*and@smithy/*dependencies, which the 3.x downloader uses fors3://URLsyargs18.2.0 tree for@mongodb-js/oidc-mock-provider@mongodb-js/mongodb-downloader1.1.9 → 3.0.5@mongodb-js/oidc-mock-provider0.13.7 → 0.13.20@peculiar/x5091.14.3 → 2.2.0, the@peculiar/asn1-*packages 2.6.0 → 2.11.1,asn1js3.0.7 → 3.1.0,pvutils1.1.5 → 1.2.0file-type5.2.0 → 21.3.4,seek-bzip1.0.6 → 2.0.0 (itscommander2.20.3 → 6.2.1),strip-dirs2.1.0 → 3.0.0@mongodb-js/saslprep1.4.6 → 1.6.1: no runtime code change (type declaration and package metadata only). Also used by Parse Server'smongodbdriver (^1.3.0).mongodb-connection-string-url7.0.1 → 7.0.2: error messages no longer include the connection string, and connection strings with an@after the host list are rejected. Also used by Parse Server'smongodbdriver (^7.0.0). The connection string that browser control passes to Parse Server (mongodb://127.0.0.1:<port>/) is unaffected.get-east-asian-width1.4.0 → 1.7.0: internal function rename with a compatibility alias, lookup data moved to a separate file. Also used by thestring-widthofsemantic-release(^1.0.0).mongodbdriver 7.1.0 (hoisted), andtar7.5.22, which already meets the 3.x downloader's^7.5.22.Node.js versions
^20.19.0 || ^22.12.0 || >=23(yargs18.2.0,yargs-parser22.0.0) and>=20.19.0(mongodb7.5.0).require(esm), which Node.js enables by default from 20.19.0 and 22.12.0.@mongodb-js/mongodb-downloader3.0.5 loads the ESM-only@xhmikosr/decompress11.1.4 ("type": "module", exports only./index.js) with a top-levelrequire()indist/index.js, so this applies to everyrequire('@mongodb-js/mongodb-runner'). The runner's CLI also loads the ESM-onlyyargs18; browser control does not use the CLI.engines.node(>=20.19.0 <21.0.0 || >=22.12.0 <23.0.0 || >=24.1.0 <25.0.0) already satisfies these. Every workflow that installs dependencies runs on a compatible version:node:20.19.0-alpine3.20enginesis unchanged.@mongodb-js/mongodb-runner(formerlymongodb-runner) 6.7.3 → 8.4.3mongodb-js/devtools-shared publishes no release notes for this package, so these entries come from the commit history of
packages/mongodb-runner. Versions not listed contain only dependency or release tooling updates.yargsfrom 17 to 18 (chore(deps): bump yargs from 17.7.2 to 18.0.0 mongodb-js/devtools-shared#644).@peculiar/x509from 1 to 2 (chore(deps): bump @peculiar/x509 from 1.14.2 to 2.0.0 mongodb-js/devtools-shared#669).mongodbdriver 7.2 or later (chore(deps): bump mongodb from 7.1.0 to 7.2.0 mongodb-js/devtools-shared#715).mongodattached to the parent process, in the programmatic API only; the default stays detached (chore: add option to spawn mongod attached to parent process mongodb-js/devtools-shared#773).--portflag on replica set secondaries (fix(mongodb-runner): don't leave a dangling --port flag on secondaries mongodb-js/devtools-shared#821).mongodbdriver 7.5 or later (chore: bump mongodb and bson dependencies mongodb-js/devtools-shared#829).MONGODB_RUNNER_DOWNLOAD_DIRenvironment variable as a fallback download directory (feat(mongodb-runner): add download dir as env, cache mongodb download on windows ci COMPASS-10932 mongodb-js/devtools-shared#856).@mongodb-js/mongodb-runner(chore(mongodb-runner): add @mongodb-js namespace to the package name mongodb-js/devtools-shared#871).@mongodb-js/mongodb-downloaderto 2.0.0. The runner's CLI and API are unchanged.mongodb^7.6.0,yargs^18.2.0,@peculiar/x509^2.1.0andmongodb-connection-string-url^7.0.2.@mongodb-js/mongodb-downloader3, which supportss3://download URLs (feat(mongodb-downloader): handle s3:// download URLs MONGOSH-3622 mongodb-js/devtools-shared#900).mongodbdriver andbsonupgrades for MongoDB 4.2 compatibility (chore(dependencies): revert bson/mongodb upgrades because they break compatibility with MongoDB 4.2 mongodb-js/devtools-shared#907).--auth, and cleans up after a failed start (fix(mongodb-runner): tolerate unauthorized metadata bookkeeping and clean up on failed start MONGOSH-3619 mongodb-js/devtools-shared#909, fix(mongodb-runner): only tolerate unauthorized metadata writes for --auth spawned servers MONGOSH-3619 mongodb-js/devtools-shared#917).mongodbdriver to~7.5.0(Revert "feat(mongodb-runner): remove support for 4.2 servers" mongodb-js/devtools-shared#919).--jsonoutput tostartandls(feat(mongodb-runner): add --json output to start and ls mongodb-js/devtools-shared#923).--slsDirto locate the DSC directory (feat(mongodb-runner): locate the DSC directory with --slsDir mongodb-js/devtools-shared#913).@mongodb-js/mongodb-downloader3.0.3, which replacesdecompresswith@xhmikosr/decompress(fix(mongodb-downloader): replace decompress with maintained @xhmikosr/decompress mongodb-js/devtools-shared#927).@mongodb-js/mongodb-downloader3.0.5. It resolves download URLs with@mongodb-js/mongodb-artifact-url, the renamedmongodb-download-url(chore: rename mongodb-build-info, mongodb-ns, mongodb-redact and mongodb-download-url (to mongodb-artifact-url) to @mongodb-js scope COMPASS-11197 mongodb-js/devtools-shared#932).@mongodb-js/mongodb-downloader1.1.9 → 3.0.5s3://URLs through the AWS SDK;http(s)://URLs still usenode-fetch, the downloader's nested 2.7.0 copy, which is unchanged in the lock file (feat(mongodb-downloader): handle s3:// download URLs MONGOSH-3622 mongodb-js/devtools-shared#900).decompresswith@xhmikosr/decompress(fix(mongodb-downloader): replace decompress with maintained @xhmikosr/decompress mongodb-js/devtools-shared#927).@mongodb-js/mongodb-artifact-url2, the renamedmongodb-download-url(chore: rename mongodb-build-info, mongodb-ns, mongodb-redact and mongodb-download-url (to mongodb-artifact-url) to @mongodb-js scope COMPASS-11197 mongodb-js/devtools-shared#932). The URL resolver's only logic changes concernlatest-alphabuilds and Linux arm64 detection. Browser control requests an explicit version (MONGO_VERSION, default8.0.4).Breaking Changes
None. The runner is a development dependency, and browser control works unchanged with the code change below.
Code Changes Required
Parse-Dashboard/browser-control/setup.js: loadsMongoClusterfrom@mongodb-js/mongodb-runnerinstead ofmongodb-runner.Parse-Dashboard/browser-control/README.md: names the new package.Testing
CI does not exercise the runner: no test or workflow starts MongoDB through it, and the Jest tests (
src/lib) don't load browser control. Tested locally on macOS (arm64) with Node.js 22.19.0:npm ci --ignore-scriptssucceeds with the new lock file, andeslintpasses forsetup.js.setupBrowserControl()fromsetup.js, with browser control enabled, a temporary directory and a free port:@mongodb-js/mongodb-runner8.4.3MONGO_VERSION) and extracted its.tgzarchivewaitForMongoconnected on the first attempt, and a write and read through themongodbdriver succeededcleanup(); nomongodprocess remainedSummary by CodeRabbit