CI: Automated reviewers

Patrick Williams patrick at
Tue Jul 26 02:08:01 AEST 2022


TL;DR: You should now see Jenkins automatically adding reviewers to your
commits based on the files you touched!  We also have a new way to sign
up for automatic notifications on pending changes.


Gerrit use to automatically add reviewers to commits based on
information present in the OWNERS files in each repository.  About a
month ago, we did an upgrade to Gerrit and this plugin stopped
working[1].  I recently added support to one of our Jenkins scripts to
re-enable this support (outside of the Gerrit plugin).

# How does it work?

In the openbmc-build-scripts is a new `tools/owners` script, which can
compare the files touched by a git commit against the information in the
repository's OWNERS file(s).  This generates a list of 'owners' and
'reviewers' for each commit.  Jenkins calls back to Gerrit in the
`userid-validation` phase to add these reviewers.

# Why did we write our own tool?

Two reasons:

- Writing, building, and (especially) testing a Gerrit plugin is hard
  the people around this project, but modifying a Python script is
  significantly easier.

- We've enhanced the OWNERS file format with our own 'reviewers' field,
  which allows people who are not maintainers to indicate that they'd
  like to be informed of changes to a repository and/or set of files
  within a repository.

# What should I do about it?

Typically nothing.  Jenkins will automatically add appropriate
reviewers, so you don't have to anymore.  You're more than welcome to add
_additional_ reviewers as you see fit.

Now that we have automation that honors both 'owners' and 'reviewers', I
would encourage us to add more 'reviewers' to our OWNERS files.  In the
past, 'reviewers' was "for human consumption only" and often not
followed.  Now, it is fully supported within the tool.

Signing up to review some or all of the repository is a great way to:
   - Be informed of changes to code you care about.
   - Help the project by relieving review burden on the maintainers and
     speed up the review process overall.
   - Show interest in a repository and learn what the maintainers tend to look
     out for so that you can become a maintainer.

If you are interested in this, submit a change to the OWNERS file for a
repository you are interested in by adding yourself to the 'reviewers'
list.  If you want to only subscribe to a subset of the repository you
need to create an appropriate 'matchers' entry to identify the files you
want to monitor[2].

We generally have a pretty significant shortage of both reviewers and
maintainers.  Reviewing commits is an easy way to get more involved in
the project with low effort and commitment.


Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <>

More information about the openbmc mailing list