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
I'm a student working on a project in which we're analyzing git repositories' pull request's patch files.
I was able to make the getLabels() call using a GHIssue object, but when making it from a GHPullRequest object I get a 403. ("message":"Must have admin rights to Repository.","documentation_url":"https://developer.github.com/v3/issues/#edit-an-issue")
NOTE: This was tested on a public repo, not my own.
I did see #178, but didn't see the GHPullRequest.fetchIssue() method in the Javadocs.
GHPullRequest extends from GHIssue, so the design here is to call GHPullRequest.fetchIssue() at the right point to ensure methods defined on GHIssue return correct info when used on GHPullRequest instance, such as getLabels() do.
Why does the getLabels() call work for a GHIssue object but not for a GHPullRequest object?
org.kohsuke.github.HttpException: {"message":"Must have admin rights to Repository.","documentation_url":"https://developer.github.com/v3/issues/#edit-an-issue"}
at org.kohsuke.github.Requester.handleApiError(Requester.java:695)
at org.kohsuke.github.Requester._to(Requester.java:298)
at org.kohsuke.github.Requester.to(Requester.java:246)
at org.kohsuke.github.GHPullRequest.fetchIssue(GHPullRequest.java:396)
at org.kohsuke.github.GHPullRequest.getLabels(GHPullRequest.java:136)
at Main.main(Main.java:48)
Caused by: org.kohsuke.github.HttpException: Server returned HTTP response code: 403, message: 'Forbidden' for URL: https://api.github.com/repos/code4craft/webmagic/issues/713
at org.kohsuke.github.Requester.parse(Requester.java:638)
at org.kohsuke.github.Requester.parse(Requester.java:599)
at org.kohsuke.github.Requester._to(Requester.java:277)
... 4 more
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.github.com/repos/code4craft/webmagic/issues/713
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1963)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1958)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1957)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1525)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:245)
at org.kohsuke.github.Requester.parse(Requester.java:617)
... 6 more
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.github.com/repos/code4craft/webmagic/issues/713
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1913)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:329)
at org.kohsuke.github.Requester.parse(Requester.java:607)
... 6 more
The text was updated successfully, but these errors were encountered:
I'm a student working on a project in which we're analyzing git repositories' pull request's patch files.
I was able to make the getLabels() call using a GHIssue object, but when making it from a GHPullRequest object I get a 403. ("message":"Must have admin rights to Repository.","documentation_url":"https://developer.github.com/v3/issues/#edit-an-issue")
NOTE: This was tested on a public repo, not my own.
I did see #178, but didn't see the GHPullRequest.fetchIssue() method in the Javadocs.
Why does the getLabels() call work for a GHIssue object but not for a GHPullRequest object?
Here's my code
Here's the stacktrace:
The text was updated successfully, but these errors were encountered: