ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Possible to have buildfarm status in PR on Github?

asked 2020-09-08 05:22:50 -0500

rreignier gravatar image

updated 2020-09-09 03:16:03 -0500

I have configured bloom to enable Pull Request testing on the buildfarm.

On the Github side, giving admin access to the whole org seems a bit too much, so I am using the alternative solution using webhook, as described here in the wiki.

On a PR, a build is triggered on the buildfarm, but no feedback is given on the Github PR page.

Is this behavior normal while using webhook, or am I missing a configuration somewhere?

Edit: here are the permissions I have given: (a bit more that what is advised on the Wiki). But I have just noticed that the Pull request review comments is missing. image description

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-11-16 03:36:33 -0500

rreignier gravatar image

The solution for me was to give ros-pull-request-builder write access to the specific repo. Without granting access to the whole organization: image description

edit flag offensive delete link more
1

answered 2020-09-08 16:19:40 -0500

tfoote gravatar image

updated 2020-09-09 01:54:27 -0500

gvdhoorn gravatar image

From the console output of your job I see that you're getting permission denied from github (see log snippet below). I think that you have not given enough privileges for the webook to write the PR status back to your repository.

01:42:02 Setting status of 5e8c461ac29ae9919d6fd9e52ab33993f7a39a57 to SUCCESS with url http://build.ros.org/job/Npr__ixblue_ins_stdbin_driver__ubuntu_focal_amd64/1/ and message: 'Build finished. '
01:42:02 Using context: Npr__ixblue_ins_stdbin_driver__ubuntu_focal_amd64
01:42:03 FileNotFoundException means that the credentials Jenkins is using is probably wrong. Or the user account does not have write access to the repo.
01:42:03 org.kohsuke.github.GHFileNotFoundException: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#create-a-commit-status"}
01:42:03    at org.kohsuke.github.Requester.handleApiError(Requester.java:699)
01:42:03    at org.kohsuke.github.Requester._to(Requester.java:306)
01:42:03    at org.kohsuke.github.Requester.to(Requester.java:247)
01:42:03    at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:1104)
01:42:03    at org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus.createCommitStatus(GhprbSimpleStatus.java:283)
01:42:03    at org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus.onBuildComplete(GhprbSimpleStatus.java:241)
01:42:03    at org.jenkinsci.plugins.ghprb.GhprbBuilds.onCompleted(GhprbBuilds.java:205)
01:42:03    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:28)
01:42:03    at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:209)
01:42:03    at hudson.model.Run.execute(Run.java:1925)
01:42:03    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
01:42:03    at hudson.model.ResourceController.execute(ResourceController.java:97)
01:42:03    at hudson.model.Executor.run(Executor.java:428)
01:42:03 Caused by: java.io.FileNotFoundException: https://api.github.com/repos/ixblue/ixblue_ins_stdbin_driver/statuses/5e8c461ac29ae9919d6fd9e52ab33993f7a39a57
01:42:03    at sun.reflect.GeneratedConstructorAccessor63895.newInstance(Unknown Source)
01:42:03    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
01:42:03    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
01:42:03    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950)
01:42:03    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945)
01:42:03    at java.security.AccessController.doPrivileged(Native Method)
01:42:03    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1944)
01:42:03    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1514)
01:42:03    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
01:42:03    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
01:42:03    at org.kohsuke.github.Requester.parse(Requester.java:625)
01:42:03    at org.kohsuke.github.Requester.parse(Requester.java:607)
01:42:03    at org.kohsuke.github.Requester._to(Requester.java:285)
01:42:03    ... 11 more
01:42:03 Caused by: java.io.FileNotFoundException: https://api.github.com/repos/ixblue/ixblue_ins_stdbin_driver/statuses/5e8c461ac29ae9919d6fd9e52ab33993f7a39a57
01:42:03    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1896)
01:42:03    at sun.net.www ...
(more)
edit flag offensive delete link more

Comments

Thank you. But even with Pull request review comments activated, I still have the permission error. Do you have any idea which permission I should enable in the screenshot I have added to my answer?

rreignier gravatar image rreignier  ( 2020-09-09 03:31:18 -0500 )edit

Maybe the Statuses choice can grant access.

rreignier gravatar image rreignier  ( 2020-09-09 07:22:07 -0500 )edit

Sadly, no...

rreignier gravatar image rreignier  ( 2020-09-09 07:30:09 -0500 )edit

In order to install the webhook the admin or maintain permissions must be applied. Once the hook is installed in your repository you can revoke the permission but if the hook ever needs to update you won't receive the update.

nuclearsandwich gravatar image nuclearsandwich  ( 2020-12-18 13:36:32 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-09-08 05:22:50 -0500

Seen: 426 times

Last updated: Nov 16 '20