Issue 2483: Gerrit-trigger path pattern
Status:  Invalid
Owner: ----
Closed:  Feb 2014
Reported by pavel.s....@gmail.com, Feb 17, 2014
We are trying to use Jenkins with Gerrit-Trigger and i'm trying to configure Gerrit-trigger plugin pattern to trigger builds only if change in specific folder of my Git branch occur.

The trigger recognize my settings:

Pattern
Plain: FirstProject

Branch
Plain: temp-branch
The trigger recognizes the project name and the the branch name and trigger builds only for those branches. The problem is when i try to specify the path:

File
Path tools/**

The setup can be found in the attached screenshot.

There is no matter what I will type for path or if it will be a reg ex or plain text it builds every build that is using this branch. Like i didn't type anything for path pattern. It just doesn't recognize that i'm filtering this field. I've tried to make the configuration with the Dynamic Trigger Configuration but with the same result. I've searched a lot but i didn't find any possible solution.

Software versions:

Jenkins 1.532.1
Gerrit 2.8
Gerrit-trigger plugin 2.11.0
Any help is appreciated. Thank you in advance.
gerrit-pattern.png
21.7 KB   View   Download
Feb 23, 2014
Project Member #1 david.pu...@sonymobile.com
In your screenshot you have the File setting using the "RegExp" type.  Try changing that to "Path".

Setting this issue to "invalid" because it's not a Gerrit issue.

Status: Invalid
Feb 24, 2014
#2 pavel.s....@gmail.com
There is no mater of the type, I've tried them all, but the result is the same.
It is Gerrit issue, when there is ref-updated the option to choose path is taken under consideration.
It just not working for ref-update.
Oct 15, 2014
#3 daimon...@gmail.com
Same issue here. I can't see anywhere within the plugin's documentation if this is a bug or an expected behavior. "Ref updated" doesn't care about specific paths or topics. 
Nov 11, 2014
#4 patxi.go...@gmail.com
If you are accepting changes through the UI, then using change-merged instead of ref-updated will do the work (see http://stackoverflow.com/a/18139211). 

Having a look at the parameters of the job, when a change-merged is triggered, there is information about the changeset that triggers the build. On the contrary, when you use ref-updated, there's no information about the changeset, so it is not possible to check for file inclusion. 

Dec 10, 2014
#5 rgunre...@googlemail.com
Sorry, but for me it is not quiet obvious how to configure jenkins/gerrit that the filelist is coming with when a patchset is created or updated.
Could someone state out more precisely what is the problem and how to solve that. The given stackoverflow url is not that informative for me how to fix it.

Kindly regards
Roger