fix(schematics): read the signed-in Firebase account on firebase-tools 15.26+ - #3769
Open
armando-navarro wants to merge 1 commit into
Open
armando-navarro wants to merge 1 commit into
armando-navarro wants to merge 1 commit into
Conversation
firebase-tools 15.26 runs non-interactively when it detects an AI agent or when stdin is not a terminal, and in that mode login() returns undefined instead of the signed-in account. `ng add` and `ng deploy` crashed reading `.email` from it. getActiveAccount passes `interactive: true`, which returns the account without a prompt once one is signed in. The `firebase login` and `firebase login:add` commands setup starts get `--interactive` for the same reason. Setup no longer passes its options to login(), since they carry the Angular project name, which firebase-tools rejects as a project id for names like `myApp`. The Quickstart stops telling readers to install firebase-tools 14. Fixes angular#3768
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.
Fixes #3768
firebase-tools 15.26 switches to non-interactive mode when it detects an AI agent, and in that mode
login()returnsundefinedinstead of the signed-in account.ng addandng deployread.emailfrom that result and crash.Changes
getActiveAccounthelper insrc/schematics/firebaseTools.tspassesinteractive: truetologin(). With an account signed in,login()returns it before any prompt, on firebase-tools 14 and 15.login(). Those options carry the Angular project name, which firebase-tools checks as a Firebase project ID, so a project namedmyAppstopped setup withInvalid project id: myApp.on any firebase-tools version.firebase loginandfirebase login:addcommands setup starts get--interactive, so under an agent they sign the person in instead of printing remote sign-in steps.firebase loginleaves no account signed in, setup says to runfirebase logininstead of crashing.ng deploysigns in only when no account is listed, stops with the same kind of message if none is afterward, and reads the account through the helper.login()is typed as possiblyundefined, so the compiler flags an unguarded.emailread.ng addyourself rather than through an AI agent, and to run it again if it already stopped.Verification
ng addsetup against a real Firebase project reached the account, project and app questions with:AI_AGENTandCLAUDECODEset, which crashed before this change--project=myApp, setup now gets past the account question, where it previously stopped withInvalid project id: myApp.ng add @angular/fire@nextinstalls today (21.0.0-rc.1-canary.95b3de1, built from the same commit as 21.0.0-rc.1), after a run that crashed under an agent, runningng addagain without the agent variables completed setup. The crashed run left only an emptyfirebase.json.ng deployspecs cover theinteractiveflag, anundefinedresult for a signed-in account, and the no-account message.npm run test:nodeafter a full build: 334 specs, 0 failures.userPrompthas no spec, because the spec runner loads files as ES modules andprompts.tscallsrequire()when it loads.