Skip to content

fix(schematics): rewrite projectFromRc and add spec file - #3284

Closed
nontangent wants to merge 3 commits into
angular:mainfrom
nontangent:fix/project-from-rc-bug
Closed

nontangent wants to merge 3 commits into
angular:mainfrom
nontangent:fix/project-from-rc-bug

Conversation

@nontangent

@nontangent nontangent commented Nov 4, 2022 •

Copy link
Copy Markdown

Checklist

Description

Fix #3077 and add unit tests.

Code sample

No API changes.

@google-cla

google-cla Bot commented Nov 4, 2022

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@nontangent
nontangent marked this pull request as ready for review November 4, 2022 06:04
@nontangent

Copy link
Copy Markdown
Author

I've just signed CLA.

@davideast
davideast self-requested a review June 23, 2023 15:10
@davideast davideast self-assigned this Jun 23, 2023

@davideast davideast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nontangent Thank you so much for this contribution and I apologize for how late it took us to get to it. I'll need to test through one a bit thoroughly myself so hang tight.

@arlopezg

Copy link
Copy Markdown

I think this would fix #3309

@armando-navarro armando-navarro added bump: patch Size of the change: a fix or docs change that reaches users comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen. labels Aug 20, 2026
@armando-navarro armando-navarro added target: patch bump: patch Size of the change: a fix or docs change that reaches users and removed bump: patch Size of the change: a fix or docs change that reaches users target: patch labels Sep 28, 2026
@armando-navarro

Copy link
Copy Markdown
Collaborator

Hi @nontangent, thank you for this, and I'm sorry it sat open for four years.

You found a real bug. When .firebaserc lists the Angular project's Hosting target under more than one Firebase project, ng deploy uses whichever of those projects comes first in the file, even when projects.default is the other one.

I'm closing this PR without merging it, for two reasons:

  • The rewrite removes the ?. checks that let the current code skip missing keys, so it fails on common .firebaserc files:
  • feat(schematics): set up ng deploy in ng add for Hosting or App Hosting #3851 fixes the bug you found, ng deploy using the first project in the file, in a different way, and it replaces projectFromRc entirely. When more than one Firebase project lists the target, ng deploy no longer picks one by itself:
    • It uses the firebaseProject option when that is set to one of those projects.
    • If it is not set, it asks, when it runs in a terminal.
    • Without a terminal, it stops with an error that says how to choose.

When .firebaserc lists the target under each project, #3851 covers half of what #3077 reports, choosing between Firebase projects with firebaseProject. A firebaseHostingSite that differs from .firebaserc still stops with "in conflict", so #3077, #3076 and #3309 stay open.

Also, the code has changed considerably since you submitted this, which makes it not really work as written. It doesn't fix either part of #3077, nor #3309 as @arlopezg suggested, as far as I can tell.

Feel free to look over #3851 if you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump: patch Size of the change: a fix or docs change that reaches users comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code in schematics/deploy/builder.ts is preventing the usage of any non-default firebaseProject and firebaseHostingSite values

4 participants