Skip to content

zebratechnologies/dmo-setp-jira-gerrit-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JIRA-Gerrit integration plugin

This is a fork of the original JIRA-Gerrit plugin, updated by Zebra Technologies to support the latest Jira Data Center versions.

Updates

  • 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

Install

  • Download the plugin JAR from the artifacts/ directory
  • In JIRA, navigate to Administration > Manage apps > Upload app
  • Upload the gerrit-plugin-3.5-SNAPSHOT.jar file
  • Alternatively, available in the JIRA Marketplace for automatic installation from the JIRA "Find New Plugins" administration panel

Getting Started

  • 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:" footer
    • topic:%s - Look for the issue key in the change Topic (uploaded using HEAD:refs/for/master/(issueKey))
    • message:%s - Look for the issue key in the commit message

Features

  • "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 +1 to give a +1 score; or --submit to submit the change
    • The Gerrit user configured in the admin panel must have access to perform all necessary steps

Build

To build the plugin from source:

atlas-mvn clean package

The compiled JAR will be in target/gerrit-plugin-3.5-SNAPSHOT.jar

Compatibility

  • 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

TODO

  • 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-events dependency so it does not rely on a SNAPSHOT version

About

JIRA Gerrit Plugin, to integrate Gerrit into JIRA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 98.2%
  • CSS 1.8%