Engineering/Engineering Principles/2 Quality/Source Control And Code Review/Pull Request Policies/

Pull Request Policy Standards · QUAL-05

A branch policy must be set on main development branches · QUAL-05.1 · MUST · DEV/TEST

Code reviews must be enforced by setting a branch policy on the main development branches (e.g. dev and/or main) with the following settings:

  1. Require a minimum of at least 1 reviewer (an individual project can require more than 1 reviewer if desired).
  2. Do not allow users to approve their own changes (unless the minimum number of reviewers is more than 1).
  3. ‘Reset code reviewer votes when there are new changes’ should be selected.
  4. ‘Check for linked work items’ should be required.
  5. ‘Check for comment resolution’ should be required.
  6. ‘Limit merge types’ should generally be set to ‘Basic merge (no fast-forward)’.
  7. ‘Build validation’ should be set for the relevant build pipeline(s) to ensure that the pull request doesn’t break the build, with the expiration set to immediately.

Projects can diverge from this policy provided it makes the policy stricter rather than more relaxed. For example, requiring more than 1 reviewer.