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?

0
6 comments
Avatar
Permanently deleted user

Hi Evan,

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

0
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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

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.