- Status: accepted
- Deciders: tumido, HumairAK, lars, goern, 4n4nd
- Date: 2021-05-20
Technical Story: #93
Each community has its own contributing.md
file which outlines how are users expected to contribute to the community. That guide for contributions should also clearly state what will happen once a PR is submitted and how reviews are performed.
- Using inherited processes from AI-CoE - Prow
- Building upon Prow and modifying and evolving them to operations needs
Chosen option: "Building upon Prow and modifying and evolving them to operations needs"
We use Prow to automate review process. That means we use following setup:
- Each repository contains an
OWNERS
file:- There is always one
OWNERS
file in a repository root folder - If needed, additional
OWNERS
files can be created within nested folders. This file takes precedence for all resources within this folder.
- There is always one
OWNERS
file contains several entries:approvers
is a list of GitHub users that are allowed to use the/approve
chat-ops command. Role of approvers is to gate PRs - they verify that changes in PRs respect our architectural decisions and are in line with the heading of the project. See upstream docs for better understanding of this role.reviewers
is a list of GitHub users that are allowed to use the/lgtm
chat-ops command. Their role is to ensure changes in PRs are implemented properly and meet our coding standards. See upstream docs for details.
- A PR is submited
- Prow (represented by a Sesheta bot-account) will pick a selection of reviewers from corresponding
OWNERS
file (based on modified files in the PR). - Reviewers assess the code for general code quality, correctness, sane software engineering, and style. They either provide feedback or respond with
/lgtm
chat-ops command.- Once a
/lgtm
command is sent, Prow (Sesheta) will add algtm
label to the PR. This label will get removed if there are any new pushes to the PR. - Additionally Prow will ask users to assign a specific
approver
to the PR if there's no assignment yet.
- Once a
- Approvers evaluate architectural aspects of the PR and holistic acceptance criteria, including dependencies with other features, forwards/backwards compatibility, API and flag definitions. They either provide feedback or respond with
/approve
chat-ops command.- Once an
/approve
command is sent, Prow (Sesheta) will add anapprove
label to the PR. This label stays after subsequent pushes to the PR.
- Once an
- If a PR is large in nature or introduces a breaking change we exercise an informal rule:
- PR is put on hold via
/hold
. - We wait for a second reviewer to come by and approve it via
/lgtm
(2 different people have commented with/lgtm
). - PR is held in review for at least a day to give more people chance to look at it.
- PR is put on hold via
- Prow (Sesheta) waits for conditions to be met to make PR eligible for merge. Required conditions (See here for details):
- Required CI checks need to finish and pass. Which CI checks are required is configured per repository.
- Both
approve
andlgtm
labels are present.
- Prow merges the pull request.
Additional chat-ops commands to help with PR review process are:
/retest
- re-run failed CI checks/cc @username
- request a review from an user/close
- close pull request/label
- add a label to the PR/ok-to-test
- if a PR was submitted by somebody who is not a member of the operate-first GitHub organization, Prow doesn't start CI until this command is used by a member/hold
- prevent PR from being merged