pr-creator does not successfully use GitHub app authentication: "BUG apps auth requested but empty org, please report this to the test-infra repo." #33829
Note that the error occurred on the search for matching PR, even though in my case the repo is public; it was trying to auth as directed but ran into this.
What you expected to happen:
At least a dry run of a PR being created or updated (should work with -confirm of course too).
How to reproduce it (as minimally and precisely as possible):
with a github app
install that app on a repo
run the command above, specifying the app's client id file and app id and appropriate org/repo
Anything else we need to know?:
It looks to me like this almost works, and I would be willing to put together a PR if I could figure out how to connect the dots.
As near as I can tell, this bot got the flags/options for app auth for free when the prow github client library it uses got them; however compared to PATs and oauth2 there is an added need to generate an installation token, which requires looking up the installation based on the org; something must wire the org into the tokenGenerator, and in pr-creator's code nothing does (the client doesn't store the org or tokenGenerator, and the failing call to gc.FindIssues doesn't either). I think that's why we end up with BUG apps auth requested but empty org.
https://github.com/kubernetes/test-infra/issues/24406 (tide should have worked here but gave the same error - the owner closed explaining the app was missing permissions, but I would have expected a different error in that case; anyway I'm reasonably confident my app has the necessary permissions)
What happened: Using the
pr-creator
built from latest I ran (real names swapped out with fake):Note that the error occurred on the search for matching PR, even though in my case the repo is public; it was trying to auth as directed but ran into this.
What you expected to happen: At least a dry run of a PR being created or updated (should work with
-confirm
of course too).How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?: It looks to me like this almost works, and I would be willing to put together a PR if I could figure out how to connect the dots.
As near as I can tell, this bot got the flags/options for app auth for free when the prow github client library it uses got them; however compared to PATs and oauth2 there is an added need to generate an installation token, which requires looking up the installation based on the org; something must wire the org into the tokenGenerator, and in
pr-creator
's code nothing does (the client doesn't store the org or tokenGenerator, and the failing call togc.FindIssues
doesn't either). I think that's why we end up withBUG apps auth requested but empty org
.This issue is somewhat related to:
commenter
is not even equipped with the app flags yet)