-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
tool-cache: make extract functions quiet by default and more verbose if core.isDebug
is set
#206
Conversation
@damccorm According to git you are the original author, could you have a look at this PR? Thanks! |
@bryanmacfarlane could you take a look? |
If we do this, it should be an option. That would allow action authors to default to quite but be verbose if debug is set. |
@bryanmacfarlane That makes sense. How would I check if "debug" is set? |
I think the toolkit api should take an option structure and the calling action would check for debug and set that option. Covered here action author would check ACTIONS_STEP_DEBUG and then set the option. Too bad we didn't start with q being the default so now the api default needs to be the same (not q) but the consuming action can choose to by default send q and not do it if debug is set. Hope that all makes sense. |
@bryanmacfarlane The API currently does not have a consistent default; if I recall correctly it is quiet for windows but verbose for Linux/OSX . Would it make sense to capture the output of |
I was thinking more along the lines of checking if debug is set and then passing q so you don't have to trap and check each line. I'll follow up to see if there's a reliable way to do that (I want to avoid checking the secrets collection because there's work defined to have that be a settable admin or workflow setting). |
Thanks @bryanmacfarlane for opening a feature request to expose whether debugging is turned on. In the meantime, would it make sense to suppress all output for now? This would make the implementation of unzipping consistent across operating systems. Quiet output is probably the best default for the tool-cache library. |
@bryanmacfarlane I pushed a commit adding a The other extraction functions |
@bryanmacfarlane After looking a bit more carefully at the current implementation of I think the I am not really in favour of adding a configuration flag to the API. The functions are meant for extracting tool archives and I don't think the extra control (and complexity) is necessary. |
Sounds good. We'll add that change to the runner and the code in the toolkit can just check the envvar. |
@TingluoHuang for context |
df91f2b
to
f720e58
Compare
core.isDebug
is set
Thanks to @TingluoHuang for #278 ; I rebased on his work. Now all extract functions should be quiet by default and more verbose when |
@TingluoHuang - I think this behavior is in the runner now?? |
@bryanmacfarlane it's in, we just need to finish the rollout. |
@bryanmacfarlane Thanks for merging #278 ! I rebased this PR, hopefully it is ready to go now. |
Hey @aibaars , I'm hoping to get this merged in shortly. Do you have some time to take care of the merge conflicts? If not, I can take over the PR. Thank you! |
This avoids spamming the log when unzipping large archives.
Make the extract function print the list of extracted file if the action is run in debug mode.
Thanks! I just rebased the PR. |
@thboop I have no idea what the failures of the unit tests are about. They seem unrelated to the changes. |
@thboop The tests seem to pass now; I should have thought about re-running myself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the contribution @aibaars ! |
@aibaars I can release a new version of the tool-cache if needed. Was it your action that needed it or any other particular setup-* action that motivated the change? I can prioritize that if so |
Thanks, the github/codeql-action team switched to using @Daverlo for info ^ |
This avoids spamming the log when unzipping large zip files.