[go: up one dir, main page]

Skip to content

Per-Directory ACLs for Merge Request / Visibility / Etc.

Description

Proposal is for an approval mechanism that requires a covering set of approvals before a merge can occur, where permissions required are based on the union of directories touched by the commits.

On larger projects team members may develop expertise or know parts of the code-base better than most others. The goal is to be able to require approval based on the intersection of the set of files modified and the set of developers with expertise specific to those files. For example, if code related to security was kept under a seperate directory, then the security experts on the project could be required to approve any changes relating to security before they're merged in, or if tests are kept in separate directories then a verification expert can be required to merge in a branch. If someone changes a test for the security code, then you'd want both a security and verification expert's approval.

Proposal

In any directory where an ACL list is checked in, in order to merge in a change that touches that directory or any sub-directory, approval of at least one user listed in the ACLs is required. For example, given the following directory structure:

  /main.go
  /a/interface.js
  /a/index.html 
  /b/backend.cc

If users alice and bob have approval authority over /, and users carol and dan have authority over /a, and erin and frank over /b, then changes touching the following files require the following users to approve:

  commit 0: {/main.go} -> alice or bob
  commit 1: {/a/index.html} -> alice or bob or carol or dan
  commit 2: {/a/interface.js, /b/backend.cc} -> alice or bob or ((carol or dan) and (erin or frank))

The merge requester is responsible for getting all the necessary approvals. To do so they list each person whom they'd like to request approval of, e.g. alice and bob are less likely to be experts on html or javascript and so wouldn't be a first choice to approve changes to directory a, but if carol and dan are both out sick they can step in. As such, an automatic list of suggested approves can be provided for the user to select from sorted from the most specific approvers to the least specific. That is, for commit 2 the suggested approvers to select from could be listed as:

Suggested Approvers:
  for /a: carol, dan, alice, or bob
  for /b: erin, frank, alice, or bob