fix: check latest release LTS status for version support#8787
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website Please review the changes when you have a chance. Thank you! 🙏 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8787 +/- ##
=======================================
Coverage 75.26% 75.26%
=======================================
Files 105 105
Lines 9242 9247 +5
Branches 326 329 +3
=======================================
+ Hits 6956 6960 +4
- Misses 2284 2285 +1
Partials 2 2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
Updates the release-status generation logic used by the site’s build-time release data so that a major line is only labeled as LTS (Active/Maintenance) when the most recent release for that major is actually marked as LTS, preventing premature “LTS” labeling (and helping fix /download/current badge/status issues).
Changes:
- Gate
Active LTS/Maintenance LTSstatuses onlatest.lts.isLtsin addition to the schedule date checks. - Adjust
getNodeReleaseStatusto accept the latest release object (instead of anowargument) and computenowinternally.
Comments suppressed due to low confidence (1)
apps/site/next-data/generators/releaseData.mjs:27
- The new LTS-gating behavior isn’t covered by tests. There is an existing unit test for
generateReleaseData, but it doesn’t includeltson the mocked latest release (and will likely fail once the null-safety issue is fixed). Add/adjust test cases to cover: (1) schedule indicates LTS/maintenance but latest release is not marked LTS => status remainsCurrent; (2) latest release marked LTS => status becomesActive LTS/Maintenance LTSas appropriate.
if (latest.lts.isLts && ltsStart && now >= new Date(ltsStart)) {
return 'Active LTS';
}
if (currentStart && now >= new Date(currentStart)) {
return 'Current';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Build Size ComparisonSummary
Changes➕ Added Assets (2)
➖ Removed Assets (2)
|
| if ( | ||
| latest.lts.isLts && | ||
| maintenanceStart && | ||
| now >= new Date(maintenanceStart) |
There was a problem hiding this comment.
We should only use the date to determine if a release line is EOL. The maintenance status is going away, it's not supposed to be a user-facing information, and index.json tells you if a release line is LTS without needing to compare dates with the schedule.
There was a problem hiding this comment.
@MattIPv4 can you please change this to remove the maintenance piece then? Or somehow be able to simplify it?
There was a problem hiding this comment.
@aduh95 Can you file a separate issue to track that maintenance LTS is going away, and that this needs updating?
Description
Adds an additional condition that the most recent release for a major must be marked as an LTS release before we will show it as LTS on the site, beyond the date check. This ensures that we don't preemptively show a release as LTS when it does not yet have an LTS release, even if we are past the date in the support schedule where it should be LTS.
Validation
Current release shows.
Before:
After:
Related Issues
Fixes #8786
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.