This document covers how code owners are used to enforce required reviews. The intended audience for this is leads and developers on VFS teams who want to use code owners to enforce required reviews on their applications.

Platform code owners

We use GitHub's code owners feature to trigger required reviews. A code owner is a GitHub team that must approve a change before it can be merged.

By default, frontend-review-group is the code owner of vets-website and backend-review-group is the code owner of vets-api.

Other code owners

VFS teams can optionally create a GitHub team under the Department of Veteran Affairs GitHub organization by clicking on the New team button. This must be done for the team to become a code owner.

In vets-website, a team can be assigned as a code owner of application foldersThis will remove frontend-review-group as a required reviewer when changes are made to those folders. Follow the conventions in the CODEOWNERS configuration file to assign your team to an application folder.

In vets-api, a team can be assigned as a code owner of module foldersThis will remove backend-review-group as a required reviewer when changes are made to those folders. Follow the conventions in the CODEOWNERS configuration file to assign your team to an application folder.

You should understand the following when making changes to the code owners configuration:

  • The last matching rule that matches all files in a change takes precedence.

  • Application code should be structured to require as few rules as possible.

  • Only one required reviewer per file can be triggered by code owners rules. A pull request may require multiple code owner approvals.

  • Code owners rules are applied to every push after a PR is created. Required reviewers can be removed during this process but GitHub does not remove a review group once it has been added to a PR as a required reviewer.

  • The Platform teams approve changes to the CODEOWNERS configuration. The relevant Platform team will add new GitHub teams created by other teams to the applicable repository during this review since this is required for code owners rules to trigger.

  • Your group is responsible for managing its GitHub teams. Since there are many ways to structure a GitHub organization, we recommend being familiar with this feature.

  • We recommend having at least three members on a GitHub team used for code owners. By default, only one code owner group can approve a change.