-
Notifications
You must be signed in to change notification settings - Fork 1k
Implement validation for changing trigger types, and fixes from bug bash #3131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
inlined
approved these changes
Feb 12, 2021
export function checkForInvalidChangeOfTrigger( | ||
fn: CloudFunctionTrigger, | ||
exFn: CloudFunctionTrigger | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer throwing in place with a different error message for each case. That will help when customers come to support asking for questions (or can better explain an issue to a customer before they can reach out to support)
joehan
added a commit
that referenced
this pull request
Feb 16, 2021
* Adding onPoll option to operation-poller (#3046) * Adds onPoll option * format and remove only * improved unit test * Typescriptify functionsDeployHelper (#3059) * Typescriptifying and adding CloudFunctionTrigger type * Using funcName instead of func * formats * Typescriptifying gcp.cloudfunctions (#3060) * Typescriptifying functionsConfig (#3063) * Typescriptifying deploymentTool (#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 (#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 (#3071) * Implements core logic of running function deploys * Typescriptifying prepareFunctionsUpload (#3064) * Typescriptifying prepareFunctionsUpload, and updating filesize package to get types * fixing merge conflict * Implementing createDeploymentPlan (#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 (#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 (#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 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]>
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 validation to throw a clearly worded error before deployment when trying to change a functions trigger type in a way that would cause the deployment to fail. Also cleaning up the error messages printed when a deployment fails, and increasing the timeout on our pollers.
Scenarios Tested
Trying to change a function from https to Firestore (also tested the other direction, as well as Firestore -> Storage, they look the same):

The updated error messages printed when deployment fails - I also tested & confirmed that the redeploy command works as intended.
