Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for migrating Cloud Functions from V1 to V2 by adding upgrade metadata types (UpgradeState, UpgradeInfo) and implementing five new API wrapper functions in cloudfunctionsv2.ts (setupFunctionUpgradeConfig, redirectFunctionUpgradeTraffic, rollbackFunctionUpgradeTraffic, commitFunctionUpgradeAsGen2, and abortFunctionUpgrade), along with corresponding unit tests. The feedback suggests extracting a shared helper, wrapUpgradeError, to unify the error-wrapping logic across these five new API wrappers and preserve the HTTP status code from the underlying API errors, aligning with the repository's style guide on harmonizing utilities.
wandamora
force-pushed
the
morawand/gcfv1-upgrade-api-wrapper
branch
2 times, most recently
from
November 19, 2026 19:59
cdc4100 to
7ac0928
Compare
Adds GCF v2 generation upgrade API client wrappers, types, and backend endpoint mapping for upgrading GCF 1st Gen functions to 2nd Gen. Includes: - GCFv2 API wrappers for generation upgrade endpoints: `setupFunctionUpgradeConfig` (accepting `SetupFunctionUpgradeConfigOptions` for optional `triggerServiceAccount` and `buildConfigOverrides`), `redirectFunctionUpgradeTraffic`, `rollbackFunctionUpgradeTraffic`, `commitFunctionUpgradeAsGen2`, and `abortFunctionUpgrade`, preserving HTTP status codes in `FirebaseError`. - `UpgradeState` and `UpgradeInfo` type declarations matching GCF v2 API schemas. - `OutputCloudFunction.upgradeInfo` property and propagation to `backend.Endpoint.upgradeInfo`. - Unit test coverage in `src/gcp/cloudfunctionsv2.spec.ts`. - Unit tests verifying endpoint paths, payloads (including `SetupFunctionUpgradeConfigOptions`), and operation returns for all 5 upgrade RPC methods. - Unit tests verifying endpoint mapping propagates `upgradeInfo` from GCF v2 output. - Unit tests verifying `FirebaseError` wrapping preserves HTTP status, `original`, and `context`. - Full project compilation via `npm run test:compile`, lint via `npx eslint`, and formatting via `npx prettier --check`. - `npx mocha src/gcp/cloudfunctionsv2.spec.ts src/deploy/functions/backend.spec.ts`
wandamora
force-pushed
the
morawand/gcfv1-upgrade-api-wrapper
branch
from
November 19, 2026 20:00
7ac0928 to
bbfeb8c
Compare
wandamora
enabled auto-merge (squash)
November 19, 2026 23:32
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds GCF v2 generation upgrade API client wrappers, types, and backend endpoint mapping for upgrading GCF 1st Gen functions to 2nd Gen.
Includes:
setupFunctionUpgradeConfig(supporting optionaltriggerServiceAccountandbuildConfigOverrides),redirectFunctionUpgradeTraffic,rollbackFunctionUpgradeTraffic,commitFunctionUpgradeAsGen2, andabortFunctionUpgrade.UpgradeStateandUpgradeInfotype declarations matching GCF v2 API schemas.OutputCloudFunction.upgradeInfoandenvironmentproperties, and propagation tobackend.Endpoint.upgradeInfo.src/gcp/cloudfunctionsv2.spec.ts.Scenarios Tested
buildConfigOverrides), and operation returns for all 5 upgrade RPC methods.upgradeInfofrom GCF v2 output.FirebaseError.npm run test:compile.npx eslint.Sample Commands
npx mocha src/gcp/cloudfunctionsv2.spec.ts src/deploy/functions/backend.spec.ts