Integrate Gerrit and LAVA

Registered by Zach Pfeffer on 2011-07-31

Gerrit depends on a test framework to test its test builds to determine if a change good or not. This BP will implement this support.

Blueprint information

Zach Pfeffer
Frans Gifford
Frans Gifford
Series goal:
Accepted for 2011q2
Milestone target:
milestone icon 11.09
Started by
David Zinman on 2011-10-03
Completed by
David Zinman on 2011-10-03


[dzin, Oct 3, 2011]: bug created to track in progress item:

Changes are now automatically tested with LAVA in order to reduce the time and effort of integration and testing.

A change is automatically tested and merged or not based on the result

fgiff, 20110902: Gerrit's SSH API does not yet allow checking dependencies between changesets, see

fgiff, 20110815: We can use $CONFIGURATION to query gerrit for reviewed changes, repo download them and then build. We can also assemble the [dis]approval command to be called when the build completes. - Take auth & security seriously here.

fgiff, 20110810: We can use the comment-added hook to determine when a changeset scores highly enough to deserve testing (i.e. gets a +2). This is the point at which we want to test.

fgiff, 20110809: We can use gerrit hooks to trigger a submission to android-build. Within android-build, we can use (abuse?) $CONFIGURATION to execute a repo download of the gerrit change which then gets built.
See also

fgiff, 20110803: Sketching out the workflow between systems. The key thing I want to capture is which system initiates the interaction, i.e. if we're pushing or pulling results about. The order of the operations is less important; if a result isn't available to be pulled, we'll just retry later.

User Gerrit Android-build.l.o LAVA
   | | | |
   |>Submit changeset>| | |
   | |>Changeset gets +2\ | |
   | |<------------------------------/ | |
   | |<---Query +2-ed changes---<| |
   | |>--Return +2-ed changes--->| |
   | | |>Build\ |
   | | |<-------/ |
   | | |>Queue for testing>|
   | |<Add build result comment<| |
   | | | |>Store test result\
   | | | |<--------------------------/
   | |<--------------------Add test result comment--------------<|


Work Items

Work items:
Pass test result to android-build: DONE
Determine how to create and run android-build.l.o jobs from gerrit: DONE
Determine what manifests and boards should be tested for a gerrit changeset: DONE
Make gerrit create and run build jobs on android-build.l.o: DONE
[pfalcon] Set up account for android-build.l.o on gerrit: DONE
[pfalcon] Set up account for gerrit on android-build.l.o: DONE
Have android-build result submitted to gerrit: DONE
Have lava test result submitted to gerrit: DONE
Test a change from submission to merging based on LAVA result: DONE
Establish the workflow model we want: DONE
Document usage: DONE
Deploy scripts: DONE

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.