mszostok/codeowners-validator

Valid Owner Checker should ignore team name casing

Closed this issue · 0 comments

Description

We have a code owners file with the following entries:

src/somefile1.txt @someorg/teamreviewers
src/somefile2.txt @someorg/TeamReviewers

Under the "someorg" organization we have a team called "TeamReviewers". The validator currently issues an error for the second entry above. It appears that we expect to use only lowercase names.

version.Info{Version:"0.6.0", GitCommit:"2f6e3bb", BuildDate:"2021-01-22T09:50:03Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}
==> Executing Valid Syntax Checker (530.724µs)
    Check OK
==> Executing Duplicated Pattern Checker (356.498µs)
    Check OK
==> Executing File Exist Checker (23.789863ms)
    Check OK
==> Executing Valid Owner Checker (670.5905ms)
    [err] line 2: Team "TeamReviewers" does not exist in organization "someorg".

Expected result

In the instance described above both entries should ignore casing and match "TeamReviewers".

Actual result

==> Executing Valid Owner Checker (670.5905ms)
    [err] line 2: Team "TeamReviewers" does not exist in organization "someorg".

Steps to reproduce

  1. Setup a team name that is not all lower case.
  2. Add an entry to the CODEOWNERS file using the non-lowercase format.
  3. Run the validator.

Troubleshooting

We have changed our CODEOWNERS file to use all lowercase names, but this isn't ideal.