Overview

As part of TF evolution and maturity we would need to establish a governance and administration model for code contribution, review and approval process for lock free, escalation and resolution pipelines. While we have identified a structure for contributors and leads for the modules, we have to define how the leads can nominate themselves or their team member with expertise in the module to be the owner / co-owner to approve a pull request. 

While I studied some of the open source projects for the model, I liked what is being implemented in Kubernetes. They use the concept of owners and reviewers. 

Reviewers - A group of experts for a components and/or module

Owners - A group of experts for module and/or overall architecture of the system

The nice thing about the way it is implemented is that the details of group alias for each module is also code driven by the OWNERS file. 

OWNERS files are used to designate responsibility over different parts of the Kubernetes codebase. Today, it is used to assign the reviewer and approver roles that are used in our two-phase code review process.  

The velocity of a project that uses code review is limited by the number of people capable of reviewing code. The quality of a person's code review is limited by their familiarity with the code under review.  Kubernetes addresses both of these concerns through the prudent use and maintenance of OWNERS files.

    OWNERS spec

The https://github.com/kubernetes/test-infra/blob/master/prow/repoowners/repoowners.go is the main consumer of OWNERS files.

      OWNERS

Each directory that contains a unit of independent code or content may also contain an OWNERS file. This file applies to everything within the directory, including the OWNERS file itself, sibling files, and child directories.

OWNERS files are in YAML format and support the following keys:

The above keys constitute a simple OWNERS configuration.

All users are expected to be assignable. In GitHub terms, this means they must be members of the organization to which the repo belongs.

A typical OWNERS file looks like:

approvers:
  - Ed
  - Xu     
reviewers:
  - Peter
  - Chandra    
  - config # this is an alias

      Emeritus

It is inevitable, but there are times when someone may shift focuses, change jobs or step away from a specific area in the project for a time. These people may be domain experts over certain areas of the codebase, but can no longer dedicate the time needed to handle the responsibilities of reviewing and approving changes. They are encouraged to add themselves as an "emeritus" approver under the emeritus_approvers key.

GitHub usernames listed under the emeritus_approvers key can no longer approve code (use the /approve command) and will be ignored by prow for assignment. However, it can still be referenced by a person looking at the OWNERS file for a possible second or more informed opinion.

When a contributor returns to being more active in that area, they may be promoted back to a regular approver at the discretion of the current approvers.

emeritus_approvers:
- david    # 2018-05-02
- emily    # 2019-01-05

      OWNERS_ALIASES

Each repo may contain at its root an OWNERS_ALIAS file.

OWNERS_ALIAS files are in YAML format and support the following keys:

We use aliases for groups instead of GitHub Teams, because changes to GitHub Teams are not publicly auditable.

A sample OWNERS_ALISES file looks like:

aliases:
  config:
    - Ignatious Johnson
    - Nagendra
  vrouter:
    - Kiran KN
    - Anand

GitHub usernames and aliases listed in OWNERS files are case-insensitive.

    Code Review using OWNERS files

This is a simplified description of our full PR testing and merge workflow that conveniently forgets about the existence of tests, to focus solely on the roles driven by OWNERS files. Please see below for details on how specific aspects of this process may be configured on a per-repo basis.

     The Code Review Process

    Maintaining OWNERS files

OWNERS files should be regularly maintained.

We should encourage people to self-nominate, self-remove or switch to emeritus from OWNERS files via PR's. Ideally in the future we could use metrics-driven automation to assist in this process.

We should strive to:

Escalation, Mediation and Resolution

Technical Steering committee should act as escalation point for mediating and ensure timely resolution of a blocked state on a PR.