Repository navigation
fixing issue 6989 #10253
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
+43
−39
Merged
fixing issue 6989 #10253
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dc3dc43
fixing issue 6989
shettyvarun268 4a116f5
Addressing Review comments
shettyvarun268 540e7f2
adding some symmetry
shettyvarun268 c98e907
Merge branch 'main' into fix/issue-6989
shettyvarun268 7eae483
nit changes
shettyvarun268 c63efa5
adding change logs and reducing the wait time to 1s
shettyvarun268 634b655
Merge branch 'main' into fix/issue-6989
shettyvarun268 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - Fixed an issue where functions deployments would silently fail (#6989) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,15 +15,15 @@ | |
| import { reconcileStudioFirebaseProject } from "./management/studio"; | ||
| import { requireAuth } from "./requireAuth"; | ||
| import { Options } from "./options"; | ||
| import { useConsoleLoggers } from "./logger"; | ||
| import { logger, useConsoleLoggers } from "./logger"; | ||
| import { isFirebaseStudio } from "./env"; | ||
|
|
||
| export interface CommandModule { | ||
| load: () => void; | ||
| } | ||
|
|
||
| export function isCommandModule(value: unknown): value is CommandModule { | ||
| return typeof value === "function" && typeof (value as any).load === "function"; | ||
|
Check warning on line 26 in src/command.ts
|
||
| } | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
|
|
@@ -38,7 +38,7 @@ | |
| export interface CLIClient { | ||
| cli: CommanderStatic; | ||
| errorOut: (e: Error) => void; | ||
| [key: string]: any; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -78,7 +78,7 @@ | |
|
|
||
| /** | ||
| * Sets an alias for a command. | ||
| * @param aliases an alternativre name for the command. Users will be able to call the command via this name. | ||
|
Check warning on line 81 in src/command.ts
|
||
| * @return the command, for chaining. | ||
| */ | ||
| alias(alias: string): Command { | ||
|
|
@@ -87,10 +87,10 @@ | |
| } | ||
|
|
||
| /** | ||
| * Sets any options for the command. | ||
| * | ||
| * @example | ||
| * command.option("-d, --debug", "turn on debugging", false) | ||
| * | ||
| * @param args the commander-style option definition. | ||
| * @return the command, for chaining. | ||
|
|
@@ -102,10 +102,10 @@ | |
| } | ||
|
|
||
| /** | ||
| * Sets up --force flag for the command. | ||
| * | ||
| * @param message overrides the description for --force for this command | ||
| * @returns the command, for chaining | ||
| */ | ||
| withForce(message?: string): Command { | ||
| this.options.push(["-f, --force", message || "automatically accept all interactive prompts"]); | ||
|
|
@@ -129,7 +129,7 @@ | |
| * | ||
| * This text is displayed when: | ||
| * - the `--help` flag is passed to the command, or | ||
| * - the `help <command>` command is used. | ||
| * | ||
| * @param t the human-readable help text. | ||
| * @return the command, for chaining. | ||
|
|
@@ -236,28 +236,28 @@ | |
| }); | ||
| } | ||
| const duration = Math.floor((process.uptime() - start) * 1000); | ||
| const trackSuccess = trackGA4( | ||
| "command_execution", | ||
| { | ||
| command_name: this.name, | ||
| result: "success", | ||
| interactive: getInheritedOption(options, "nonInteractive") ? "false" : "true", | ||
| }, | ||
| duration, | ||
| ); | ||
| if (!isEmulator) { | ||
| await withTimeout(5000, trackSuccess); | ||
| } else { | ||
| await withTimeout( | ||
| 5000, | ||
| Promise.all([ | ||
| trackSuccess, | ||
| try { | ||
| const trackSuccess = trackGA4( | ||
| "command_execution", | ||
| { | ||
| command_name: this.name, | ||
| result: "success", | ||
| interactive: getInheritedOption(options, "nonInteractive") ? "false" : "true", | ||
| }, | ||
| duration, | ||
| ); | ||
| const tracks = [trackSuccess]; | ||
| if (isEmulator) { | ||
| tracks.push( | ||
| trackEmulator("command_success", { | ||
| command_name: this.name, | ||
| duration, | ||
| }), | ||
| ]), | ||
| ); | ||
| ); | ||
| } | ||
| await withTimeout(1000, Promise.all(tracks)); | ||
| } catch (gaErr) { | ||
| logger.debug("Analytics tracking failed during success path:", gaErr); | ||
| } | ||
| process.exit(); | ||
| }) | ||
|
|
@@ -278,27 +278,30 @@ | |
| }); | ||
| } | ||
| const duration = Math.floor((process.uptime() - start) * 1000); | ||
| await withTimeout( | ||
| 5000, | ||
| Promise.all([ | ||
| trackGA4( | ||
| "command_execution", | ||
| { | ||
| try { | ||
| const trackError = trackGA4( | ||
| "command_execution", | ||
| { | ||
| command_name: this.name, | ||
| result: "error", | ||
| interactive: getInheritedOption(options, "nonInteractive") ? "false" : "true", | ||
| }, | ||
| duration, | ||
| ); | ||
| const tracks = [trackError]; | ||
| if (isEmulator) { | ||
| tracks.push( | ||
| trackEmulator("command_error", { | ||
| command_name: this.name, | ||
| result: "error", | ||
| interactive: getInheritedOption(options, "nonInteractive") ? "false" : "true", | ||
| }, | ||
| duration, | ||
| ), | ||
| isEmulator | ||
| ? trackEmulator("command_error", { | ||
| command_name: this.name, | ||
| duration, | ||
| error_type: err.exit === 1 ? "user" : "unexpected", | ||
| }) | ||
| : Promise.resolve(), | ||
| ]), | ||
| ); | ||
| duration, | ||
| error_type: err?.exit === 1 ? "user" : "unexpected", | ||
| }), | ||
| ); | ||
| } | ||
| await withTimeout(1000, Promise.all(tracks)); | ||
| } catch (gaErr) { | ||
| logger.debug("Analytics tracking failed during error path:", gaErr); | ||
| } | ||
|
shettyvarun268 marked this conversation as resolved.
Resolved
shettyvarun268 marked this conversation as resolved.
Resolved
|
||
|
|
||
| client.errorOut(err); | ||
| }); | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.