Skip to content
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

Output progress updates in non-interactive mode every 10 seconds #675

Merged

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Nov 10, 2022

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).

Too long with no output (exceeded 10m0s): context deadline exceeded

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.

Screen Shot 2022-12-09 at 21 05 13

@linear
Copy link

linear bot commented Nov 10, 2022

AP-2521 Print something on the CLI terminal output when running a build

What

We got a feature request from Coda — they asked for something on the CLI terminal output when they’re running the build process, publish process, and verify process. Something that would output a (.) or something so that it allows the CI job to register that the process is still running and doesn’t time out.

I asked @ghengeveld about it, who answered:

Oh that's interesting. I've never heard about this issue before. Our CLI actually does show a progress indicator, but only when running on your local machine, not in CI because it would flood their logs. They could enable debug mode which will print a lot more stuff, including progress updates. That would solve their immediate problem but it will also make the output very noisy. I'll think about printing some sort of progress update in CI as well. That may or may not be behind a flag.

@ghengeveld ghengeveld force-pushed the ghengeveld/ap-2521-print-something-on-the-cli-terminal branch from c60110a to 67332d2 Compare November 10, 2022 12:13
@ghengeveld ghengeveld changed the title Output progress updates in non-interactive mode every 30 seconds Output progress updates in non-interactive mode every 10 seconds Nov 10, 2022
Copy link
Contributor

@jmhobbs jmhobbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghengeveld ghengeveld merged commit d9c7484 into main Dec 11, 2022
@ghengeveld ghengeveld deleted the ghengeveld/ap-2521-print-something-on-the-cli-terminal branch December 11, 2022 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants