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(cli): add defensive coding to isContainersEnabled() #6758

Merged
merged 1 commit into from
Mar 2, 2021
Merged

fix(cli): add defensive coding to isContainersEnabled() #6758

merged 1 commit into from
Mar 2, 2021

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Feb 27, 2021

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.

@cjihrig cjihrig requested a review from a team as a code owner February 27, 2021 20:31
@codecov
Copy link

codecov bot commented Feb 27, 2021

Codecov Report

Merging #6758 (979a6bb) into master (59d66fe) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59d66fe...979a6bb. Read the comment docs.

Copy link
Contributor

@jhockett jhockett left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@attilah attilah left a 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;
Copy link
Contributor

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.
@attilah attilah merged commit 78bb42d into aws-amplify:master Mar 2, 2021
@cjihrig cjihrig deleted the containers branch March 2, 2021 17:51
@github-actions
Copy link

github-actions bot commented Mar 3, 2022

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 *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants