Configuring its-jira to perform project-specific transitions

1,257 views
Skip to first unread message

Igor

unread,
Feb 24, 2015, 11:18:53 AM2/24/15
to repo-d...@googlegroups.com
Hi,

I wonder whether it is possible to set issue transition rules on a per-project basis. We have different jira projects used in 2 gerrit projects and issue transition rules are different.

Thanks in advance,
Igor.

Zaro

unread,
Feb 24, 2015, 12:18:44 PM2/24/15
to Igor, repo-d...@googlegroups.com
Yes, you can enable the an its plugin on a per-project basis by adding the following to project.config in refs/meta/config

  [plugin "its-jira"]
    enabled = true



--
--
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.

Luca Milanesio

unread,
Feb 24, 2015, 12:45:37 PM2/24/15
to Zaro, Igor, repo-d...@googlegroups.com
Hi Zaro,
I think that Igor referred to the ability to customise the flow rather than just enable/disable the its-jira plugin.

Luca.

Zaro

unread,
Feb 24, 2015, 1:07:37 PM2/24/15
to Luca Milanesio, Igor, repo-d...@googlegroups.com
Ahh, then in that case  you will probably need to install multiple its-jira plugins and independently configure each to suite your flow.    

Read "Multiple ITS" section:

Configuration can be done with multiple etc/its/actions-@PLUGIN@.config files:
 

Igor

unread,
Feb 25, 2015, 5:36:07 AM2/25/15
to repo-d...@googlegroups.com, luca.mi...@gmail.com, igor.lit...@gmail.com
As far as I can understand its-jira documentation the only place where I can configure transition rules is the file $GERRIT_SITE/etc/issue-state-transition.config, which is not project-specific, so I can't see how I can setup different transitions for different projects.

Also I tried to install the second instance of its-jira plugin with another name, but it didn't work. Seems like plugin name is embedded in plugin and --name option was ignored (although it is mandatory in plugin install command).

Thanks,
Igor.

Khai Do

unread,
Feb 25, 2015, 5:22:17 PM2/25/15
to repo-d...@googlegroups.com, luca.mi...@gmail.com, igor.lit...@gmail.com
its-jira plugin extends the its-base plugin.  The its-base plugin contains documentation that applies to all its-* plugins.

Also the change [1] to provide this feature was recently merged.  Not sure which version of Gerrit + its-jira-plugin you are running but you'll need to make sure it's a available in your build(s).

Yogesh Bhat

unread,
May 28, 2015, 9:13:12 AM5/28/15
to repo-d...@googlegroups.com, igor.lit...@gmail.com, luca.mi...@gmail.com
Hi Khai,

I guess my below query is in-lined with this discussion.

jira id enforcement in git commit message is configurable via "commentLink". I have got a scenario where it has to be "mandatory" for few git projects and for others it has to be suggested. 

is this doable? I have tried by adding commentlink in "project.config (branch: refs/meta/config)" of a given project, specified association=MANDATORY Commit message get link around jiraid, but doesn't mandate the association. Please suggest me. 

[commentLink "its-jira"]
match = ([A-Z]+-[0-9]+)
link = http://jira.example.com/browse/$1
association = MANDATORY

thanks,
Yogesh

Christian Aistleitner

unread,
May 28, 2015, 10:06:43 AM5/28/15
to Yogesh Bhat, repo-d...@googlegroups.com, igor.lit...@gmail.com, luca.mi...@gmail.com
Hi Yogesh,

On Thu, May 28, 2015 at 06:13:12AM -0700, Yogesh Bhat wrote:
> I guess my below query is in-lined with this discussion.
>
> jira id enforcement in git commit message is configurable via
> "commentLink". I have got a scenario where it has to be "mandatory" for few
> git projects and for others it has to be suggested.
>
> is this doable?

Not in a nice, easy and smooth way.

Before 2.11, it's not possible with pre-built artifacts. You'd have
backport patches yourself.

From 2.11 onwards, it's possible to load its-jira twice under
different names. E.g.: Once as
* its-jira-mandatory, and once as
* its-jira-suggested.

Then the “Plugins / Installed” should show two plugins. Once,
“its-jira-mandatory”, and once “its-jira-suggested”.

Then you'd have to configure gerrit with

[commentLink "its-jira-mandatory"]
match = ([A-Z]+-[0-9]+)
link = http://jira.example.com/browse/$1
association = MANDATORY

[commentLink "its-jira-suggested"]
match = ([A-Z]+-[0-9]+)
link = http://jira.example.com/browse/$1
association = SUGGESTED

in your gerrit.config (and also configure the jira url, user, ... in
the corresponding config sections).

This allows you to enable/disable the mandatory respectively suggested
its-jira variant on a per project basis.

So you can select per project which binding to jira you want.

The crux is that both commentlinks share the same “match”. So the
([A-Z]+-[0-9]+) is getting twice decorated as link. To work around
this, you have to make the two matches distinct, which is just an
exercise in regular expressions.

Have fun,
Christian


P.S.: Or you could implement commentlink inheritance in its-base and
upload the patch to gerrit-review ;-)



--
---- quelltextlich e.U. ---- \\ ---- Christian Aistleitner ----
Companies' registry: 360296y in Linz
Christian Aistleitner
Kefermarkterstrasze 6a/3 Email: chri...@quelltextlich.at
4293 Gutau, Austria Phone: +43 7946 / 20 5 81
Fax: +43 7946 / 20 5 81
Homepage: http://quelltextlich.at/
---------------------------------------------------------------
signature.asc
Reply all
Reply to author
Forward
0 new messages