Commit-centric code review platform
Mark Côté
mcote
Manager, Automation and Tools (A-Team)
Whistler
June 26, 2015
(yeah it probably needs a better name)
Old & busted patch-based approach
$ hg qref --message "-b d -p linux64 -u all -t none"
$ hg push -f try
$ hg push mozilla-inbound
Very manual process
Developer has to be around to land on inbound
Reviewer wastes time with style nits
Old & busted patch-based approach
We're the A-Team
The "A" stands for "automation"
(and "awesome")
We're also Dev Services
(but they don't have a cool logo)
MozReview is a commit assembly line
Big Picture:
Commits move from inspection station to inspection station,
ending up eventually in mozilla-inbound
First stations are staffed by robots
First stations are staffed by robots
Robots leave reviews with open issues:
Only when the robots grant approval do human reviewers get involved
Reviewer time is very valuable
After human approval, commits queue up to land on inbound
No action needed by author
Automatic try run before landing
No integration branches: linear history
After human approval, commits queue up to land on inbound
Landings resume after tree closure
Landings can be spread out through the day
Automatic annotation of reviewers, link to MozReview request, etc.
Review Board
Syntax highlighting, including trailing spaces
Moved code
Review Board
Interdiffs that actually work
Integrated with Bugzilla
Working with commits
Commits are pushed to a review repo as they would be pushed to try or the repository of record
Three categories of benefits:
Operating on commits
Some things are easier to do in commits within the context of the whole repository than in isolated, contextless patches
Actions can be done by the review server based on in-tree metadata
Operating on commits
Automatic code-style analysis and/or reformatting saves reviewer time
Operating on commits
Reviewers edit code directly (annotations/suggestions) rather than describing changes
Automatically set commit metadata: link to review, list of reviewers
Moving commits
Pushing to the review repo is the same as pushing to repo of record. No more exporting patches
Moving commits around is much easier than applying patches
Pulling patches into your local working environment is the same as pulling from the repo of record. No more importing patches—and no more bitrot in testing.
And of course, autoland
Workflow improvements
Encourages (or at least does not discourage) microcommits: small, independent change sets
Makes reviewing easier and faster
Workflow improvements
Allows partial landings
Avoids bitrot
Chopping work into small pieces leads to less potential instability (not everything landing at once)
Rewards developers in the form of progress
Workflow improvements
Detect when commits can't cleanly apply
Detect when multiple commits touch the same files
Anticipate problems
We're constantly improving it
MozReview isn't perfect
http://mozilla-version-control-tools.readthedocs.org/en/latest/mozreview.html