-
Notifications
You must be signed in to change notification settings - Fork 816
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(cli): add defensive coding to isContainersEnabled() #6758
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6758 +/- ##
=======================================
Coverage 56.84% 56.84%
=======================================
Files 487 487
Lines 22076 22076
Branches 4414 4414
=======================================
Hits 12550 12550
Misses 8649 8649
Partials 877 877 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a nit that we don't need.
|
||
return false; | ||
const projectConfig = context.amplify.getProjectConfig(); | ||
return projectConfig?.[projectConfig?.frontend]?.config?.ServerlessContainers ?? false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO the ? after projectConfig
inside the brackets is extra, because of the LTR eval.
This commit adds optional chaining and nullish coalescing to the isContainersEnabled() function. It also stores the project config in a variable instead of parsing it multiple times.
This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Issue #, if available: #6757
Description of changes:
This commit adds optional chaining and nullish coalescing to the
isContainersEnabled()
function. It also stores the project config in a variable instead of parsing it multiple times.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.