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

Option to disable progressive output (e.g. for CI use) #94

Closed
ilarischeinin opened this issue Nov 15, 2018 · 5 comments
Closed

Option to disable progressive output (e.g. for CI use) #94

ilarischeinin opened this issue Nov 15, 2018 · 5 comments
Assignees
Milestone

Comments

@ilarischeinin
Copy link

I have been enjoying the new prettier output from devtools::check() on my local machine for a while (thank you!). Now that I updated the packages installed on our GitLab CI, I noticed that GitLab doesn't support progressive output (i.e. the UI outputs lines to the client browser as they appear), so the output of checking packages looks like this:

screenshot 2018-11-15 at 11 05 17

This is an acknowledged issue on GitLab's side (mentioned at least in issues #1021, #12936, #2154). I saw a suggestion to wrap the CI command inside the command line tool script, which emulates a tty. As shown below, it does add colour to the output, but doesn't help with the progressive output (i.e. using \r to go back to the beginning of the line to overwrite it), as the output line has already been sent to the browser.

screenshot 2018-11-15 at 11 14 44

I know the bottomline issue here is with GitLab and not rcmdcheck, but would it be possible to add an option to disable progressive output for scenarios like this where it is not supported? It is of course a cosmetic issue, so not a high priority I'm sure. And depending on how complicated it would to implement, might not be worth the effort. I absolutely understand that and just thought I'd ask.

@gaborcsardi
Copy link
Member

Can you set quiet = TRUE?

@ilarischeinin
Copy link
Author

Sorry I should have mentioned this. I can and I tried it, but my preference would be to get the full output, but just without the "progressive" functionality. But like I said, it's a cosmetic issue, and I understand that depending on how things are implemented, adding that functionality could be too much work to be worth it.

@gaborcsardi gaborcsardi self-assigned this Feb 12, 2019
@gaborcsardi
Copy link
Member

I think we could just omit the \r output if the standard output is not a terminal. Then you don't need to use script, which apparently does not support \r?

@randy3k
Copy link

randy3k commented Apr 1, 2019

I think we need a global solution to avoid "\r" (or any escape chars) from being printed. testthat has a similar issue: r-lib/testthat#746

@gaborcsardi
Copy link
Member

OK, \r can be now turned off via the R_CLI_DYNAMIC=FALSE env var, and cli also tries to auto-detect whether it is supported, and turns it off if stdout is not a terminal.

CIs might emulate a terminal, though, so you might still need to add the env var, or we can make the detection better, by detecting individual CIs that don't handle \r.

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

No branches or pull requests

3 participants