Hi,
I was yesterday at the Java Forum Stuttgart conference (
http://www.java-forum-stuttgart.de/ )
and attended a session about pre-tested-commits with git/gerrit/jenkins, which was quite
interesting [1].
As preface: gerrit, which is a review system can act as a git server.
They showcased two setups:
1) user pushes a change. Gerrit can trigger a build from master + the changeset
from the user. If this is successful, a reviewer will be informed to review the changes.
Clicking "ok" submits the changes to the real repo
2) user pushes a change. Gerrit can trigger a build from master + the changeset
from the user. If this is successful, Jenkins tells Gerrit that the change has also
been reviewed so that Gerrit can then directly push to the backend repo.
In both cases if the initial build fails, no code is committed to the real repo; the
committer gets feedback and can fix his code, send an update via git amend
and the process can run again.
I think this is a pretty interesting idea especially if 1 and 2 could be combined
for inside committers on master we'd go for 1) and for community members or
pushes to a release branch we'd go for 2). If the Gerrit server would be internal,
we could set up an email alias where contributors can email their patch to.
This patch would then be picked up by Gerrit and 1) will run.
Of course for this to be more effective, we should really change how the
build works (e.g. only building enterprise if a push goes to core or enterprise
or building plugins only if a push goes to core or plugins etc. - more fine grained is
better ),
as the current 1:30h build times are just too long.
We do already a little bit of 1) by the pre-compile job catching plain compile errors,
but effectively the bad code (in case of a compile error) would already be in the repo,
causing an issue for all others pulling from that version.
[1] Abstract with link to slides:
http://www.java-forum-stuttgart.de/abstracts.html#C7
--
Reg. Adresse: Red Hat GmbH, Technopark II, Haus C,
Werner-von-Siemens-Ring 14, D-85630 Grasbrunn
Handelsregister: Amtsgericht München HRB 153243
Geschaeftsführer: Mark Hegarty, Charlie Peters, Michael Cunningham, Charles Cachera