mszostok / codeowners-validator

The GitHub CODEOWNERS file validator
Apache License 2.0
217 stars 47 forks source link

Gitlab API support for owners check #57

Open udayrajMT opened 3 years ago

udayrajMT commented 3 years ago

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

mszostok commented 3 years ago

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 :)

udayrajMT commented 3 years ago

@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.