Pull request testing

Using a package ros_buildfarm, you can run the build and test logic that ROS build farm runs on the host of your choice. ROS build farm also provides pull request testing for repositories hosted on GitHub.

Enable pull request testing for a specific repository on Github

For each repository the following two things must be done.

There are two ways to do this as following. For some GitHub org unit this might have already been done. If you need it to be added to an org unit please contact the maintainers of the org unit or ask on answers.ros.org.

  • (Recommended) Grant admin access to the org unit (i.e. not just the repository) for ros-pull-request-builder, a ROS buildfarm GitHub user account. To do so:

    1. Open "https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/collaboration".

    2. At "Collaborators", add "ros-pull-request-builder" (in the dash line in the following figure)).

    3. Select "Admin" from the pulldown.

      ros_buildfarm_github_pullreq_adminright.png

      Jenkins uses the Pull Request Builder plugin to setup the webhooks which trigger Jenkins for new or updated pull requests and report back the status. Therefore the GitHub org unit where the repository is located must grant push, pull and administrative rights to the user .

  • Alternatively you can setup the webhook manually for each repository to avoid the need for administrative rights on the org unit. Then the Jenkins user only needs write permissions.

    1. Use the above procedure to grant "Write" access instead of "Admin"
    2. Go to "https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/hooks/new", then on the same page:

    3. Enter the "Payload URL" "http://build.ros.org/ghprbhook/"

    4. Check the following:
      • "Let me select individual events."
      • "Issue comment"

      • "Pull request"

      You see something like this:

      ros.org_travis_webook_setting1.png

Update rosdistro

You must add the test_pull_requests flag for the source entry of a specific repository in the distribution file and set it to true. E.g. see the Indigo distribution file. The configuration option is documented in REP 143.

  • If you use bloom to make a new release of your software, there's an option to set this while running it.

Note that after the pull request has been added, the job will usually not be created until the nightly Jenkins reconfiguration.

Integration with other CI systems

If you don't want to use the official Jenkins server you can also setup any other CI systems (e.g. Travis) for your repository while still leveraging the logic provided by the Python package ros_buildfarm. Please look at the documentation for an example .travis.yml file.

Integration using other services

The Python package ros_buildfarm also provides scripts for running various jobs on the command line. A pull request job is simply a devel job being triggered for the specific branch of the pull request. The documentation describes how to run devel jobs locally. This can be used to perform the task of a specific job locally as well as within any service provider like Travis.

Wiki: buildfarm/Pull request testing (last edited 2017-07-09 04:25:54 by TullyFoote)