logging upcoming breaking changes#3217
Conversation
pmuens
left a comment
There was a problem hiding this comment.
Looks good! Just pushed some minor fixes so that the list of messages are indented.
Just added one comment about a test for this method.
| console.log(message); // eslint-disable-line no-console | ||
| } | ||
|
|
||
| logBreakingChanges() { |
There was a problem hiding this comment.
This should have a basic test (something like that here might be sufficient:
serverless/lib/plugins/aws/info/display.test.js
Lines 43 to 60 in d98dfa3
|
Thanks @pmuens 🙌 ... I've definitely thought about that too, but it got too challenging for it to be worth it. The main challenge is that by default there are no breaking changes and so the CLI doesn't log anything. The only way to change that is in the code (not env var, not Generally speaking, covering tests for CLI outputs is not that worthwhile and too hard to maintain, otherwise, we'd have to add tests for every error message we display too. |
|
@eahefnawy yes, I agree. Testing the CLI is hard and not always worth the effort. I've pushed some convenience changes (so that you don't have to scroll to the end of the Feel free to merge if it's GTM from your side! |
| expectedMessage += chalk.yellow(' - x is broken\n'); | ||
| expectedMessage += chalk.yellow(' - y will be updated\n'); | ||
| expectedMessage += '\n'; | ||
| expectedMessage += chalk.yellow(' You can opt-out from these warnings by setting the "SLS_IGNORE_WARNING=*" environment variable.\n'); //eslint-disable-line |
There was a problem hiding this comment.
@pmuens Really appreciate your dedication to test coverage and high quality code 🥇 , but I'm still worried about maintaining those kinda tests, especially the "expected messages" above. If we for some reason change an irrelevant character, those tests would fail and we'll need to spend considerable amount of time looking very closely at the message diff, while at the very end it doesn't really matter much. Doing that for every message we log would be hell, especially error messages.
But let's merge this anyway. It doesn't deserve anymore time.
Thanks @pmuens 🙌
There was a problem hiding this comment.
Yes, I agree. checking everything in detail might be too detailed 👍 🙌
Maybe for future situations like this we can check that the error / warning message contains the Breaking change items etc. (and not the full message) so that we don't have to go through hell when we change the message itself 👹
There was a problem hiding this comment.
hehe I like that! 💯
What did you implement:
Closes #3211
Added functionality for listing all the upcoming breaking changes in the CLI. This is going to be one of each release steps.
How did you implement it:
Added a method to the CLI that logs all the breaking changes. User can opt-out by setting the
SLS_IGNORE_WARNINGenv var. I've also updated the release checklist to include a step where we update the upcoming breaking changes list on every release.How can we verify it:
breakingChangesarray.SLS_IGNORE_WARNINGenv varTodos:
Is this ready for review?: YES
Is it a breaking change?: NO