Use a non-interactive progress writer in non-TTY environments #405
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.
Closes: #175
TL;DR
The current default progress writer uses interactive spinners on an event loop; while this style of output is useful in user terminal environments to give constant feedback of progression, it is not ideal in non-TTY environments, such as in continuous integration builds.
What?
This PR solves the CI issue by renaming the existing
text.QuietProgress
totext.InteractiveProgress
, as it's not really "quiet", and then creates a new implementation oftext.QuietProgress
which only writes the step functions and not the intermediary writes to stdout. Lastly, we have a new constructortext.NewProgress()
which is used throughout the program as a helper to abstract the logic which determines which progress should be used.