Skip to content

tools: fix active release line filter in core index - #1601

Merged
RafaelGSS merged 1 commit into
nodejs:mainfrom
GroophyLifefor:fix-core-index-supported-filter
Nov 20, 2026
Merged

RafaelGSS merged 1 commit into
nodejs:mainfrom
GroophyLifefor:fix-core-index-supported-filter

Conversation

@GroophyLifefor

@GroophyLifefor GroophyLifefor commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

supportedVersionAffected() is async, but it is called without await, 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.0 stay, 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.

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>
@GroophyLifefor
GroophyLifefor marked this pull request as ready for review November 19, 2026 20:12

@RafaelGSS RafaelGSS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread test/index-generator.js

const { supportedVersionAffected } = require('../tools/create_index/index_generator');

const supportedMajors = [22, 24, 26];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use semver since it's already installed to get this list.

@GroophyLifefor

GroophyLifefor commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

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.

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.

Also, which problem exactly are we trying to solve here?

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.

use semver since it's already installed to get this list.

Do you mean getting the supported lines from @pkgjs/nv in the test? I kept them fixed so the test doesn't need network.

@RafaelGSS

Copy link
Copy Markdown
Member

After reading #866, I remember what the plan was. LGTM.

@RafaelGSS
RafaelGSS merged commit c04f01a into nodejs:main Nov 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants