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

Improve handling of bad versions during ext:install #5305

Merged
merged 5 commits into from Dec 6, 2022
Merged

Conversation

joehan
Copy link
Contributor

@joehan joehan commented Dec 5, 2022

Description

Noticed that ext:install was not working correctly for stripe/firestore-stripe-payments, because there was a badly formed extension in our backend that did not have a version number. I'm gonna investigate that, but figured I should also make this code less brittle.

@joehan joehan requested a review from elvisun December 5, 2022 23:19
@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2022

Codecov Report

Base: 56.28% // Head: 56.30% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (cbe8948) compared to base (5712978).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5305      +/-   ##
==========================================
+ Coverage   56.28%   56.30%   +0.01%     
==========================================
  Files         310      310              
  Lines       20860    20863       +3     
  Branches     4236     4236              
==========================================
+ Hits        11742    11747       +5     
+ Misses       8101     8099       -2     
  Partials     1017     1017              
Impacted Files Coverage Δ
src/deploy/extensions/planner.ts 51.28% <100.00%> (+0.63%) ⬆️
src/extensions/extensionsHelper.ts 62.68% <100.00%> (+0.22%) ⬆️
src/emulator/auth/state.ts 85.43% <0.00%> (+0.56%) ⬆️

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -834,13 +834,17 @@ export async function diagnoseAndFixProject(options: any): Promise<void> {
* 2. Infer "latest" as the version if not provided
*/
export async function canonicalizeRefInput(extensionName: string): Promise<string> {
Copy link
Contributor

Choose a reason for hiding this comment

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

the word "name" has lost its value (at least to me...) consider naming this input and the variable inferredRef

extensionVersion("0.1.0"),
extensionVersion("0.1.1"),
extensionVersion("0.2.0"),
extensionVersion(), // Explicitly test that this doesn't break on bad data
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 👍

@joehan joehan enabled auto-merge (squash) December 6, 2022 18:16
@joehan joehan merged commit 4c92149 into master Dec 6, 2022
@joehan joehan deleted the jh-fix-secrets branch December 6, 2022 18:57
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.

None yet

3 participants