test: add shared plugin version resolver#9021
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:42:39 Comparing candidate commit 53bd8bc in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1950 metrics, 15 unstable metrics.
|
248c760 to
2395811
Compare
|
2395811 to
807757b
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
3e4e731
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: 53bd8bc1cd
ℹ️ 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".
| 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.
Keep top-major keys inside bounded ranges
For declared ranges whose upper bound falls inside a major, this loop still emits the bare major key for that top major. For example, the existing pino hook range >=5 <6.8.0 in packages/datadog-instrumentations/src/pino.js would produce pino@6, which resolves to the latest 6.x and can be >=6.8.0, so the install/test set no longer covers the newest version below 6.8 and instead points at a version belonging to the next hook range. The same pattern exists for other sub-major ranges such as grpc and express, so the resolver needs to preserve a bounded range key (or otherwise cap the dependency) when the major is only partially included.
Useful? React with 👍 / 👎.
Summary
withVersions()and the install script each expand a module's declared version ranges into the set ofversions/<name>@<key>folders to test/install, and the two computations drifted — a folder could be installed but never tested, or vice versa. This adds oneresolvePluginVersions/getVersionListboth 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, so the floor major's latest is tested too (a raw-range key resolves only to the newest of the whole range).
*collapses to the latest major — the same version an open range resolves to — and an empty or unparseable entry throws. Folder keys becomemongodb@3rather thanmongodb@>=3.0.0 <4.0.0.The pinned
versions/package.jsonis the hard upper bound: nothing installs beyond it, the top major is derived from it, and a floor that equals the pinned latest drops the now-redundant top-major key (the one redundancy the pin lets us prove — for lower majors the newest published version is unknown without a registry lookup, so both the floor and the bare major are kept).The module is unused until the wire-up PR; it ships with its unit spec here.
Stacked on #9019 for a clean stack into the wire-up; no functional dependency on it.