Skip to content

Conversation

@jaskfla
Copy link
Contributor

@jaskfla jaskfla commented Sep 30, 2025

RN-1761

Fixes https://github.com/beyondessential/tupaia/security/dependabot/189


Note

Upgrade node-fetch to ^2.7.0 across multiple packages and update @types/node-fetch, with corresponding yarn.lock changes.

  • Dependencies:
    • Upgrade node-fetch ^1.7.3^2.7.0 in packages/api-client/package.json, packages/e2e/package.json, packages/superset-api/package.json, packages/utils/package.json.
    • Update @types/node-fetch ^2.6.11^2.6.13 in packages/api-client/package.json.
  • Lockfile:
    • Reflects updated node-fetch and @types/node-fetch, adding newer form-data and adjusting related entries.

Written by Cursor Bugbot for commit ea71981. This will update automatically on new commits. Configure here.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jaskfla, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a crucial dependency upgrade, specifically bumping the node-fetch library to version 2.7.0 across several core packages. This update is a direct response to a Dependabot security alert (RN-1761), aiming to patch known vulnerabilities and enhance the overall security posture of the application. By updating this fundamental networking dependency, the project ensures it leverages the latest security fixes and improvements, contributing to a more robust and reliable system.

Highlights

  • Dependency Update: node-fetch: The node-fetch dependency has been updated from version 1.7.3 to 2.7.0 across four different packages: api-client, e2e, superset-api, and utils.
  • Security Fix: This update addresses a security vulnerability (RN-1761) identified by Dependabot, ensuring improved security for the project.
  • TypeScript Definitions Alignment: The @types/node-fetch dependency in packages/api-client has also been updated from 2.6.11 to 2.6.13 to align with the new node-fetch version.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades node-fetch from version 1.7.3 to 2.7.0 across multiple packages, presumably to address a security vulnerability. This is a major version bump which introduces breaking changes. I've added comments to each updated package.json file highlighting the most critical changes in node-fetch v2: the requirement for absolute URLs and the removal of the timeout option. It is crucial that all call sites of node-fetch are updated to be compatible with these changes to avoid runtime errors.

"lodash.isequal": "^4.5.0",
"lodash.pick": "^4.4.0",
"node-fetch": "^1.7.3",
"node-fetch": "^2.7.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Upgrading node-fetch from v1 to v2 introduces breaking changes. Notably, node-fetch v2 requires absolute URLs for all requests and will throw an error if a relative URL is provided. Additionally, the timeout option on requests has been removed. The code using node-fetch in this package needs to be compatible with these changes to avoid runtime failures.

"lodash": "^4.17.4",
"moment": "^2.24.0",
"node-fetch": "^1.7.3",
"node-fetch": "^2.7.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Upgrading node-fetch from v1 to v2 introduces breaking changes. Notably, node-fetch v2 requires absolute URLs for all requests and will throw an error if a relative URL is provided. Additionally, the timeout option on requests has been removed. The code using node-fetch in this package needs to be compatible with these changes to avoid runtime failures.

"dependencies": {
"https-proxy-agent": "^5.0.1",
"node-fetch": "^1.7.3",
"node-fetch": "^2.7.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Upgrading node-fetch from v1 to v2 introduces breaking changes. Notably, node-fetch v2 requires absolute URLs for all requests and will throw an error if a relative URL is provided. Additionally, the timeout option on requests has been removed. The code using node-fetch in this package needs to be compatible with these changes to avoid runtime failures.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jaskfla you mentioned you've given these a quick sanity test so it's fine to ignore these warnings?

Copy link
Contributor Author

@jaskfla jaskfla Oct 2, 2025

Choose a reason for hiding this comment

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

I’ve deployed and done a smoke test, but for this one I’m gonna hold off merging until this Linear card is officially brought onto the sprint board and do more thorough dev-testing

"moment": "^2.24.0",
"moment-timezone": "^0.5.45",
"node-fetch": "^1.7.3",
"node-fetch": "^2.7.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Upgrading node-fetch from v1 to v2 introduces breaking changes. Notably, node-fetch v2 requires absolute URLs for all requests and will throw an error if a relative URL is provided. Additionally, the timeout option on requests has been removed. The code using node-fetch in this package needs to be compatible with these changes to avoid runtime failures.

cursor[bot]

This comment was marked as outdated.

@jaskfla jaskfla added the dependencies Pull requests that update a dependency file label Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants