"Action failed": highlight the action in red, not the command #1104
+29
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR: See the end of the description for before/after screenshots. In "Action failed" errors, render the action ID in bold red (not bold white), and render the "Reproduce locally" in white, not dark red. This makes it clear which action failed, which tends to be more useful than the (truncated) command itself.
We've found that when reading Buck2 error output, users often focus on the description of the action that failed ("Local command returned non-zero exit code 1"), which is the first part of the error message that's rendered in red text. Instead, we would like users to look at the name of the action that failed, which is rendered in bold text and often evades notice.
At the end of a failing Buck2 command, there's a section which recaps the errors encountered ("BUILD FAILED" "Failed to build 'root//src/Model:Model ...'"). This message is very legible and shows the failing target clearly, but users don't always see this message at first. The command may be long-running and the user may be reading output before it has finished, or the user may simply be reading the output top-to-bottom.
The description of the action that failed (currently rendered in red text) contains supplementary debugging information such as the failing command's exit code. It also prints the failing command (truncated), which is somewhat misleading; because Buck2 rules often invoke builds through layers of wrapper scripts, the failing command is rarely informative (e.g. a
ghcfailure does not showghc, any wrapper script filename, or any source filenames in the truncated command).Although truncating the command is a good tradeoff for brevity, it is not the most informative part of the error message.
Therefore, this change makes small adjustments to the styling of action errors:
The "Action failed" headline is rendered in bold red text, rather than bold white text. This helps draw the user's attention to the name of the action that failed, rather than the command that failed. This is the most important part of the change.
The reason ("Local command returned non-zero exit code 1") is still rendered in dark red text, as it provides context for how the action failed.
The "Reproduce locally" line is rendered in white text, rather than dark red text.
The "stdout:" and "stderr:" sections are only shown if they are non-empty.
Before
After