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

refactor(CLI): Report credentials source in modern error output #10114

Merged
merged 1 commit into from Oct 19, 2021

Conversation

pgrzesik
Copy link
Contributor

Addresses: #9860

@codecov
Copy link

codecov bot commented Oct 19, 2021

Codecov Report

Merging #10114 (9d49a54) into master (73c071b) will increase coverage by 0.00%.
The diff coverage is 53.84%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10114   +/-   ##
=======================================
  Coverage   85.26%   85.27%           
=======================================
  Files         334      335    +1     
  Lines       13638    13687   +49     
=======================================
+ Hits        11628    11671   +43     
- Misses       2010     2016    +6     
Impacted Files Coverage Δ
lib/cli/handle-error.js 81.08% <53.84%> (-3.77%) ⬇️
lib/serverless-error.js 100.00% <0.00%> (ø)
lib/utils/tokenize-exception.js 100.00% <0.00%> (ø)
lib/plugins/aws/package/compile/events/rabbitmq.js 100.00% <0.00%> (ø)
lib/plugins/aws/lib/naming.js 97.35% <0.00%> (+0.04%) ⬆️
lib/plugins/aws/lib/monitorStack.js 96.29% <0.00%> (+0.04%) ⬆️

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 73c071b...9d49a54. Read the comment docs.

@pgrzesik pgrzesik requested a review from medikoo October 19, 2021 13:24
if (serverless && serverless.service.provider.name === 'aws') {
const credentials = serverless.getProvider('aws').cachedCredentials;
if (credentials) {
if (credentials.dashboardProviderAlias && serverless.pluginManager.dashboardPlugin) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't checking credentials.dashboardProviderAlias be good enough?

Copy link
Contributor Author

@pgrzesik pgrzesik Oct 19, 2021

Choose a reason for hiding this comment

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

I wanted to be extra sure with checking if dashboardPlugin instance is available as well, but I think there shouldn't be any situations when that wouldn't be the case

edit: changed

@pgrzesik pgrzesik force-pushed the report-source-of-credentials-in-error-output branch from 7698bd6 to 9d49a54 Compare October 19, 2021 13:33
@pgrzesik pgrzesik requested a review from medikoo October 19, 2021 13:41
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

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

Looks great 👍

@pgrzesik pgrzesik merged commit b4ff87d into master Oct 19, 2021
@pgrzesik pgrzesik deleted the report-source-of-credentials-in-error-output branch October 19, 2021 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants