Repository navigation
tools: fix active release line filter in core index - #1601
Conversation
supportedVersionAffected() is async but was called without await, so the filter never ran and index.json kept entries that only affect end-of-life release lines. Await the supported lines once and keep an entry when its range intersects a supported line, so ranges like <24.5.0 are kept. Refs: nodejs#942 Assisted-by: a closed-source coding agent Signed-off-by: Murat Kirazkaya <groophylifefor@gmail.com>
RafaelGSS
left a comment
There was a problem hiding this comment.
This fix drops the index.json entry count from 204 to 59.
I'm not sure if this is desirable. Tools such as is-my-node-vulnerable relies on index.json to work, changing it might have an impact there.
Also, which problem exactly are we trying to solve here?
|
|
||
| const { supportedVersionAffected } = require('../tools/create_index/index_generator'); | ||
|
|
||
| const supportedMajors = [22, 24, 26]; |
There was a problem hiding this comment.
use semver since it's already installed to get this list.
I fixed the async problem so the tool can generate more accurate output. If this is expected, we can update the filter too, but the current fix makes the filter apply correctly.
The filter added in #866 has never run since #942, because of the missing await. So the code says it filters EOL entries, but it doesn't.
Do you mean getting the supported lines from |
|
After reading #866, I remember what the plan was. LGTM. |
supportedVersionAffected()is async, but it is called withoutawait, so the filter never runs.This fix drops the index.json entry count from 204 to 59.
In this PR, I await the supported lines, filter by line (
24.x) so that ranges like<24.5.0stay, and add tests.I didn't include index.json in this PR to avoid breaking any unexpected behavior, so the next sync will drop it to 59 entries.
edit
Effect: index.json currently ships 145 entries (71%) that only affect EOL lines.
For supported versions nothing changes: those entries never match them, and
is-my-node-vulnerable shows the EOL warning first for EOL versions.
After the next sync, index.json shrinks from 204 to 59 entries.