Configuring Build Completeness Check for Merge Requests
Supported Voting Connectors
This feature is currently available for Bitbucket Server and GitHub only.
Voting connectors can be configured to wait for specific build jobs before annotating the merge request with test gap data. This ensures that test coverage in Teamscale is complete and lets you know whether Teamscale expects more test data to arrive from build pipelines or not.
Enabling the Build Completeness Check
To enable and configure the build completeness check for merge requests, you need to configure the Included build jobs and Excluded build jobs options in the connector.
You could do so by adding regular expressions describing the build jobs that Teamscale should wait for before annotating the merge requests with test gap data.
Please keep in mind the following when configuring these options:
- If the options are left empty, that means that the feature is disabled and Teamscale will not wait for any build jobs.
- If any of the options is set, that means that the feature is enabled and Teamscale expects at least one build job to match the configured regular expressions.
Configuring Build Completeness Check Intervals
Teamscale periodically polls the code collaboration platform for changes regarding the merge requests' configured build jobs to get updates about their status.
Build jobs polling interval
The Build jobs polling interval connector option sets the delay used for polling the merge requests' build jobs. It is set to 10 minutes by default, and you can increase or decrease the polling interval as desired.
However, we recommend using the default setting and only decreasing that interval, if the code collaboration platform cannot reach Teamscale via webhook at all.
Merge requests last updated timeframe
When Teamscale periodically polls the code collaboration platform for build jobs changes, it checks the merge requests last updated within a specific timeframe.
By default, Teamscale checks the merge requests updated within the last 24 hrs, but this timeframe can be adjusted by passing the following JVM argument on the start of Teamscale:
-Dcom.teamscale.merge-request.merge_requests_last_update_period_seconds=86400
Configuring Build Status Webhook Service
Some code collaboration platforms do not trigger webhooks for build job status changes (e.g. Bitbucket Server). So in order to overcome this limitation and enable Teamscale to receive real-time updates, the build status webhook service can be used to notify Teamscale about the build jobs' changes.
In such cases, we recommend calling this service at the beginning and ending of the build job script to signal the start and end of the build job respectively.
Below is an example of how the service call would look like for a Bitbucket Server build job.
curl -X POST 'http://<TEAMSCALE_URL>/api/projects/<PROJECT>/build-web-hook?revision=<GIT_COMMIT>&repository-url=<REPO_URL>&repository-platform=bitbucket_server'