moon icon indicating copy to clipboard operation
moon copied to clipboard

[feature] requiredApprovals in globalPaths for supported vcs

Open matray opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

It would be nice to support requiredApprovals in codeowner global paths!

Describe the solution you'd like

Since this will require wrapping each file in a section (at least for gitlab), perhaps the following makes sense

$schema: 'https://moonrepo.dev/schemas/workspace.json'
projects:
  - 'apps/*'
  - 'packages/*'
vcs:
  defaultBranch: main
  provider: "gitlab"
codeowners:
  syncOnRun: true
  requiredApprovals: 1
  globalPaths:
   'example': ['@app-example']

which creates

[example][1]
example @app-example

However, it's not as configurable on a per-path basis. So either there would need to be a way to express that via a union type like so or a way to "append always" some sort of raw codeowner stanza (ugly)

$schema: 'https://moonrepo.dev/schemas/workspace.json'
projects:
  - 'apps/*'
  - 'packages/*'
vcs:
  defaultBranch: main
  provider: "gitlab"
codeowners:
  syncOnRun: true
  globalPaths:
   'example': 
      groups: ['@app-example']
      requiredApprovals: 1

Describe alternatives you've considered Adding a lifecycle hook somehow after moon runs (with codeowner sync on run turned on), or, disabling codeowner syncing entirely to self manage.

Additional context

matray avatar Aug 07 '24 15:08 matray