basarat
basarat

Reputation: 276259

Does CODEOWNERS inherit owners

Consider the following CODEOWNERS file:

*             @username1
/subfolder/   @username2

Now if a change is made to /subfolder/somefile.txt... Will only @username2 get added as a reviewer OR would both @username1 and @username2?

PS: Testing this would require me to create three accounts (mine to make the edit, username1 and username2 to test) - AND - this information should be publically available for future searchers. I couldn't find this example covered in the official docs.

Would like an example or a document reference to be sure or answer correctness.

Upvotes: 1

Views: 1070

Answers (1)

Kevin
Kevin

Reputation: 1130

Only @username2 will be added as a reviewer. Since the order in which you place the patterns is important. It tries to take the last match.

In the docs they give an example of a CODEOWNERS file, and they try to explain with an example how inheritance works.

Upvotes: 2

Related Questions