-
Notifications
You must be signed in to change notification settings - Fork 319
Set trusted publishing logging to INFO/WARN #1247
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
base: main
Are you sure you want to change the base?
Conversation
Trusted publishing is the only part of the codebase using `logger.debug()`, which can't be easily accessed from the CLI. This PR changes these to either `logger.info` or `logger.warning()`, such that all are visible with `--verbose`. Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
Hi @pnacht, thanks for opening a PR! I have no strong feelings either way, but maybe these should all be Curious what you think. |
I'd initially written it like that (everything as WARN) for that precise reason, but couldn't find anywhere else in the codebase "misusing" the log level like that (everywhere else really is warning about something), so moved most of them to INFO to be consistent with the rest of the codebase. I'd be totally fine setting everything to WARN, though I'd actually be partial to leaving the "first" instance ( Currently, twine's output using TP looks like this:
Reading this, it looks like the password was fetched from the keyring, which isn't the case. By keeping at least that "first" instance as INFO, the output will be
This makes it clear that the keyring was queried (silently found nothing) and twine then tried TP. Indeed, this PR came about because I was having some trouble configuring TP for a package, saw the current logs and thought I'd somehow mysteriously added something to the keyring. I only managed to confirm twine was actually attempting TP when I looked at the source code and noticed that twine actually logs when it gets something from the keyring (which didn't happen in this case): Lines 175 to 184 in 4b6c50b
|
Gotcha, thanks! That's really helpful context, and this change makes a lot of sense to me given that. Would you mind adding a quick changelog entry too? The docs should point you the right way: https://twine.readthedocs.io/en/stable/contributing.html#changelog-entries |
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
Done. As per our previous comments, I've also gone ahead and set all but one of the messages to |
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.
Thanks @pnacht!
Trusted publishing is the only part of the codebase using
logger.debug()
, which can't be easily accessed from the CLI. This PR changes most tologger.info
– therefore always printing them – and one tologger.warning()
(visible with--verbose
).