[llvm][utils] Handle Issue/PR authors having no display name set#186094
Conversation
user.login is the account name and user.name is an optional full name. I got an email generated from a colleague's PR that said: Author: None (<their username>) As they hadn't set user.name in their account. Which isn't a problem, but it would be neater if we didn't print None. So I've added a helper function to handle that. If the user has set both, the output is as it was before, if the user has not, we just show the account name.
|
"full name" might not be the term for it, but it's hard to find a term that's distinct from username. I looked in Pygithub and in theory the login name can be None too: https://github.com/PyGithub/PyGithub/blob/main/github/NamedUser.py#L131C13-L132C44 But I don't know how that would be possible. Perhaps if an issue was opened by an account that was later closed / banned / made private? Actually, I need to account for that. Will update that shortly. |
|
A current example of the "None" is #186087 (comment). |
boomanaiden154
left a comment
There was a problem hiding this comment.
LGTM. Thanks for making this look slightly better.
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/134/builds/37381 Here is the relevant piece of the build log for the reference |
…m#186094) user.login is the account name and user.name is an optional display name (often their full name). I got an email generated from a colleague's PR that said: ``` Author: None (<their username>) ``` As they hadn't set user.name in their account. Which isn't a problem, but it would be neater if we didn't print None. So I've added a helper function to handle that. If the user has set both, the output is as it was before, if the user has not, we just show the login name. The login name can apparently be None too. In that case we'll print "None" for it. This does not seem to be a common case though, and I'm not sure printing anything else would be any more useful.
user.login is the account name and user.name is an optional display name (often their full name). I got an email generated from a colleague's PR that said:
As they hadn't set user.name in their account. Which isn't a problem, but it would be neater if we didn't print None.
So I've added a helper function to handle that. If the user has set both, the output is as it was before, if the user has not, we just show the login name.
The login name can apparently be None too. In that case we'll print "None" for it. This does not seem to be a common case though, and I'm not sure printing anything else would be any more useful.