fix(compute/build): ensure build output doesn't show unless --verbose flag is set #815
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.
Problem
When there is an error building a user's project, the build output is displayed to the user and is so visually noisy you can’t see the list of instructions for how to debug things when there is an error.
The following screenshot isn't even that bad of an example as the error output from my example is actually quite short, whereas in practice the output is usually a lot denser and harder to scan, but it's still a useful example of how hard it is 'at a glance' to distinguish the various output categories (expected/unexpected/error/guidance)...
Solution
Only show the build output/error when the
--verbose
flag is set.Context
Prior versions of the CLI would default to displaying the build output because users didn't know they could pass
--verbose
to see the build output and get more information. But since 6.x the CLI no longer validates a user's environment, and instead if there is an error building, we just display a bullet list of suggestions. So the current behaviour results in lots of output by default and makes knowing where to look for guidance much harder!Screenshots
The first screenshot shows what happens when the user runs
compute build
and there is a build error (notice the output is much more succinct and clear)...The second screenshot shows what happens if the user follows our guidance and re-runs the command with the
--verbose
set (notice the extra contextual information and a clearly marked/delimited section for the command's output so users can more easily identify build information and build output)...The last screenshot shows us fixing the issue and then what the output of
compute build
now looks like when it's successful, both with and without the--verbose
flag...