Skip to content

feat(support-matrix): add nodeOmit to drop EOL node majors from the card#499

Open
Brooooooklyn wants to merge 2 commits into
mainfrom
feat/support-matrix-node-omit
Open

feat(support-matrix): add nodeOmit to drop EOL node majors from the card#499
Brooooooklyn wants to merge 2 commits into
mainfrom
feat/support-matrix-node-omit

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

What

Adds a nodeOmit query param to the support-matrix badge service: a comma list of Node majors to drop from the Node.js card's pills, even when the engines range still permits them (e.g. an EOL runtime like Node 25 under >=25).

  • nodeOmit=25 turns pills 22.20+ · 24.12+ · 25 · 26 into 22.20+ · 24.12+ · 26.
  • The engines string is still rendered verbatim, so the declared range is never hidden.
  • Sanitized exactly like nodeTested (whole-digit integers only; junk dropped).

Consistency

Omission is applied before coverage/gap accounting, and the headline now spans the surviving pills, so:

  • an omitted major leaves no pill and no excluded mention — it vanishes from the card;
  • omitting the floor or ceiling major no longer dangles the headline (previously >=22 + nodeOmit=26 still showed v22 → v26 with no 26 pill; now it retracts to v22 → v25).

Threaded through

lib/support-matrix/{node,query,resolve}.ts, routes.test.ts, and the /support-matrix URL-builder (components/support-matrix-builder/index.tsx).

Tests

vitest — node/query/resolve/routes suites, including boundary cases (omit floor, ceiling, all-covered majors, and an already-excluded major). Full suite: 367 passing.

Not included

Per-query edge caching for /support-matrix.{png,svg} is out of scope here — the void-platform direct-route cache key strips the query string, so it needs a platform-side fix (the static-candidate cache key), tracked separately.

🤖 Generated with Claude Code

The Node.js card derives its pills from the `engines` range, so `>=25`
renders a `25` pill even after Node 25 reaches EOL. `nodeOmit` (a comma
list of majors, sanitized like `nodeTested`) drops specified majors from
the pills entirely — no pill and no `excluded` mention — while `engines`
is still rendered verbatim, so the declared range is never concealed.

Omission is applied before coverage/gap accounting and the headline now
spans the surviving pills, so dropping the floor or ceiling major no
longer leaves a dangling `→ vN` endpoint. Threaded through the query
parser, resolver, inverse builder, and the /support-matrix URL-builder,
with unit + boundary tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48913fc61a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// An explicitly omitted (e.g. EOL) major is dropped whole — before any
// coverage/gap accounting — so it leaves no pill AND no `excluded` mention,
// whether or not the range covered it. It simply vanishes from the card.
if (omit.has(major)) continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recompute excluded gaps after omitting endpoint majors

When nodeOmit removes the original floor or ceiling, this skip hides the pill but the loop still accounts gaps across the original floor..ceiling span, so excluded prose can refer to majors outside the surviving headline. For example, engines=^22 || ^26&nodeOmit=26 renders a v22 headline with only the 22 pill, but still says Node 23, 24, 25 are excluded; omission needs to shrink the gap-accounting span to the surviving pills as well.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 59f2a5f. Gaps are now buffered and only flushed once a later surviving pill bounds them on both sides; any uncovered run trailing past the final pill is discarded. So ^22 || ^26 with nodeOmit=26 reports headline v22 and excluded: null (23/24/25 sit beyond the surviving span), and ^22 || ^24 || ^26 omit 26 lists only 23. Added two regression tests covering both.

Reviewer #499: `excluded` was computed across the original floor..ceiling
span, so omitting an endpoint major (e.g. `^22 || ^26` with 26 dropped)
left `excluded` listing majors that sit beyond the last surviving pill —
`v22` headline but `excluded: 23, 24, 25`.

Buffer uncovered majors and flush them only once a later pill bounds the
gap on both sides; discard any trailing run past the final pill. The
excluded span now shrinks together with the headline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant