Output progress updates in non-interactive mode every 10 seconds #675
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.
In non-interactive mode (i.e. a CI environment), we wouldn't print any progress status updates during the verify and upload progress. This could lead to the CI script failing for lack of output over time (example).
The exact timeout differs per CI environment (this is CircleCI).
This PR ensures we also print the usual progress bar in non-interactive mode, but throttled to 10 seconds in order to avoid flooding the logs. For long-running processes that have no progress indicator (build-storybook, verify), render a "bouncing" activity bar. This should resolve the script timeout issue, provide useful progress updates and keep the number of log lines to a minimum.
The
CHROMATIC_OUTPUT_INTERVAL
environment variable can be used to override the output interval (in ms). Default is 10,000 (10 seconds). Documentation update is here.