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): Adapt logWarning to modern logs #10078

Merged
merged 3 commits into from Oct 11, 2021

Conversation

pgrzesik
Copy link
Contributor

Addresses: #9860

Additionally, it adapts logInfo for completeness, but I believe it will be removed with v3 anyway as the PromiseTracker logic is only used in old variable resolver.

Additionally, it introduces warning for deploy -f alias

@@ -122,6 +123,16 @@ module.exports = (loadedPlugins, { providerName }) => {
).join('\n - ')}\n\n` +
'Please report this issue in plugin issue tracker.'
);
log.warning(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should be still a warning in new logs, I've changed the text slightly

@codecov
Copy link

codecov bot commented Oct 11, 2021

Codecov Report

Merging #10078 (861c1b3) into master (865f21f) will decrease coverage by 0.02%.
The diff coverage is 70.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10078      +/-   ##
==========================================
- Coverage   85.41%   85.38%   -0.03%     
==========================================
  Files         333      333              
  Lines       13537    13570      +33     
==========================================
+ Hits        11562    11587      +25     
- Misses       1975     1983       +8     
Impacted Files Coverage Δ
lib/classes/Service.js 85.51% <0.00%> (-0.60%) ⬇️
lib/cli/commands-schema/resolve-final.js 88.13% <33.33%> (-2.94%) ⬇️
lib/plugins/aws/package/compile/events/httpApi.js 94.90% <33.33%> (-0.87%) ⬇️
lib/cli/handle-error.js 84.84% <50.00%> (-0.87%) ⬇️
lib/plugins/deploy.js 90.47% <60.00%> (-9.53%) ⬇️
lib/classes/Error.js 95.23% <100.00%> (-0.22%) ⬇️
lib/classes/PromiseTracker.js 100.00% <100.00%> (ø)
lib/classes/Variables.js 99.47% <100.00%> (+<0.01%) ⬆️
lib/plugins/aws/remove/index.js 100.00% <0.00%> (ø)
lib/plugins/aws/provider.js 93.97% <0.00%> (+0.26%) ⬆️

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 865f21f...861c1b3. Read the comment docs.

@@ -98,6 +98,7 @@ module.exports = async (exception, options = {}) => {
// It can happen e.g. during "plugin uninstall" command, where "serverless" originally
// installed a as peer dependency was removed
logWarning('Could not resolve path to locally installed error handler');
log.warning('Could not resolve path to locally installed error handler');
Copy link
Contributor

Choose a reason for hiding this comment

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

As a user what does this mean and what should I do?

I'm asking this because I'm looking if we cannot either clarify this, turn it into an error or silence it to --verbose (if there isn't anything the user can do with the information).

Copy link
Contributor Author

@pgrzesik pgrzesik Oct 11, 2021

Choose a reason for hiding this comment

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

This is really an edge case that will happen very rarely - turning it into an error is not an option as it's part of the error handler. We can turn it into verbose log here I guess.

As a user, it doesn't really mean much and it's highly unlikely that you will see it, it's more of a guide for debugging of an error so we can also turn it into debug here I think

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, so I'd say if users cannot do anything and cannot even understand what that means verbose or debug level is probably best?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to debug 👍

@pgrzesik pgrzesik requested a review from medikoo October 11, 2021 12:44
@pgrzesik pgrzesik force-pushed the adjust-logwarning-to-modern-logs branch from 1eeeb69 to 847e51c Compare October 11, 2021 13:19
medikoo
medikoo previously approved these changes Oct 11, 2021
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 good 👍

lib/classes/Service.js Show resolved Hide resolved
Comment on lines 36 to 37
this.serverless.processedInput.commands.length === 1 &&
this.serverless.processedInput.commands[0] === 'deploy';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: it'll be more concise to:

this.serverless.processedInput.commands.join(" ") === 'deploy'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call

mnapoli
mnapoli previously approved these changes Oct 11, 2021
Copy link
Contributor

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

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

No more comments on my end

@pgrzesik pgrzesik dismissed stale reviews from mnapoli and medikoo via 861c1b3 October 11, 2021 14:09
@pgrzesik pgrzesik force-pushed the adjust-logwarning-to-modern-logs branch from 847e51c to 861c1b3 Compare October 11, 2021 14:09
@pgrzesik pgrzesik merged commit 40f574f into master Oct 11, 2021
@pgrzesik pgrzesik deleted the adjust-logwarning-to-modern-logs branch October 11, 2021 14:40
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

3 participants