The Code-Owners plugin is currently in development. We are testing code-owners on some hosts on googlesource.com right now. If you build your Gerrit from master, you can enable it by enabling the code-owners plugin and adding OWNERS info to your code base.
The Code-Owner plugin is an open-source plugin and maintained by the Gerrit team at Google to replace find-owners plugin.
Report a bug or send feedback using this Monorail template. You can also report a bug through the bug icon in the reply dialog next to the Suggest Owners button.
A code owner is a user whose approval is required to modify files under a certain path. Who is a code owner of a path is controlled via “OWNERS'' files that are checked into the repository. For submitting a change Gerrit requires that all files that were touched in the change are approved by a code owner. Code owners usually apply their approval by voting with “Code-Review+1” on the change. Their approval is to confirm that “This change is appropriate for our system and belongs in this directory.”
Owners are gatekeepers before a CL is submitted, they enforce standards across the code base, help disseminate knowledge around their specific area of ownership, ensure their is appropriate code review coverage, and provide timely reviews. Code owners is designed as a code quality feature to ensure someone familiar with the code base reviews any changes to the codebase or a subset of the codebase they are the Owner of, by making sure the change is appropriate for the system.
Code owners in Gerrit will be supported by a new code-owners plugin which is developed as an open-source plugin and maintained by the Gerrit team at Google. The code-owners plugin supports:
The plugin provides suggestions of owners for the directory or files that you are modifying in your change based on a score. It also informs you at a glance about the status of code-owners for the change and the status of code-owners per file.
The Code-owners plugin suggests a maximum of 5 closest owners based on their score. The owner score is calculated based on the distance of owners to the files.
Once a file has received a +1 vote by the owner, the file disappears from the file list in the reply dialog. This lets you focus on the files that are not yet assigned to an owner or are pending approval.
There are 3 possible reasons for encountering a “Not found” text:
No owners were defined for these files. Reason: This could be due to missing OWNERS defined for these files.
None of the code owners of these files are visible. Reason: The owners accounts are not visible to you.
Owners defined for these files are invalid. Reason: The emails cannot be resolved.
For these 3 cases, we advise you to:
Renamed files (new path) will have a “Renamed” chip attached to them. A renamed file will be considered as approved only if both old path/name and new path/name are approved.
This status is informing you about a failed API call. Refresh the page to recover from this error.
In case of a large change containing a large number of files (hundreds or even thousands), it will take some time to fetch all suggested owners. In the reply dialog, the plugin will show the overall status of the fetching and results as soon as it has results together with the loading indicator. The loading will disappear until all files finished fetching, failed files will be grouped into a single group.
The fetching of suggested owners should not block the reply itself. So you still can select from suggestions even when not all files are finished and sent for reviewing.
In the change page, you can get an overview of the Code-Owners statuses.
If applicable, the Code-Owner status is displayed:
The Code-Owner label is providing an overview about the owners status at a glance.
Missing code owner approval
The change is missing a reviewer that can grant the code-owner approval.
Pending code-owner approval
Approved by code-owner
Each file in your change was approved by at least one code owner. It's not required that all code owners approve a change.
Additionally, the code-owners plugin provides a more detailed overview of code-owner status per file in the change with 3 statuses and you can hover over the icon to display a tooltip.
Missing code owner approval
A code owner of this file is missing as a reviewer to the change.
Pending code owner approval
A code owner of this file has been added to the change but have not voted yet.
Approved by code owner
A code owner of this file has approved the change. You can also see this icon if you are a code-owner of the file as in this case the file is implicitly approved by you.
Failed to fetch status icon
This status is informing you about a failed API call. Refresh the page to recover from this error.
When you own all the files in your change, the Code-Owners plugin will:
The Owners-Override label is votable by a user with certain permissions (e.r.sheriff). The owner-override label will show in the reply dialog and you can vote on it if you have certain permissions.
When a user with certain permissions has voted “Owners-Override+1” and the Code-Owners submit requirement returns the status Approved (Owners-Override)
.