[ovirt-devel] Gerrit parallel patch handling and CI (Or, why did my code fail post-merge)

Vojtech Szocs vszocs at redhat.com
Wed Nov 30 17:12:36 UTC 2016



----- Original Message -----
> From: "Barak Korren" <bkorren at redhat.com>
> To: "Vojtech Szocs" <vszocs at redhat.com>
> Cc: "devel" <devel at ovirt.org>
> Sent: Wednesday, November 30, 2016 9:20:27 AM
> Subject: Re: [ovirt-devel] Gerrit parallel patch handling and CI (Or, why did my code fail post-merge)
> 
> On 29 November 2016 at 19:34, Vojtech Szocs <vszocs at redhat.com> wrote:
> >
> > Question: after the patch is submitted in Gerrit (it's fully acked
> > and maintainer hits the "Submit" button), does Gerrit allow us to
> > run CI (e.g. `check-merged` script) *before* doing the actual merge?
> >
> > [In other words, does Gerrit support gating merge based on CI script?]
> 
> No.
> See separate thread about merge-gateing:
> http://lists.ovirt.org/pipermail/devel/2016-November/014192.html

Thanks, I've missed that thread.

So before we adopt auto-submit-after-ci-pass (e.g. using Zuul, as Eyal
mentioned in that thread), we should be able to manually trigger heavy
CI (check-merged) job from Gerrit web interface, is that correct?

If so, it would be the patch owner's responsibility to submit (merge)
only after heavy CI (check-merged) pass?

As for Gerrit's "Submit" button hook, there's "pre-merge validation":

  https://gerrit-review.googlesource.com/Documentation/config-validation.html#pre-merge-validation
  https://github.com/gerrit-review/gerrit/blob/master/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/MergeValidationListener.java

This validation API (MergeValidationListener) doesn't seem async as it
relies on exception (MergeValidationException) to block the operation.

So we could actually write Gerrit plugin using MergeValidationListener
that would operate in the following way:

1, on first "Submit" button click, tell Jenkins CI to run check-merged
   and block merge (e.g. providing reason like "wait till CI finishes")
2, Jenkins CI is expected to set some flag on patch once it finishes
3, on next "Submit" button click, block unless flag has "ok" value

> 
> > That said, +1 on "Fast Forward Only" submit type.
> 
> So far only VDSM stepped forward to try it out - and it proved to be
> too cumbersome for VDSM maintainers - so switched back to "Merge if
> Necessary".
> 
> --
> Barak Korren
> bkorren at redhat.com
> RHCE, RHCi, RHV-DevOps Team
> https://ifireball.wordpress.com/
> 



More information about the Devel mailing list