Skip to content

Conversation

@MattIPv4
Copy link
Member

@MattIPv4 MattIPv4 commented Oct 21, 2025

Description

There is no Active LTS release currently, just Current + Maintenance LTS releases, causing the main download page to render no content as it cannot find an Active LTS release. This updates the logic to allow an array of release statues to be passed in, with the provider trying to find a release with a matching status in the order they're provided in (e.g. it'll pick an Active LTS release even if it is after a Maintenance LTS release).

Validation

/en/download and /en/download/current load.

Related Issues

Resolves #8248

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@MattIPv4 MattIPv4 requested a review from a team as a code owner October 21, 2025 01:21
Copilot AI review requested due to automatic review settings October 21, 2025 01:21
@vercel
Copy link

vercel bot commented Oct 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Oct 21, 2025 1:29am

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the WithNodeRelease component to support fallback behavior when searching for Node.js releases by status. Instead of accepting only a single status string, the component now accepts an array of statuses and attempts to find a matching release in order, returning the first match found.

  • Changed the release matching logic from a single find() call to a loop that tries multiple statuses in priority order
  • Updated call sites to pass an array of statuses (['Active LTS', 'Maintenance LTS']) to enable fallback from Active LTS to Maintenance LTS

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
apps/site/components/withNodeRelease.tsx Refactored matching logic to iterate through status array and return first match
apps/site/components/withFooter.tsx Updated to pass array of statuses for fallback behavior
apps/site/components/withDownloadSection.tsx Updated to pass array of statuses for fallback behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.37%. Comparing base (6c49a09) to head (1478715).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/site/scripts/orama-search/get-documents.mjs 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8251      +/-   ##
==========================================
+ Coverage   76.24%   76.37%   +0.13%     
==========================================
  Files         115      115              
  Lines        9643     9647       +4     
  Branches      318      318              
==========================================
+ Hits         7352     7368      +16     
+ Misses       2289     2277      -12     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MattIPv4 MattIPv4 added the fast-track Fast Tracking PRs label Oct 21, 2025
@MattIPv4
Copy link
Member Author

Requesting fast-track on the basis this is an emergency fix, not sure I even need to request fast-track for that

@bmuenzenmeyer bmuenzenmeyer merged commit 6af8e13 into main Oct 21, 2025
16 checks passed
@bmuenzenmeyer bmuenzenmeyer deleted the MattIPv4/fix-active-lts-with-release branch October 21, 2025 01:30
@targos
Copy link
Member

targos commented Oct 21, 2025

"Active" and "Maintenance" LTS stages are important to the Release WG, not really for the public. The website should only care about what is the latest LTS, i.e. the one with the highest version number.

const matchingRelease = releaseData.find(release =>
[status].flat().includes(release.status)
);
let matchingRelease: NodeRelease | undefined;
Copy link
Member

Choose a reason for hiding this comment

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

nit: could we do a folllo-up PR that doesn't do for and uses proper built-ins to match the repo convention style? cc @nodejs/nodejs-website

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure there is a built-in that can do what this is doing? No array methods have a break equivalent?

Copy link
Member

Choose a reason for hiding this comment

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

I mean what we were doing before, Using array.find()

Copy link
Member Author

Choose a reason for hiding this comment

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

No? The old logic was iterating over release data so you can do a find to early return a match from it. The new logic iterates over status but early returns a value from release data, which I don't believe can be done cleanly with array methods?

const releaseData = await provideReleaseData();

const matchingRelease = releaseData.find(release =>
[status].flat().includes(release.status)
Copy link
Member

Choose a reason for hiding this comment

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

The original code would have worked fine, there was no need to refactor this?

Copy link
Member Author

Choose a reason for hiding this comment

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

No? If there was a Maintenance LTS release in the array before an Active LTS release, the old logic would have picked the Maintenance LTS release. The new logic ensures we've looked at the whole array for an Active LTS release before switching to a Maintenance LTS.

Copy link
Member

Choose a reason for hiding this comment

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

True, that was an oversight. But I'd still wage over not using for statements within a React component.

Copy link
Member Author

@MattIPv4 MattIPv4 Oct 21, 2025

Choose a reason for hiding this comment

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

Given the context of this fix, I'd prefer for robust logic over using newer language syntax, a for loop works perfectly fine and really is doing nothing fundamentally different.

@bmuenzenmeyer
Copy link
Contributor

"Active" and "Maintenance" LTS stages are important to the Release WG, not really for the public. The website should only care about what is the latest LTS, i.e. the one with the highest version number.

@targos - agree!

Attendees of Collab Summit talked about this during - openjs-foundation/summit#469 - so hopefully in the nearish future we will introduce more clarity for users and simplicity for the website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-track Fast Tracking PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download page is blank

6 participants