chore: upgrade firebase-admin and firebase-functions in E2E tests#10793
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
There was a problem hiding this comment.
Code Review
This pull request upgrades firebase-admin to ^13.10.0 across multiple test suites and adds --legacy-peer-deps to several installation scripts to prevent peer dependency conflicts. The review feedback highlights that several test suites (such as extensions-emulator-tests, functions-deploy-tests, and test-project) upgraded firebase-admin but did not update their installation scripts to use --legacy-peer-deps, which will cause peer dependency conflicts. Additionally, it is recommended to use npm ci --legacy-peer-deps instead of npm install --legacy-peer-deps in scripts/triggers-end-to-end-tests/run.sh for consistency and faster, more reliable builds.
This PR addresses vulnerabilities in E2E tests by upgrading dependencies and fixing compatibility issues:
Updates:
firebase-adminto^13.10.0and@google-cloud/pubsubto^5.3.1in E2E tests to fix nested vulnerabilities (specificallyprotobufjsanduuid) without using forced overrides.firebase-functionsto^7.2.5(latest) across most E2E test directories:scripts/triggers-end-to-end-tests/triggers/scripts/triggers-end-to-end-tests/v1/scripts/triggers-end-to-end-tests/v2/scripts/webframeworks-deploy-tests/functions/scripts/extensions-emulator-tests/functions/scripts/test-project/functions/scripts/functions-discover-tests/fixtures/yarn-workspaces/packages/functions/scripts/functions-deploy-tests/functions/--legacy-peer-depsfrom E2E runner scripts (triggers-end-to-end-tests,webframeworks-deploy-tests,extensions-emulator-tests,functions-deploy-tests) since upgrading bothfirebase-functionsandfirebase-adminresolved the peer dependency conflicts at the package level."firebase-functions/v1"intriggers-end-to-end-tests/v1/index.jsandfunctions-deploy-tests/functions/fns.jsbecausefirebase-functionsv7 root namespaces default to v2, causing v1 extraction to fail.@firebase/appruntime error: Removed the outdated@firebase/database-compat@0.1.2dependency fromtriggersandv1packages to ensure only a single version of@firebase/appis resolved in the tree.Emulator Tests Exception:
scripts/emulator-tests/functions/package.jsonatfirebase-functions: ^5.1.0(and retained--legacy-peer-depsinscripts/emulator-tests/run.sh).functionsEmulatorRuntime.spec.ts) that dynamically generate function definitions usingrequire("firebase-functions")and expect v1 APIs at the root. Rewriting all these tests to load/v1is out of scope for this PR. Testing the emulators with v5 functions remains valid.