This is a fork of the original JIRA-Gerrit plugin, updated by Zebra Technologies to support the latest Jira Data Center versions.
- Jira Version: 9.12.12 (LTS)
- Java Version: 17
- Data Center Compatible: Yes
- Updated dependencies and APIs for modern Jira compatibility
- Fixed compilation issues with newer Jira versions
- Download the plugin JAR from the
artifacts/directory - In JIRA, navigate to Administration > Manage apps > Upload app
- Upload the
gerrit-plugin-3.5-SNAPSHOT.jarfile - Alternatively, available in the JIRA Marketplace for automatic installation from the JIRA "Find New Plugins" administration panel
-
Generate an SSH keypair for the JIRA user
- Save the private key in a place where you can upload it to JIRA (1)
- The public key will simply be copied/pasted (2)
-
Create a new user in Gerrit that you will use for the integration:
$ ssh gerrit.company.com -p 29418 gerrit create-account jira --email [email protected] --full-name JIRA --ssh-key <paste public key (2)> -
In JIRA, navigate to Administration > Plugins > Gerrit Admin
-
Enter hostname, port, and user under the SSH section
-
Upload the SSH private key generated at (1) above
-
Optionally change the Gerrit search query patterns:
tr:%s- Look for the issue key in a "Bug:" or "Issue:" footertopic:%s- Look for the issue key in the change Topic (uploaded usingHEAD:refs/for/master/(issueKey))message:%s- Look for the issue key in the commit message
- "Gerrit Reviews" issue tab panel to show all reviews related to the issue
- "Gerrit Subtask Reviews" issue tab panel to show reviews related to all the issue's subtasks
- Workflow condition to require that an issue must (or must not) have any open reviews
- Workflow condition to require that an issue must (or must not) have a certain approval score (e.g., Code-Review == 2, or ! Verified < 0)
- Workflow function to perform a Gerrit review
- This is just an argument to the
gerrit review [ChangeId] ..command, so it could be something like--verified +1to give a +1 score; or--submitto submit the change - The Gerrit user configured in the admin panel must have access to perform all necessary steps
- This is just an argument to the
To build the plugin from source:
atlas-mvn clean packageThe compiled JAR will be in target/gerrit-plugin-3.5-SNAPSHOT.jar
- Jira Data Center 9.12.12 (LTS) and higher
- Java 17
- Any Jira-supported database (PostgreSQL, MySQL, Oracle, SQL Server)
- H2 database supported for development/testing only
- Unit Tests (partial)
- Possibly per-user SSH key configurations (instead of everything done as the JIRA user)
- Possibly allow a second "suexec" SSH key so the JIRA user can spoof the acting JIRA user as a Gerrit user
- Resolve
gerrit-eventsdependency so it does not rely on a SNAPSHOT version