Skip to content

Comments

Allow TagBot to handle Copilot PRs#408

Merged
IanButterworth merged 2 commits intoJuliaRegistries:masterfrom
penelopeysm:master
Aug 31, 2025
Merged

Allow TagBot to handle Copilot PRs#408
IanButterworth merged 2 commits intoJuliaRegistries:masterfrom
penelopeysm:master

Conversation

@penelopeysm
Copy link
Contributor

@penelopeysm penelopeysm commented Aug 31, 2025

This line fails when the user is the special GitHub copilot bot, meaning that TagBot will always error if Copilot has had a PR in a repo merged. Specifically, fetching user.name ultimately leads to the PyGithub library querying https://api.github.com/users/Copilot which throws a 404 error.

"name": user.name or user.login,

This PR fixes it. An example of a release created with this patch of TagBot (I ran it locally) can be found at https://github.com/TuringLang/AbstractPPL.jl/releases/tag/v0.13.1.

I'm unsure why CI is failing, but it seems rather unrelated to this PR.

@DilumAluthge
Copy link
Member

@IanButterworth Would you be able to review this?

Copy link
Member

@IanButterworth IanButterworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an isdefined equivalent in python? It seems brittle to special case this so much?

@penelopeysm
Copy link
Contributor Author

penelopeysm commented Aug 31, 2025

Is there an isdefined equivalent in python?

So the problem is that user.name is not a regular class attribute that's being accessed, it's a property. If it's not already defined in the class, then PyGithub has to retrieve the name by querying the GitHub API: https://github.com/PyGithub/PyGithub/blob/9612e61bf78ac2b6c2224624220c048d4c643b63/github/NamedUser.py#L288-L291

Ordinarily this lookup will succeed, and I assume that that's what we want to do for ordinary users, but for Copilot it fails and we can't check for that without either using some PyGithub internals, or making an upstream change to PyGithub.

If you'd prefer something that doesn't special-case Copilot we could maybe do:

try:
    name = user.name or user.login
except github.GithubException.UnknownObjectException:
    name = user.login

I prefer the original because it recognises that Copilot is indeed a special case, whereas this might mask more errors that we are yet unaware of, but I'm not fussed and am very happy to change it.

@IanButterworth
Copy link
Member

Ok! Seems like an upstream bug. The fix seems like an improvement at least.

@IanButterworth
Copy link
Member

I'm going to merge the dep updates first to try and get CI green here.

@IanButterworth IanButterworth merged commit 62df0b4 into JuliaRegistries:master Aug 31, 2025
3 checks passed
@IanButterworth
Copy link
Member

https://github.com/JuliaRegistries/TagBot/releases/tag/v1.20.3

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

Successfully merging this pull request may close these issues.

3 participants