Jenkins, Gerrit-trigger and git submodules

852 views
Skip to first unread message

Rens Admiraal

unread,
Jul 2, 2012, 2:31:44 PM7/2/12
to jenkins...@googlegroups.com
Hi,

I'm searching for a while now for a solution to use continues integration in a good way. I'm using a (base) repository which contains the base structure for my application, and furthermore a lot of git submodules pointing to repositories containing the packages used in my project.

What I would like to achieve is having one job which is triggered by a new patch pushed to gerrit if this patch is in the base repository, or one of the package repositories. This can of course be done using the gerrit-trigger plugin, just by setting multiple gerrit projects in the 'Gerrit trigger' section of the job configuration. But now I can't use the GERRIT_REFSPEC in my SCM configuration as this would checkout the base repository in my workspace, and checkout the patch of my submodule directly in the root of the workspace, which is of course not what I want.

So, how should I approach this? Would it be possible to configure the job in such a way that the git plugin recognizes that the patchset on which the job triggers is actually a change in a submodule, and if so checkout the patch in the path of the submodule?

And, if this is possible, is there a way to make use of topic branches in gerrit like "if there's a topic branch on the submodules patch also checkout all other patches with the same topic branch if there's also a submodule for this repository".

I would really like to know if this is possible, or if I have a completely wrong approach to do this.

Greetz,
Rens

Karsten Dambekalns

unread,
Jul 6, 2012, 6:47:02 AM7/6/12
to jenkins...@googlegroups.com
Hi Rens.

On 02.07.2012, at 20:31, Rens Admiraal <rens.a...@gmail.com> wrote:
> I'm searching for a while now for a solution to use continues integration in a good way. I'm using a (base) repository which contains the base structure for my application, and furthermore a lot of git submodules pointing to repositories containing the packages used in my project.

It seems we are the only ones doing that… or not? Consider this mail a "ping" for this thread, and a plea for feedback - even if it's only "we need more details to provide hints on that one" :)

Regards,
Karsten

mooyah

unread,
Jul 18, 2012, 12:30:16 AM7/18/12
to jenkins...@googlegroups.com
I would suggest the following:

- One jenkins job for each submodule, allow the jobs for each module to run the unit tests for each module to ensure the gerrit change is good to go
- Another jenkins job for each supermodule. This jenkins job would poll for every commit in the supermodule and build them as they happen.

I see a big flaw with this strategy that each submodule gerrit change would need to be merged into the respective submodule before integration testing could occur with the supermodules. I'm not sure what other possible solutions could be. I will be looking into implementing something like this soon (in the next quarter), so will try to update you about my progress.

-Joel

xJom

unread,
Nov 19, 2015, 8:04:24 AM11/19/15
to Jenkins Users
Old thread, but I have searched a lot for possible solutions, and found a few, but maybe not the most excellent one.

One approach is just to let some builds fail and then manually let them through. This gets tedious over time.

One approach seems to be using the topic, but there is no good way to keep a topic together at the time of "Patchset created". 

One other approach is to make a retrigger, which executes everytime some change with the same topic is changed. But if the change is spread out through a lot of submodules, there can be a lot of failures before we have a final result. 

An enhancement is to manually tell Gerrit, when all patch sets of a topic is uploaded, and then retrigger all patchset created included in the topic.

The problem I have, that is not solved with @mooyah's approach is that one of the submodules cannot be built on its own, but is a collection of common parts. This common submodule breaks the build very often.

I really want the CI to wait for the whole topic upload.

Also I found that Gerrit merges the submodules if you Submit the superproject, even if no review is done in the submodules. This seemed quite weird.

Maybe I am also missing something about the superproject/submodules handling in Gerrit?

BR
/Mattias
Reply all
Reply to author
Forward
0 new messages