its-jira configuration with multiple jira instance

380 views
Skip to first unread message

Ashwini T R

unread,
Aug 9, 2016, 9:07:59 AM8/9/16
to Repo and Gerrit Discussion
Hi,

We have configured its-jira plugin with multiple jira projects, and please find our configuration in gerrit.config file below:

[its-jira]
        url = https://<jira1_server.com
        username = gerrit_jira
[commentLink "its-jira"]
        match = ([A-Z]+-[0-9]+)
        association = SUGGESTED


[its-jira-jira]
        url = https://jira2_server.com
        username = gerrit_jira
[commentLink "its-jira-jira"]
        match = ([A-Z]+-[0-9]+)
        association = SUGGESTED


[its-jira-jira3]
        url = https://jira3._server.com
        username = gerrit_jira
[commentLink "its-jira-jira3"]
        match = ([A-Z]+-[0-9]+)
        association = SUGGESTED


In the above configuration we are able to enable any one plugin as "true" and able to commit but the issue is when we 
enable "jira2_server.com" and do a commit the gerrit will show the wrong JIRA URL it will point to jira1_server.com.:(:(

Please help to resolve this.

Regards
Ashwini

Sven Selberg

unread,
Aug 9, 2016, 10:35:19 AM8/9/16
to Repo and Gerrit Discussion
Can't guarantee that this will work but:
You'll need a separate plugin for each jira instance. When you compile the you compile the plugins you'll have to give each a separate pluginName [1] ('its-jira', 'its-jira-jira', 'its-jira-jira3'), since the configuration (and hence the URL) is gathered by using the pluginName [2].

Luca Milanesio

unread,
Aug 9, 2016, 10:46:40 AM8/9/16
to Sven Selberg, Repo and Gerrit Discussion
Yeah ... that sucks I know but that's the only way to make it work at the moment.
It should work :-)

Luca.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rajesh M

unread,
Oct 6, 2016, 11:07:24 AM10/6/16
to Repo and Gerrit Discussion, sven.s...@axis.com
Hi,

We have cooked the plugin with different name, but still the commentLink is not updating with the enabled one.
If gerrit.config having JIRA instances in order JIRA2,1,3,4 means, always the first configured JIRA node URL is displaying in commentlink.

-Rajesh M

Sven Selberg

unread,
Oct 6, 2016, 11:25:29 AM10/6/16
to Rajesh M, Repo and Gerrit Discussion

The commentlink sections match the same line “([A-Z]+-[0-9]+)” and I’m pretty sure Gerrit doesn’t support multiple links for one string.

You’ll have to separate the matching depending on which jira instance the ticket is on.

So:

ISSUE-345

Will use the first matching commentlink to get a link.

 

You’ll have to disallow the same issue name on two separate jira instances or use a jira-instance identifier when using it in Gerrit like:

J1-ISSUE-345

J2-ISSUE-345

And match accordingly.

 

/Sven

Rajesh M

unread,
Dec 14, 2016, 11:44:40 AM12/14/16
to Repo and Gerrit Discussion, rajesh....@gmail.com
Hi,

Thanks for the info. Yes, unique match string is working as expected. But we have four different jira instances with same kind of pattern and ~10k users using from long back. So, changing the pattern is a big deal.

Is it possible to hardcore the commentlink displayWebUI link in source and cook the plugin ?

-Thanks

Khyati Desai

unread,
Jul 20, 2018, 5:51:10 AM7/20/18
to Repo and Gerrit Discussion
Hi Rajesh

Were you abel to make this work?
I am also having similar issue

Thanks
Reply all
Reply to author
Forward
0 new messages