klarna / bec

The BitBucket Erlang Client
Apache License 2.0
47 stars 12 forks source link

Add optional mandatory-users and mandatory-groups #2

Closed sireliah closed 3 years ago

sireliah commented 4 years ago

Right now we don't have ability to define mandatory users and groups in the wz-branch-reviewers section. Proposed syntax is as follows:

wz-branch-reviewers:
  - branch-id: master
    users: []
    groups: []
    paths: []
    mandatory-users: [user.a]
    mandatory-groups: [group.a]

Since lots of projects are already using BEC, the new "mandatory-" keywords will be optional to add, not to break existing configs.

robertoaloi commented 4 years ago

@sireliah Thanks for the contribution, this looks good! The only thing which may be missing is to add the new fields to the property-based tests generators (in bec_proper_gen). Even if we don't run the property based tests (which are integration tests) in the GitHub CI, I can run them in our internal CI to check whether they work as expected.

sireliah commented 4 years ago

@robertoaloi Cool, I've modified the proper tests. I tried to run them against my staging repo and my local bitbucket server, but there are differences - either test users/groups are not there or hooks don't match. It would be great if you could run those tests (properly). :smile:

robertoaloi commented 3 years ago

Thanks!