Skip to content

Conversation

@nzws
Copy link
Contributor

@nzws nzws commented Nov 5, 2025

Description

Updates @google-cloud/pubsub to v5 in order to remove the dependency on [email protected], which has a published critical vulnerability (GHSA-fjxv-7rqg-78g4).

# Before
❯ npm why form-data
[email protected]
node_modules/form-data
  form-data@"^4.0.1" from the root project
  form-data@"^4.0.0" from [email protected]
  node_modules/superagent
    superagent@"^7.1.3" from [email protected]
    node_modules/supertest
      dev supertest@"^6.2.3" from the root project
  form-data@"^4.0.4" from @types/[email protected]
  node_modules/@types/node-fetch
    dev @types/node-fetch@"^2.6.13" from the root project

[email protected]
node_modules/@types/request/node_modules/form-data
  form-data@"^2.5.0" from @types/[email protected]
  node_modules/@types/request
    @types/request@"^2.48.8" from [email protected]
    node_modules/@google-cloud/pubsub/node_modules/retry-request
      retry-request@"^7.0.0" from [email protected]
      node_modules/@google-cloud/pubsub/node_modules/google-gax
        google-gax@"^4.3.3" from @google-cloud/[email protected]
        node_modules/@google-cloud/pubsub
          @google-cloud/pubsub@"^4.11.0" from the root project

# After
❯ npm why form-data
[email protected]
node_modules/form-data
  form-data@"^4.0.1" from the root project
  form-data@"^4.0.4" from @types/[email protected]
  node_modules/@types/node-fetch
    dev @types/node-fetch@"^2.6.13" from the root project
  form-data@"^4.0.0" from [email protected]
  node_modules/superagent
    superagent@"^7.1.3" from [email protected]
    node_modules/supertest
      dev supertest@"^6.2.3" from the root project

The main breaking change in @google-cloud/pubsub v5 appears to be raising the minimum Node.js requirement from v14 to v18; other changes seem to be mostly cleanup of deprecated options. Since this project already requires Node.js v20 or later, there should be no problem with this update.

ref: googleapis/nodejs-pubsub#2024

Scenarios Tested

Sample Commands

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @nzws, 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 primarily focuses on enhancing the project's security posture by upgrading the @google-cloud/pubsub library to its latest major version, v5. This crucial update eliminates a known critical vulnerability associated with an older form-data dependency, ensuring the project remains secure without introducing any compatibility issues, as the existing Node.js environment already meets the new version's requirements.

Highlights

  • Dependency Update: Updated the @google-cloud/pubsub library from version ^4.11.0 to ^5.2.0.
  • Security Vulnerability Resolution: This update addresses a critical security vulnerability (GHSA-fjxv-7rqg-78g4) by removing the dependency on [email protected].
  • Node.js Compatibility: The new @google-cloud/pubsub v5 requires Node.js v18+, which is fully compatible with this project's existing Node.js v20+ requirement, ensuring no breaking changes in the runtime environment.
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 updates the @google-cloud/pubsub dependency to version 5, successfully addressing a critical security vulnerability in a transitive dependency ([email protected]). Your analysis of the breaking changes in the new major version is spot on; the project's existing usage of the library is not affected by the changes, primarily because the project already requires a Node.js version that meets the new minimum and does not use the deprecated options that were removed. The change is correct and well-contained.

@nzws nzws force-pushed the update-google-cloud-pubsub-to-v5 branch from 4aa26b6 to 325f698 Compare November 5, 2025 03:39
@bkendall
Copy link
Contributor

bkendall commented Nov 5, 2025

Honestly, good idea. Assuming the tests run okay, don't see a reason we can't do this!

@nzws nzws force-pushed the update-google-cloud-pubsub-to-v5 branch from 325f698 to 6e9c2e4 Compare November 5, 2025 04:02
@nzws
Copy link
Contributor Author

nzws commented Nov 5, 2025

https://github.com/firebase/firebase-tools/actions/runs/19090483761/job/54540317859?pr=9428

Hmm... I ran the tests on my local environment (node v20.19.4) as well, but couldn’t reproduce the failure.
@bkendall Thanks for checking! This is my first contribution to the project — do flaky tests happen often?

@bkendall
Copy link
Contributor

bkendall commented Nov 5, 2025

I'm getting the additional tests run - don't force-push your branch any more 'cause it makes it harder for me to track and do it. But this seems reasonable enough so it should be able to get merged in soon. :)

@bkendall bkendall merged commit a83b519 into firebase:master Nov 5, 2025
46 checks passed
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Nov 5, 2025
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.

2 participants