Skip to content

Conversation

@avivkeller
Copy link
Member

This PR:

  • Fixes the nasty fetch failed issue on deployments by rewriting the fetch statements to .then().catch() format
  • Adds a missing type file
  • Moves a constant to the constants file
  • Simplifies an object creation

Copilot AI review requested due to automatic review settings December 4, 2025 23:29
@avivkeller avivkeller requested a review from a team as a code owner December 4, 2025 23:29
@vercel
Copy link

vercel bot commented Dec 4, 2025

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

Project Deployment Review Updated (UTC)
nodejs-org Ready Ready Preview Dec 18, 2025 2:12pm

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

👋 Codeowner Review Request

The 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
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 76.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.65%. Comparing base (43ffe41) to head (b680586).
⚠️ Report is 27 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/site/util/fetch.ts 64.70% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8395      +/-   ##
==========================================
- Coverage   76.40%   73.65%   -2.75%     
==========================================
  Files         118      108      -10     
  Lines        9928     9193     -735     
  Branches      334      312      -22     
==========================================
- Hits         7585     6771     -814     
- Misses       2341     2420      +79     
  Partials        2        2              

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

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 refactors data generator functions to use promise chain syntax (.then().catch()) instead of async/await, addressing fetch failures during deployments. The changes improve error handling by ensuring that failed fetch operations return safe default values instead of breaking the build.

Key Changes:

  • Refactored vulnerabilities.mjs and supportersData.mjs generators to use .then().catch() pattern with fallback values
  • Added supporters.ts type definitions file and exported it from the types index
  • Moved OPENCOLLECTIVE_MEMBERS_URL constant from inline definition to centralized next.constants.mjs

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/site/types/supporters.ts Adds type definitions for Supporter and OpenCollectiveSupporter
apps/site/types/index.ts Exports the new supporters type module
apps/site/next.constants.mjs Adds OPENCOLLECTIVE_MEMBERS_URL constant for centralized configuration
apps/site/next-data/generators/vulnerabilities.mjs Refactors async function to arrow function with promise chains and error handling
apps/site/next-data/generators/supportersData.mjs Refactors async function to arrow function with promise chains, uses centralized constant

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

📦 Build Size Comparison

Summary

Metric Value
Old Total Size 4.34 MB
New Total Size 4.34 MB
Delta 0 B (0.00%)

Changes

➕ Added Assets (1)
Name Size
.next/static/chunks/4d75ead2ba2e5654.js 204.26 KB
➖ Removed Assets (1)
Name Size
.next/static/chunks/1ebd0f9d6844fabb.js 204.26 KB

@avivkeller
Copy link
Member Author

@nodejs/nodejs-website PTAL

@avivkeller
Copy link
Member Author

avivkeller commented Dec 7, 2025

Fetch is still timing out occasionally :-/

https://vercel.com/openjs/nodejs-org/EeD4bMYCN1DPW8Zj3BEaNmq3wv1N

throw e;
}

await setTimeout(delay);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can add a backoff

Copy link
Member Author

Choose a reason for hiding this comment

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

WDYM?

Copy link
Member

@araujogui araujogui Dec 8, 2025

Choose a reason for hiding this comment

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

A retry with backoff pattern


export default fetchOpenCollectiveData;
export default () =>
fetchWithRetry(OPENCOLLECTIVE_MEMBERS_URL)
Copy link
Member

Choose a reason for hiding this comment

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

Can we please please revert the change from async functions to Promises. THANK YOU

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

Please revert unrelated changes 🙇

@ovflowd
Copy link
Member

ovflowd commented Dec 17, 2025

Bump @avivkeller

@avivkeller
Copy link
Member Author

Sorry for the delay! This must've slipped in between the cracks. I'll get this up to speed tomorrow!

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

SGTM! Good stuff!

*/
export default async function generateVulnerabilityData() {
const response = await fetch(VULNERABILITIES_URL);
const response = await fetchWithRetry(VULNERABILITIES_URL);
Copy link
Member

Choose a reason for hiding this comment

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

Let's check if the response status is ok (200) before parsing the body. Otherwise, throw error too.

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