mszostok/codeowners-validator

Gitlab API support for owners check

Opened this issue · 2 comments

Description
For owners checks using your CLI, it'd be great if we can specify whether it is for a gitlab or github repository. I'm looking for an equivalent validator for gitlab that supports the checks mentioned in your repo -

1. Check if the owner's definition is valid (is either a GitHub user name, an organization team name or an email address).

2. Check if a GitHub owner has a GitHub account

3. Check if a GitHub owner is in a given organization

4. Check if an organization team exists

Reasons

  • There's no good gitlab alternative like this package
  • Efforts wise it should not be hard to integrate a gitlab client like gitbeaker

Hi @udayrajMT

The idea sounds interesting. I will try to investigate if the GitHub CODEOWNERS and the Gitlab ones have the same syntax expression as currently, the codeowners-validator validates a few things which are tightly connected with GitHub :)

@mszostok the codeowners files in both do follow the same syntax:
Github ref

A CODEOWNERS file uses a pattern that follows the same rules used in gitignore files. The pattern is followed by one or more GitHub usernames or team names using the standard @username or @org/team-name format. You can also refer to a user by an email address that has been added to their GitHub account, for example user@example.com

Gitlab ref

Files can be specified using the same kind of patterns you would use in the .gitignore file followed by one or more of:
A user’s @username.
A user’s email address.
The @name of one or more groups that should be owners of the file.