Skip to content

Conversation

@joehan
Copy link
Contributor

@joehan joehan commented Feb 12, 2021

Description

Refactor of most of the functions deploy code path to use Typescript & more modern coding style, and to take advantage of new GCF features that will reduce the number of builds needed for a deployment.

All the code changes here have been reviewed in separate PRs - however, it still may be worth a quick scan through.

Scenarios Tested

A whole lot of them - I ran a large number of deploys of different combinations of creates/updates/delete on different types of functions, and we ran a bug bash. I also tested some specific situations that were likely to cause issues - new projects, projects without billing enabled, projects without the appropriate APIs enabled, etc.

joehan and others added 30 commits January 19, 2021 12:17
* Adds onPoll option

* format and remove only

* improved unit test
* Typescriptifying and adding CloudFunctionTrigger type

* Using funcName instead of func

* formats
* Typescriptifying deploymentTool

* Update src/deploymentTool.ts

Co-authored-by: Michael Bleigh <[email protected]>

Co-authored-by: Michael Bleigh <[email protected]>
* refactoring prepare setp of functions deploy to use typescript, check for failure policies, and parse function triggers

* refactoring prepare setp of functions deploy to use typescript, check for failure policies, and parse function triggers

* commenting out functionNamesAreValid

* formats
* Typescriptifying prepareFunctionsUpload, and updating filesize package to get types

* fixing merge conflict
* refactoring release step of functions deploy to use typescript

* Adding logic to build regional deployments

* Implementing createDeploymentPlan

* First round of PR feedback, removing most usages of lodash

* moving function prompts into their own file

* seperating out a bunch of code from functionsDeployHelper

* round of pr fixes

* adresses more pr comments, and adds some todos
Implements logic to execute deployment plan
* Refactoring functions delete to use tasks, and cleaning up old polling code

* Refactoring functions delete to use tasks, and cleaning up old polling code

* refactoring to use new error handling

* cleanup unused imports

* small style fixes
This was referenced Mar 12, 2021
@rhodgkins
Copy link
Contributor

Not sure if this is the right place (have also commented in #2060) but still getting the quota errors 40-60% of the time when deploying 80 functions.

taeold added a commit that referenced this pull request Apr 8, 2021
)

Today, we unexpectedly delete environment variables on existing Cloud Functions when updating functions via `firebase deploy --only functions` command #3226. This regression was introduced in #3132.

### Scenarios Tested
1. Manually setup an environment variable using Google Cloud Console on a firebase function.
2. Run `firebase deploy --only functions` to update the existing function.
3. Notice that existing environment variable isn't wiped out as a result of the new deploy.
@bkendall bkendall deleted the jh-functions-refactor branch August 4, 2021 19:26
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
* Adding onPoll option to operation-poller (firebase#3046)

* Adds onPoll option

* format and remove only

* improved unit test

* Typescriptify functionsDeployHelper (firebase#3059)

* Typescriptifying and adding CloudFunctionTrigger type

* Using funcName instead of func

* formats

* Typescriptifying gcp.cloudfunctions (firebase#3060)

* Typescriptifying functionsConfig (firebase#3063)

* Typescriptifying deploymentTool (firebase#3061)

* Typescriptifying deploymentTool

* Update src/deploymentTool.ts

Co-authored-by: Michael Bleigh <[email protected]>

Co-authored-by: Michael Bleigh <[email protected]>

* Refactoring prepare stage of functions deploy (firebase#3067)

* refactoring prepare setp of functions deploy to use typescript, check for failure policies, and parse function triggers

* refactoring prepare setp of functions deploy to use typescript, check for failure policies, and parse function triggers

* commenting out functionNamesAreValid

* formats

* refactoring release step of functions deploy to use typescript

* Adding logic to build regional deployments

* Implementing createDeploymentPlan

* First round of PR feedback, removing most usages of lodash

* moving function prompts into their own file

* seperating out a bunch of code from functionsDeployHelper

* Resolves merge conflicts

* refactoring release step of functions deploy to use typescript (firebase#3071)

* Implements core logic of running function deploys

* Typescriptifying prepareFunctionsUpload (firebase#3064)

* Typescriptifying prepareFunctionsUpload, and updating filesize package to get types

* fixing merge conflict

* Implementing createDeploymentPlan (firebase#3081)

* refactoring release step of functions deploy to use typescript

* Adding logic to build regional deployments

* Implementing createDeploymentPlan

* First round of PR feedback, removing most usages of lodash

* moving function prompts into their own file

* seperating out a bunch of code from functionsDeployHelper

* round of pr fixes

* adresses more pr comments, and adds some todos

* cleaning up unused code

* Fixing some things that were broken while merging

* Fixing up the order of wait and close to ensure that queue promsies actually resolve

* Format and clean up typos

* refactoring error handling to be cleaner

* cleaning up extera newlines

* first round of pr fixes

* Readding some changes that I accidenttally wiped out during a merge

* Switching name to id where appropriate

* fixing another bug caused by functionName vs Id

* Refactor functions-delete  (firebase#3110)

* Refactoring functions delete to use tasks, and cleaning up old polling code

* Refactoring functions delete to use tasks, and cleaning up old polling code

* refactoring to use new error handling

* cleanup unused imports

* small style fixes

* Cleaning up error reporting

* Implement validation for changing trigger types, and fixes from bug bash (firebase#3131)

* Implement validation for changing trigger types, and fixes from bug bash

* more specifc error messages for different permutations of trigger types

* fixes package.json

Co-authored-by: Michael Bleigh <[email protected]>
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
* adding changelog for functions refactor

* formats
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
…rebase#3266)

Today, we unexpectedly delete environment variables on existing Cloud Functions when updating functions via `firebase deploy --only functions` command firebase#3226. This regression was introduced in firebase#3132.

### Scenarios Tested
1. Manually setup an environment variable using Google Cloud Console on a firebase function.
2. Run `firebase deploy --only functions` to update the existing function.
3. Notice that existing environment variable isn't wiped out as a result of the new deploy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Manual indication that this has passed CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants