Skip to content
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

Fix broken Functions CLI experience for projects with incomplete GCF 2nd Gen functions. #5684

Merged
merged 7 commits into from
Apr 13, 2023

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Apr 12, 2023

The codebase assumes that "serviceConfig" property must be present in all 2nd Gen Functions in GCF. This is an incorrect assumption - 2nd Gen GCF functions may be missing a Cloud Run service if the build never succeeded.

Also refactors backend module a bit to avoid calling out to Cloud Run to retrieve concurrency & cpu config - it's available on the GCF response now!

Fixes #4800

…ervice breaks the Functions CLI experience.

The codebase assumes that "serviceConfig" property must be present in all 2nd Gen Functions in GCF. This isn't the case - 2nd Gen GCF functions may be missing a Cloud Run service if the build never succeeded.
@taeold taeold changed the title Fix bug where broken 2nd Gen functions without associated Cloud Run service breaks the Functions CLI experience Fix broken Functions CLI experience for projects with incomplete GCF 2nd Gen functions. Apr 12, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 12, 2023

Codecov Report

Patch coverage: 56.00% and project coverage change: -0.04 ⚠️

Comparison is base (8370680) 55.71% compared to head (51df551) 55.67%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5684      +/-   ##
==========================================
- Coverage   55.71%   55.67%   -0.04%     
==========================================
  Files         322      322              
  Lines       21836    21846      +10     
  Branches     4454     4461       +7     
==========================================
- Hits        12166    12163       -3     
- Misses       8602     8608       +6     
- Partials     1068     1075       +7     
Impacted Files Coverage Δ
src/deploy/functions/release/fabricator.ts 77.01% <14.28%> (-3.24%) ⬇️
src/gcp/cloudfunctionsv2.ts 61.53% <69.69%> (-0.66%) ⬇️
src/deploy/functions/backend.ts 85.11% <100.00%> (+0.14%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@taeold taeold requested a review from colerogers April 13, 2023 01:02
Copy link
Contributor

@Berlioz Berlioz left a comment

Choose a reason for hiding this comment

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

LGTM

* type Bar = RequireKeys<Foo, "a" | "b">
* // Property "a" and "b" are now required.
*/
export type RequireKeys<T extends object, Keys extends keyof T> = T & {
Copy link
Member

Choose a reason for hiding this comment

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

Would you like me to make a DeepRequire like we have DeepOmit and DeepPick? Then you can say DeepRequire<Foo, "a.b" | "c">

@taeold taeold merged commit 863eeec into master Apr 13, 2023
33 checks passed
@taeold taeold deleted the dl-optional branch April 13, 2023 20:49
ProfHercules pushed a commit to ProfHercules/firebase-tools that referenced this pull request May 5, 2023
…2nd Gen functions. (firebase#5684)

The codebase assumes that "serviceConfig" property must be present in all 2nd Gen Functions in GCF. This is an incorrect assumption - 2nd Gen GCF functions may be missing a Cloud Run service if the build never succeeded.

Also refactors `backend` module a bit to avoid calling out to Cloud Run to retrieve concurrency & cpu config - it's available on the GCF response now!

Fixes firebase#4800
tonyjhuang pushed a commit that referenced this pull request May 22, 2023
…2nd Gen functions. (#5684)

The codebase assumes that "serviceConfig" property must be present in all 2nd Gen Functions in GCF. This is an incorrect assumption - 2nd Gen GCF functions may be missing a Cloud Run service if the build never succeeded.

Also refactors `backend` module a bit to avoid calling out to Cloud Run to retrieve concurrency & cpu config - it's available on the GCF response now!

Fixes #4800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undeleteable function with TypeError: Cannot read properties of undefined (reading 'service')
5 participants