test: drive install script and withVersions from the shared resolver#9022
Conversation
Overall package sizeSelf size: 6.28 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.2.0 | 104.26 kB | 843.44 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
|
BenchmarksBenchmark execution time: 2026-06-22 23:45:37 Comparing candidate commit 9dfad14 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1949 metrics, 16 unstable metrics.
|
248c760 to
2395811
Compare
8a3fb87 to
297c17f
Compare
2395811 to
807757b
Compare
297c17f to
e085466
Compare
withVersions() and the install script each expand a module's declared versions into the set of folders to test/install, and the two computations drifted, so a folder could be installed but never tested (or the reverse). This adds a single resolvePluginVersions/getVersionList that both consume: per declared range it pins the lowest supported version exactly and adds the newest of every major the range spans, keyed by the bare major. Covering each major (not the raw range, which only resolves to the newest of the whole range) makes sure the floor major's latest is tested too. `*` collapses to the latest major, and an empty or unparseable entry throws instead of being skipped.
807757b to
53bd8bc
Compare
Both call sites now consume resolvePluginVersions, so the generated versions/ folders and the folders withVersions() iterates derive from one place and can no longer drift. The generator caps its mkdir/writeFile fan-out through the concurrency helper to avoid EMFILE. The resolver fills every in-between major on its own, so the lodash, ws, and mquery same-name externals that only re-stated their addHook ranges are dropped. Two peer-dependency anchors are added in their place: @apollo/server pins graphql so v5 does not resolve the 15.x that apollo-server v3 drags in, and knex installs the @vscode/sqlite3 fork its 1.x dialect requires.
e085466 to
9dfad14
Compare
cdb6978
into
BridgeAR/2026-06-22-install-concurrency-helper
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dfad14e39
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (topMajor > floor.major) add(String(topMajor), range) | ||
| } else { | ||
| for (let major = floor.major; major <= topMajor; major++) { | ||
| if (intersects(`>=${major}.0.0 <${major + 1}.0.0`, range)) add(String(major), range) |
There was a problem hiding this comment.
Preserve bounded ranges when adding major keys
For ranges that cover only part of a major, this emits the bare major and collectPackages() then installs that folder with the dependency range equal to the key. An existing hook like packages/datadog-instrumentations/src/express.js's >=4.0.0 <4.3.0 therefore creates/tests express@4, which resolves to the latest 4.x instead of the latest <4.3; the previous raw-range folder covered that upper boundary. This drops compatibility coverage for the max version inside bounded ranges and can run tests against versions outside the declaring hook.
Useful? React with 👍 / 👎.
Summary
The install script and
withVersions()now both expand versions throughresolvePluginVersions, so the generatedversions/folders and the folders the suite iterates derive from one place and cannot drift. The generator bounds itsmkdir/writeFilefan-out with the concurrency helper to avoidEMFILE.Because the resolver fills every in-between major automatically, the
lodash,ws, andmquerysame-name externals that only re-stated theiraddHookranges are dropped. Two peer-dependency anchors replace them:@apollo/serverpinsgraphqlso v5 does not resolve the 15.x that apollo-server v3 drags in, andknexinstalls the@vscode/sqlite3fork its 1.x dialect needs.Test plan
PLUGINS="mongodb" node scripts/install_plugin_modules.jsand confirm the generatedversions/mongodb@*folders match the majorswithVersions('mongodb', …)iterates.PLUGINS="fastify" npm run test:plugins) to confirm the matrix still resolves.Stacked on #9021 (resolver) → #9019 (concurrency).
Follow-up
Per self-review: remove the remaining same-name externals (
aerospikeand the other version-only self-references) soexternals.jsstops declaring the test matrix, and simplify thehonourEnvRange/pluginNamebranch once none remain.