You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problematic regression with ~/.github file authentication #1155
I'm not exactly sure how we want to fix this. A comment in GitHubBuilder.fromCredentials() says @throws IOException If there are no credentials defined in the ~/.github properties file or the process environment. which is obviously not true anymore.
I'm not sure if we want to fix the comment and allow anonymous access (but given we explicitly called fromCredentials(), I would rather throw an exception) or throw an exception again if we don't have any credentials. The latter would obviously prevent anonymous access.
Note that it can be a bit hard to debug as in my case the GH API was just throwing 404 Not Found errors when trying to do some write operations instead of complaining about the missing credentials.
Activity
gsmet commentedon May 25, 2021
Workaround is to directly use
GitHubBuilder.fromPropertyFile().build().bitwiseman commentedon May 27, 2021
@gsmet
#945 is definitely the cause of the problem.
We need to have a mode for testing where the property file location is settable.
github-api/src/main/java/org/kohsuke/github/GitHubBuilder.java
Lines 180 to 183 in d091200
The code at
github-api/src/main/java/org/kohsuke/github/GitHubBuilder.java
Lines 61 to 74 in d091200
gsmet commentedon May 27, 2021
Yeah, that's the fix I had in mind. The funny part will be to create a test :).
Fix withCredetials() to correctly detect missing creds
bitwiseman commentedon May 27, 2021
@gsmet Take a look now.