Travis CI Integration¶
Travis CI is a popular service for continuous integration, allowing you to run test suites, perform builds, and even deploy to servers in an automated fashion.
Review Board can integrate with Travis CI to do test builds of code changes and report the results back as a status update on the review request.
Integration Configuration¶
To configure an integration with Travis CI:
Navigate to the Administration UI -> Integrations.
Click Add Integration and select Travis CI.
Fill out the general fields:
- Name:
A name for this particular configuration.
Each integration must have its own name. You can provide any name you choose. This will be shown whenever a build is in progress.
- Enable this integration
This will be on by default. You can turn this off to temporarily or permanently disable this Travis CI configuration without having to delete it.
- Local Site
If you’re using the advanced Local Site (multi-server partition) support, you can specify which site contains this configuration.
Most users can leave this blank.
Set the Conditions for when Review Board will trigger a build.
At a minimum, you should set a condition to match a specific repository. Even if you only have one repository configured now, you’ll want to set this up so things don’t break if you connect a second one. If needed, you can create complex rules for which review requests get matched with this config (for example, if you only want to run a test suite for certain branches).
Because Travis CI only works with GitHub repositories, only changes on repositories configured with those hosting services will trigger builds.
Fill out the endpoint and authentication credentials for the Travis CI server handling your project:
- Travis CI:
The Travis CI endpoint for your project.
- API Token:
The API token used for authentication. To get an API token, follow the instructions in their documentation.
Fill out the information for the build processes in Travis CI.
This configuration will be used instead of anything that is set in the repository’s
.travis.yml
file.- Build Config:
The configuration needed to do a test build, without any notification or deploy stages.
The required steps for building the patch and reporting results back to Review Board will be automatically included when the build is triggered.
Warning
This configuration should not include any secrets, since code submitted through Review Board will have access to the decrypted data (and these secrets are not needed when there is no deployment or notification).
language: python python: 3.12 install: - pip install -e . - pip install -r dev-requirements.txt script: - python -m pytest ./project/
- Build Branch:
An optional branch name to use for review request builds within the Travis CI user interface.
By default, the Travis CI user interface will show all builds as occurring on
master
. This field allows you to override the branch name to be something else, as to separate review request builds from regular builds.
Note
We recommend creating and pushing a dummy branch named “review-requests” to your repository, and then filling in that name here. The actual contents of that branch are unimportant, and it never needs to be updated, since the source will be completely replaced during the build process.
Set the information for when to run builds.
- Run builds manually:
Enable this if you want Travis CI builds to only run when manually started.
When enabled, this will add a Run button to the build entry.
- Build timeout
The amount of time until the build is considered to have timed out.
If the build takes longer than this, it will be marked as timed out and can be re-run.
You can create multiple configurations of the integration to do builds for each repository which supports Travis CI builds.