jdx / mise-action

MIT License
61 stars 7 forks source link

feat: use debug logging when in debug mode (#128) #129

Closed xremming closed 1 month ago

xremming commented 1 month ago

Not 100% sure how to test changes easily. Decided to also include a few small cleanups of the code in the same PR.

After this PR, re-running a failed job with debugging will cause mise-action to always output logging at debug level which in turn should help debugging issues that happened in CI (motivated by my Friday debugging of jdx/mise#2725).

Fixes: #128

xremming commented 1 month ago

@jdx Anything needed from me to get this merged?

jdx commented 1 month ago

I ran it with debug enabled and it works: https://github.com/jdx/mise-action/actions/runs/11326474236?pr=129

jdx commented 1 month ago

so I think at least for now we should only set the log level inside of our action, not set it for future actions. Otherwise I think it would add too much noise when doing unrelated things that just happen to call mise shims for example.

xremming commented 1 month ago

Hmm. Okay I think I understand what you mean. This PR doesn't change the current behaviour which is to export the log level to all further steps too.

At least when it comes to debug logging, it really should be enabled for all further steps to help with debugging, even if it does end up creating a lot of noise.

Are you thinking that if the user sets the log_level parameter, then we only set the MISE_LOG_LEVEL for this exact step and not for future ones too?

jdx commented 1 month ago

Hmm. Okay I think I understand what you mean. This PR doesn't change the current behaviour which is to export the log level to all further steps too.

that is fine in the scenario where a user explicitly sets log_level. It's not ok for us to set it automatically just because debugging was enabled on the action generally. I think it's fine within our step but it would create a lot of noise that is likely not what the user would want in unrelated steps.

xremming commented 1 month ago

Looks like you just fixed the cache_save bug that I had fixed in the branch so I rebased and dropped the commit (and squashed some of my changes). Let me know if you want me to rebase again and clean the commits.