How to set up Gerrit Code Review integration?
Jigit - Jira GitHub & GitLab supports integration with Gerrit Code Review, allowing you to link Gerrit changesets and reviews with your Jira issues. This enables you to seamlessly bridge the gap between code reviews and project management in Jira. When the Gerrit is integrated with Jira using Jigit, it shows the data in a separate Jira issue view tab.
Configuration
To configure Gerrit Core Review, navigate to the Gerrit tab on the Global configuration page (available only for Jira administrators) and enable the integration.
Since version 6.15.04 multiple instances of Gerrit Code Review tool are supported.
Create a new configuration rule following the next steps:
On the Configuration tab, click the Add button in the bottom right corner.
After you have specified all the necessary parameters click on Ok button to save the new rule.
The Test Connection button allows you to check the connection and communication between Jigit and the connected Gerrit Core Review account.
Please, read the definitions of each parameter you have to specify in the modal window that appears in front of you:
Parameter | Definition |
---|---|
| the name of your configuration rule |
| refers to whether the integration with Gerrit Code Review is enabled or disabled |
| URL to Gerrit Server instance allows the Jigit app to connect to your Gerrit and retrieve information about changesets, reviews, and other related data. |
| username or account that the Jigit app will use to authenticate and interact with your Gerrit to access the REST APIs |
| the password or authentication token associated with the user account specified in the "User" setting |
| the specific project or repository in your Gerrit instance that you want to integrate with Jigit app. Here you can restrict search results only to particular Gerrit Project. This parameter is optional. No projects are chosen means that the app will search for all changes in Gerrit. |
| restricts the Jigit plugin to only be used within the Development panel of Jira |
| display status information into the development panel on the Jira issue view screen |
| the list of Jira projects where to hide Gerrit information |
| the list of Jira projects where to show Gerrit information |
| the list of items where to search for the Jira issue key mentioned |
| the time interval during which Jigit will actively monitor and retrieve updates from the Gerrit |
Circuit Breaker
With the circuit breaker, you can make Jira more stable when Gerrit is unavailable or having issues. The circuit breaker monitors the connectivity and responsiveness of integrated services such as Jira, GitHub, and GitLab. It keeps track of the success or failure rate of requests made to these services.
Below are the parameters' definitions that help you tweak the circuit breaker according to your system. We recommend starting with the default ones before your start tweaking those.
Parameter | Definition |
---|---|
| percent of failures to stop querying Gerrit |
| period in seconds during which requests are monitored |
| minimum requests to calculate state |
| requests which are longer than interval are treated as slow |
| percent of slow requests to stop querying Gerrit |
| if problems are detected than plugin stops querying Gerrit for target interval |
Gerrit tab
For the Jira end user, this integration is visible on the issue view screen on the Gerrit tab and on the Gerrit panel shown on the right side of the Jira issue view.
Gerrit change should include the issue key to be displayed in the Gerrit tab.
Gerrit display type
Since version 7.06.28
, you can select the Gerrit data's List or Table view type.
This is done in Jigit Plugin Config → Global Settings → Gerrit display type.
Above the table view, you see the name of the Gerrit configuration.
Gerrit JQL functions
In Jigit - Jira GitHub & GitLab integration, the JQL (Jira Query Language) function is available for filtering changes in Gerrit.
Jigit leverages the Gerrit REST API to interact with Gerrit and perform JQL-based queries. The JQL function narrows down the Jira issue search result by limiting the number of commits associated with an issue.
In the search query, you need to use the command gerritStatus
.
Examples of search queries you can modify to meet your needs:
issue in gerritStatus(PROJECT_KEY, STATUS):
issue in gerritStatus("TEST", "open") issue in gerritStatus("TEST", "abandoned") issue in gerritStatus("TEST", "new") issue in gerritStatus("TEST", "merged")
issue in gerritStatus(PROJECT_KEY, STATUS, CHANGES_AFTER_DATE):
issue in gerritStatus("TEST", "closed", "2022-10-25")
, where date means “since“/”after”
How to link Gerrit changes to Jira issues?
Updated: