Skip to content

fix(ranges): leave empty security and LTS fields undefined instead of "undefined" - #92

Merged
bnb merged 12 commits into
mainfrom
bnb/ranges-security-fields
Oct 20, 2026
Merged

bnb merged 12 commits into
mainfrom
bnb/ranges-security-fields

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

Stacked on #91.

current, lts/latest and lts/maintenance (and lts/active, which copies from them) built oldestSecurity, newestSecurity, oldestLts and newestLts with template literals like `${data[line].security.oldest}`. When a line hasn't had a security release yet, core leaves that value undefined, so ranges returned the string "undefined". With core's snapshot data at its snapshot time, for example, current.oldestSecurity was "undefined".

Changed: ranges assigns core's values directly, so a missing value is undefined and drops out of JSON, the same way core leaves out missing data. The fill-once guards now check versions.length === 1. The old checks only worked because the fields always became strings, and without this a later line could fill them in (e.g. current picking up 0.12.15 on 2016-06-23). The README says empty fields are undefined.

Added: ranges/test/emptyFields.test.js, covering a Current line with no security releases, an LTS line with none, the first-line guard, missing LTS fields with made-up data, and a sweep checking that no field is ever "undefined". All five fail on the old code.

Old and new output match for every day from 2015-09-08 to 2026-10-20 across seven filters, except where the old output had "undefined".

ovflowd and others added 6 commits October 19, 2026 14:32
Starting with 27.x, every Node.js release line gets Alpha releases,
versioned as `vN.0.0-alpha.X.Y.Z`, before its first Current release,
and schedule.json has an `alpha` date for it.

Releases now keep their pre-release identifiers. Coercing them turned
every Alpha release into `vN.0.0`, so they would overwrite each other,
and `vN.0.0` itself once it ships. Every release has an `alpha.isAlpha`
flag, like `lts.isLts`, and `support.phases` has the `alpha` date, with
`alpha` as the current phase until the release line becomes Current.

Release lines on the previous schedule get the same data as before,
besides `alpha.isAlpha` being `false` on their releases. This holds for
all 872 releases in today's index.json.

Refs: https://nodejs.org/en/blog/announcements/evolving-the-nodejs-release-schedule
Refs: nodejs/nodejs.org#9223

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
…thers

Node.js 27 starts shipping vN.0.0-alpha.X.Y.Z releases before a line's
first Current release. ranges now skips them everywhere except a new
`alpha` range, which lists the alphas of a line in its Alpha phase, so
`all.newest` stays the newest stable release. ranges also takes an
optional second `options` argument that it passes to @nodevu/core, and
depends on the 1.0.0 workspace versions of core and aliases.
the ranges tests fetched the live index.json and schedule.json and used
today's clock, so they broke whenever the real schedule left a range
empty. on 2026-10-20 no line is in Active LTS, which made lts/latest
disappear and failed 5 tests.

add test/fixtures.js, which serves core's checked-in snapshots filtered
to 2025-09-01 and throws on any other URL. pass it to every ranges call,
reuse it in alpha.test.js, add a test that pins each range's
newest/oldest/security/lts values on that date, scope the test scripts
to *.test.js, and widen the tests-ranges workflow path filter to
ranges/** and core's snapshot data.
… "undefined"

current, lts/latest and lts/maintenance built their security and LTS fields
with template literals, so a line without a security release (or LTS data)
got the string "undefined". assign core's values directly instead, and only
fill the fields from the first line in each range by checking the versions
count, since the old guards relied on the field never being undefined again.
@botandbang
botandbang changed the base branch from bnb/ranges-test-fixtures to bnb/ranges-alpha October 20, 2026 22:09
Base automatically changed from bnb/ranges-alpha to main October 20, 2026 22:15
@botandbang
botandbang changed the base branch from bnb/ranges-alpha to main October 20, 2026 22:15
@bnb
bnb merged commit 933eff1 into main Oct 20, 2026
6 checks passed
@bnb
bnb deleted the bnb/ranges-security-fields branch October 20, 2026 22:43
@github-actions github-actions Bot mentioned this pull request Oct 20, 2026
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.

3 participants