Support multiple Jira instances
Previously, its-jira only supported connecting to a single Jira server.
In corporate environments, it is not unusual to have multiple Jira
servers and it is a common requirement to integrate Gerrit with those.
This change enables its-jira to integrate with multiple Jira servers at
the Gerrit project level, i.e., a Gerrit project can be associated with
a particular Jira instance. This is done by specifying the Jira server
URL, username and password in the project configuration. The plugin adds
a "commentlink" section accordingly.
A typical Jira server configuration in project.config will look like:
enabled = true
instanceUrl = http://localhost:8075/
jiraUsername = admin
password = admin
match = ([A-Z]+-[0-9]+)
link = http://localhost:8075/browse/$1
In case its-jira plugin is enabled for a project but no Jira server is
configured for this project, the default configuration will be the one
defined in gerrit.config. If no Jira server information is defined in
gerrit.config, an error is logged and the Jira integration is disabled
for the project.
Please note that this functionality is considered EXPERIMENTAL as the
credentials are stored in clear text at the project level and sensitive
information (the password of the Jira instance) could be exposed. The
work to add encryption is ongoing  and once a solution is found to
the raised issues, it will be leveraged by this plugin.
17 files changed