Building/triggering Gerrit changes

I am attempting to build patches submitted to gerrit in order to verify that the patch compiles.

I have the VCS trigger branch filter set to +:refs/changes/*

I also have the VCS branch specification set to +:refs/changes/*

However, builds are not triggering. If I look at the branches tab for the configuration I can see these changes in the inactive branch list. I could not find much documentation on inactive versus active branches or why some are active and some are not.

I can select the inactive branch and manually start a build which works but obviously I want this to be automatic.

Does anyone have a successful setup for building changes submitted to Gerrit? What's the recipe?

6 comments
Comment actions Permalink

Hi Evan,

we have this working, however we use a "Branch Remote Run Trigger" on "refs/changes/*", and no branch specification.

0
Comment actions Permalink

Thanks for the tip! This is actually working for me with one of my git repositories but not another one for an unknown reason. I am fairly certain all of the settings and permissions are the same. Is there anyway to debug a trigger to know why it isn't firing?

0
Comment actions Permalink

You can check the log files on the server side, among other the vcs log.

Make sure Teamcity can match the identify used in the repository with the one in Teamcity. Other wise, this kind of trigger won't work. In the VCS settings, there is an option to set what field to use (name, email...).

0
Comment actions Permalink

Oh perhaps that is partially my problem. A lot of our developers are not in the teamcity system; never requested access.

0
Comment actions Permalink

For anyone using refs/changes/*, be aware that this solution doesn't scale well. We had to give up this approach due to performance and reliability, since Teamcity didn't like the thousands of branches Gerrit returned.
We use instead of homegrown script that maintains a refs/heads/review/* name space that contains references to active code reviews only. I plan to implement this as a Gerrit plugin at some point.

0
Comment actions Permalink

Thank you for sharing your experience. It would be great if you create Gerrit plugin for TeamCity and share it with community.
If someone wants to see Gerrit support in TemaCity, please vote for the feature request on our tracker: https://youtrack.jetbrains.com/issue/TW-19102.

0

Please sign in to leave a comment.