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
Add SLS_NO_WARNINGS env var #6345
Conversation
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.
Hey @domcorvasce thanks for working on this 👍
I'd propose that we change the environment variable to SLS_WARNINGS
so that it sticks to the naming conventions we've established for our ENV vars.
Furthermore we might want to add some documentation for this feature (AFAIK SLS_DEBUG
is listed in the --help
screen and we're talking about that feature in our docs).
@medikoo what do you think?
As we have warnings on by default, I think
As a temporary mean, we can take it in, but for a final solution I think it'll be way better to switch to some better logging solution. One which provides us with log levels configurable through env vars out of a box. |
Yeah, it is more self-explanatory that way.
Absolutely, I agree.
That is the reason why I chose to wait for the documentation. I wasn't sure how to document it properly. |
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.
Good thoughts in the thread. I agree with what was mentioned above.
Maybe in the meantime we can take it in and replace it with a proper logging solution later on (which will be a bigger task and takes more time).
@domcorvasce do you want to move forward here? Do you need any help?
Sure, I'm going to push some changes later in the day. I'll let you know both if I have questions or doubts. |
@pmuens @medikoo Where we should document Maybe I am missing something, but there is no reference to sls --help
# or
sls deploy --help Also I wasn't able to find refs within https://serverless.com/framework/docs/ (but I did a quick search, so maybe I am missing something there too). |
@domcorvasce hmm, yes you're right. It's not show when using 🤔 I'm not sure where we should add it. Maybe to the |
Alright.
IMO it would be best if we add it to the |
Yes, I agree with that. IMHO trying to get this into the doc structure might be too complicated and just adding it to |
As I see workflow docs are per provider, not sure if it's a good place, but I think adding note on both |
👍That sounds reasonable. |
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.
Thanks for updating @domcorvasce 👍
Just tested it and it looks good! LGTM
What did you implement:
In
logWarning
function, added a check for an environment variable namedSLS_NO_WARNINGS
.When this env var is set (much like
SLS_DEBUG
) all the warnings are hidden from the output.Closes #6346
How did you implement it:
Well, I added a guard clause at the beginning of the
logWarning
function.If the env var is set, the function exits without printing.
How can we verify it:
serverless.yml
, try to define some SSM parameters that are not definedsls deploy
and see the warnings about undefined SSM paramsSLS_NO_WARNINGS=* sls deploy
and enjoy no warningsTodos:
Note: Run
npm run test-ci
to run all validation checks on proposed changesValidate via
npm test
Validate via
npm run lint-updated
Note: Some reported issues can be automatically fixed by running
npm run lint:fix
Validate via
npm run prettier-check-updated
Note: All reported issues can be automatically fixed by running
npm run prettify-updated
Is this ready for review?: YES
Is it a breaking change?: NO