-
Notifications
You must be signed in to change notification settings - Fork 67
Assign a default status for plugins that do not use utils.status.show()
#1275
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
Conversation
␊ | ||
(Netlify Build completed in 1ms)` | ||
|
||
## utils.status.show() implicit status is not used when there are no events |
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.
I'm having a hard time understanding the difference between implicit status is not used when there are no events
, implicit status is not used when no call was made, with only onError
and implicit status is used when no call was made
, implicit status is used when no call was made, with only onEnd
and implicit status is used when no events have made a call
.
How is the implicit status reflected in the snapshot? With previous tests I can see the summary, but the only differences I can see in these snapshots are the logs for specific commands.
What am I missing?
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.
Sorry this is confusing, and thanks for being thorough by checking the test snapshots!
Statuses bring together several features: build errors, plugin errors, build cancellation and plugin success statuses. Also we assign a default success status when the plugin does not do it explicitly. Finally, we need to ensure that:
- this implicit success status is not overriding a build error or explicit call to
utils.status.show()
utils.status.show()
overrides any previous call toutils.status.show()
utils.status.show()
cannot override a plugin or build error
This rather complex logic leads to the tests being a little complicated. I have written down some more detailed information below.
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.
Note that the specific tests you ask for are the last 3 ones in the post below.
Note: the tests only checks the user-visible behavior of this feature (everything else is just implementation details):
This is a detailed explanation what each test is checking. Each point starts with the test title. can override a success status
cannot override an error status with a success status
can override an error status with another error status
implicit status is not used when an explicit call was made
implicit status is not used when there are no events
implicit status is not used when no call was made, with only onError
implicit status is used when no call was made
implicit status is used when no events have made a call
implicit status is used when no call was made, with only onEnd
|
Thanks for the detailed explanation, I get the desired behaviour and each test implementation. |
Part of #1223.
When a plugin does not use
utils.status.show()
, a defaultsuccess
status should be used.That status should be implicitly set by the last event handler, excluding
onError
andonEnd
.This PR also adds many tests covering implicit statuses and how status can override each other.