octodemo / pr-gatekeeper

An action to perform the required checks for complex pull request approval cases
MIT License
11 stars 4 forks source link

Support more options to specify who should review #23

Open yuichielectric opened 3 years ago

yuichielectric commented 3 years ago

Currently we only support required_reviewers, but Zappr has more options described here: https://zappr.readthedocs.io/en/latest/setup/

dchomh commented 3 years ago

I will look into this and try to organize the current feature set of Zappr so we can tackle the simplest ones first.

dchomh commented 3 years ago

Feature set of Zappr:

Current implementation of MVP:

Out of the feature set given above, I believe we should focus on the features listed under approval management. I think the following order of implementation is a good start.

  1. Minimum number of approvers
  2. Approver organization check
  3. Approver ignore ability
  4. Approver group check/minimum approvers for group
  5. Approve message pattern verification (not sure if necessary)

Let me know if you have any thoughts on this.

dchomh commented 3 years ago

Summary of discussion on 5/19:

Minimum number of approvers should be easy to handle, but can also be achieved via the existing protected branch mechanism. Approver organization check should not be difficult to implement. Main feature that would serve as a differentiator between the existing protected branch mechanism and this action would be the group check and minimum approvers for group.

Should try to see if developing this feature (number 4 in above list) is feasible before end of hackathon.

yuichielectric commented 3 years ago

I have implemented the following options at #39 :

Thanks to this PR, you can specify the following config, for example:

approvals:
  # check will succeed if there are 4 approvals from
  # backend or frontend people
  minimum: 2
  groups:
    # check will fail if there is not at least 1 approval
    # from backend persons
    backend:
      minimum: 1
      from:
        users:
          - yuichielectric
          - dchomh
    # check will fail if there is not at least 1 approval
    # from frontend persons
    frontend:
      minimum: 2
      from:
        users:
          - dchomh
          - rerwinx

This config requires

44 is a sample PR which checks the above config.