0Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 0
What’s new in Gerrit 3.0
… and beyond
Luca Milanesio
Gerrit Code Review Maintainer
GerritForge
1Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 1
About GerritForge
Founded in the
UK
HQ in London Committed to
OpenSource
2Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 2
New features PolyGerrit is THE Gerrit UI
GWT is gone
FOREVER
3Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 3
PolyGerrit in-line Edit
Codemirror
Syntax highlight
4Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 4
PolyGerrit goodies
Dark Mode
Custom Themes
5Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 5
PolyGerrit Mobile / Tablet view
Fluid Layout
6Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 6
PolyGerrit JavaScript plugins (e.g. Checks)
UI
extension
points for
plugins
7Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 7
PolyGerrit out of the box experience
First steps
Help for new
users
8Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 8
Notedb happened
NoteDB = NO(te) DB
9Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 9
The journey to v3.0
Dave Borowitz – Gerrit User Summit 2017
10Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 10
The journey to v3.0
Dave Borowitz – Gerrit User Summit 2017
Gerrit 2.16
Gerrit 3.0
2019
11Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 11
Migration path v3.0
• v2.14 / ReviewDb
• v2.15 / ReviewDb
• v2.16 / ReviewDb
• v2.16 / NoteDb
•v3.0
https://www.workeastren.co.uk/case-studies/paul-steps-to-success-case-study/
12Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 12
NoteDb the most innovative feature of Gerrit
Commits + Reviews + Meta-data
Accounts + Groups
è ALL stored in Git
13Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 13
NoteDb fully consistent backups
Online backups
100% consistency
14Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 14
NoteDb remove single-point-of-failure
ONE LESS
point of failure (DBMS)
15Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 15
NoteDb on-line migrations
NO MORE Schema Migration
zero-downtime upgrade
16Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 16
NoteDb disaster recovery
Replication
to DR site
of ALL Gerrit data
17Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 17
NoteDb full audit and compliance
Account history
Groups history
Review history
ALL in Git repo as JSON
18Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 18
NoteDb full security
ALL objects protected
with uniform ACLs
And Group-based access
19Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 19
NoteDb allow data insight and analytics
Expose ALL reviews
Data as JSON
for analytics
20Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 20
NoteDb increased performance and low latency
Read code and reviews
In the same JGit access
and cache
21Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 21
NoteDb example
$ git fetch origin refs/changes/95/218095/meta && git log -p FETCH_HEAD
commit ac3c2780a9737356e3a494f772570608ca5fb66b
Author: Gerrit User 1006192 <1006192@173816e5-2b9a-37c3-8a2e-48639d4f1153>
Date: Mon Mar 18 17:54:15 2019 +0000
Update patch set 1
Change has been successfully merged by Luca Milanesio
Patch-set: 1
Status: merged
Tag: autogenerated:gerrit:merged
Reviewer: Gerrit User 1006192 <1006192@173816e5-2b9a-37c3-8a2e-48639d4f1153>
Label: SUBM=+1
Submission-id: 18095-1552931655231-726b23a
Submitted-with: OK
Submitted-with: OK: Verified: Gerrit User 1006192 <1006192@173816e5-2b9a-37c3-8a2e-48639d4f1153>
Submitted-with: OK: Code-Review: Gerrit User 1029953 <1029953@173816e5-2b9a-37c3-8a2e-48639d4f1153>
commit 92b2da48565dc807cb88a8df190452add9b150b2
Author: Gerrit User 1006192 <1006192@173816e5-2b9a-37c3-8a2e-48639d4f1153>
Date: Mon Mar 18 17:54:11 2019 +0000
Update patch set 1
Patch Set 1: Verified+1
22Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 22
Submit Rules bye bye PROLOG
Submit rules extension point
In ANY language
(also PROLOG)
23Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 23
Submit Rules PROLOG
submit_rule(submit(R)) :-
gerrit:unresolved_comments_count(0),
!,
gerrit:uploader(U),
R = label('All-Comments-Resolved', ok(U)).
submit_rule(submit(R)) :-
gerrit:unresolved_comments_count(U),
U > 0,
R = label('All-Comments-Resolved', need(_)).
24Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 24
Submit Rules Java
public class NoUnresolvedCommentsRule implements SubmitRule {
private static final SubmitRequirement REQUIREMENT =
SubmitRequirement.builder()
.setType("unresolved_comments")
.setFallbackText("Resolve all comments")
.build();
@Override
public Collection<SubmitRecord> evaluate(ChangeData cd, SubmitRuleOptions options) {
Integer unresolvedComments = cd.unresolvedCommentCount();
SubmitRecord sr = new SubmitRecord();
sr.requirements = Collections.singletonList(REQUIREMENT);
sr.status =
unresolvedComments == null || unresolvedComments > 0
? SubmitRecord.Status.NOT_READY
: SubmitRecord.Status.OK;
return ImmutableList.of(sr);
}
}
25Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 25
Core plugins plugin manager
Discover and install with one click
26Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 26
More core plugins
Gitiles (!)
Delete-project (finally !!)
WebHooks (yeah !)
27Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 27
Native Packages updates
RPMs for RedHat & CentOS 7.6
Debs for Debian & Ubuntu 18.04
Support for Docker in production
28Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 28
What’s coming in v3.1
Polymer 2.0
Git Protocol v2 (secured)
Performance
Stability and Fixes
More CI integration
29Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 29
Q&A: excited about the future of Gerrit?
Image from: http://cypp.rutgers.edu/ru-voting/political-information/public-opinion-polls/
30Gerrit User Summit 2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 30
Wants to know more?
GerritForge.com/contact

What's new in Gerrit Code Review 3.0

  • 1.
    0Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 0 What’s new in Gerrit 3.0 … and beyond Luca Milanesio Gerrit Code Review Maintainer GerritForge
  • 2.
    1Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 1 About GerritForge Founded in the UK HQ in London Committed to OpenSource
  • 3.
    2Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 2 New features PolyGerrit is THE Gerrit UI GWT is gone FOREVER
  • 4.
    3Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 3 PolyGerrit in-line Edit Codemirror Syntax highlight
  • 5.
    4Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 4 PolyGerrit goodies Dark Mode Custom Themes
  • 6.
    5Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 5 PolyGerrit Mobile / Tablet view Fluid Layout
  • 7.
    6Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 6 PolyGerrit JavaScript plugins (e.g. Checks) UI extension points for plugins
  • 8.
    7Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 7 PolyGerrit out of the box experience First steps Help for new users
  • 9.
    8Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 8 Notedb happened NoteDB = NO(te) DB
  • 10.
    9Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 9 The journey to v3.0 Dave Borowitz – Gerrit User Summit 2017
  • 11.
    10Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 10 The journey to v3.0 Dave Borowitz – Gerrit User Summit 2017 Gerrit 2.16 Gerrit 3.0 2019
  • 12.
    11Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 11 Migration path v3.0 • v2.14 / ReviewDb • v2.15 / ReviewDb • v2.16 / ReviewDb • v2.16 / NoteDb •v3.0 https://www.workeastren.co.uk/case-studies/paul-steps-to-success-case-study/
  • 13.
    12Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 12 NoteDb the most innovative feature of Gerrit Commits + Reviews + Meta-data Accounts + Groups è ALL stored in Git
  • 14.
    13Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 13 NoteDb fully consistent backups Online backups 100% consistency
  • 15.
    14Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 14 NoteDb remove single-point-of-failure ONE LESS point of failure (DBMS)
  • 16.
    15Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 15 NoteDb on-line migrations NO MORE Schema Migration zero-downtime upgrade
  • 17.
    16Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 16 NoteDb disaster recovery Replication to DR site of ALL Gerrit data
  • 18.
    17Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 17 NoteDb full audit and compliance Account history Groups history Review history ALL in Git repo as JSON
  • 19.
    18Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 18 NoteDb full security ALL objects protected with uniform ACLs And Group-based access
  • 20.
    19Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 19 NoteDb allow data insight and analytics Expose ALL reviews Data as JSON for analytics
  • 21.
    20Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 20 NoteDb increased performance and low latency Read code and reviews In the same JGit access and cache
  • 22.
    21Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 21 NoteDb example $ git fetch origin refs/changes/95/218095/meta && git log -p FETCH_HEAD commit ac3c2780a9737356e3a494f772570608ca5fb66b Author: Gerrit User 1006192 <1006192@173816e5-2b9a-37c3-8a2e-48639d4f1153> Date: Mon Mar 18 17:54:15 2019 +0000 Update patch set 1 Change has been successfully merged by Luca Milanesio Patch-set: 1 Status: merged Tag: autogenerated:gerrit:merged Reviewer: Gerrit User 1006192 <1006192@173816e5-2b9a-37c3-8a2e-48639d4f1153> Label: SUBM=+1 Submission-id: 18095-1552931655231-726b23a Submitted-with: OK Submitted-with: OK: Verified: Gerrit User 1006192 <1006192@173816e5-2b9a-37c3-8a2e-48639d4f1153> Submitted-with: OK: Code-Review: Gerrit User 1029953 <1029953@173816e5-2b9a-37c3-8a2e-48639d4f1153> commit 92b2da48565dc807cb88a8df190452add9b150b2 Author: Gerrit User 1006192 <1006192@173816e5-2b9a-37c3-8a2e-48639d4f1153> Date: Mon Mar 18 17:54:11 2019 +0000 Update patch set 1 Patch Set 1: Verified+1
  • 23.
    22Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 22 Submit Rules bye bye PROLOG Submit rules extension point In ANY language (also PROLOG)
  • 24.
    23Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 23 Submit Rules PROLOG submit_rule(submit(R)) :- gerrit:unresolved_comments_count(0), !, gerrit:uploader(U), R = label('All-Comments-Resolved', ok(U)). submit_rule(submit(R)) :- gerrit:unresolved_comments_count(U), U > 0, R = label('All-Comments-Resolved', need(_)).
  • 25.
    24Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 24 Submit Rules Java public class NoUnresolvedCommentsRule implements SubmitRule { private static final SubmitRequirement REQUIREMENT = SubmitRequirement.builder() .setType("unresolved_comments") .setFallbackText("Resolve all comments") .build(); @Override public Collection<SubmitRecord> evaluate(ChangeData cd, SubmitRuleOptions options) { Integer unresolvedComments = cd.unresolvedCommentCount(); SubmitRecord sr = new SubmitRecord(); sr.requirements = Collections.singletonList(REQUIREMENT); sr.status = unresolvedComments == null || unresolvedComments > 0 ? SubmitRecord.Status.NOT_READY : SubmitRecord.Status.OK; return ImmutableList.of(sr); } }
  • 26.
    25Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 25 Core plugins plugin manager Discover and install with one click
  • 27.
    26Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 26 More core plugins Gitiles (!) Delete-project (finally !!) WebHooks (yeah !)
  • 28.
    27Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 27 Native Packages updates RPMs for RedHat & CentOS 7.6 Debs for Debian & Ubuntu 18.04 Support for Docker in production
  • 29.
    28Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 28 What’s coming in v3.1 Polymer 2.0 Git Protocol v2 (secured) Performance Stability and Fixes More CI integration
  • 30.
    29Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 29 Q&A: excited about the future of Gerrit? Image from: http://cypp.rutgers.edu/ru-voting/political-information/public-opinion-polls/
  • 31.
    30Gerrit User Summit2019 – Volvo Cars – Gothenburg - Sweden GerritForge.com 30 Wants to know more? GerritForge.com/contact