On Wed, 21 Apr 2021 at 04:44, Nasser Grainawi <
nas...@codeaurora.org> wrote:
> On Apr 6, 2021, at 3:26 AM, Christian Gagneraud <
chg...@gmail.com> wrote:
> On Tuesday, 6 April 2021 at 04:16:25 UTC+12
deis...@gmail.com wrote:
>>
>> Hi all,
>>
>> I was wondering if anyone can share some light how one or android-review can build all changes in a topic as one?
>>
>> The idea is when you develop AOSP, sometimes you have changes across multiple repos, and you want to validate & merge these changes in one go.
>>
>> Gerrit solves this problem with 'topic' ( and change.submitWholeTopic = true)
>>
>> I was wondering if anyone can share how they do their CI based on the topic
>>
>> My initial idea is, I can have a server listening for gerrit-events, and when a topic is submitted/updated - my server can generate a temporary manifest (based on develop/master branch, but include the changes in topic) & submit this to the CI to validate.
>>
>> Has anyone else done something similar? Any hits how Google does it with android-review ?
>
>
> I would be interesting to know too. I find it weird, that one has to write lot of gluing code to make gerrit and jenkins act together.
>
>
> We created the batch plugin
https://gerrit.googlesource.com/plugins/batch for exactly this purpose. We haven’t provided an out-of-the-box integration with Jenkins yet, but the idea would be to 1) poll using gerrit query, then 2) use the batch merge-change command to add whichever changes you want to validate together to a single batch, 3) download the automatically created batch ref for each repo into your CI workspace, and finally 4) use batch submit (if you want) to update the destination branch for each project in the batch to be exactly the ref/SHA-1 you downloaded in 3 and close the changes in the batch.
>
> The docs have a lot more detail on those commands and I’d be happy to help answer more questions if you have any.
>
> As an aside, our CI teams use the task plugin
https://gerrit.googlesource.com/plugins/task for finding the correct changes during that polling in step #1.