Skip to content

Commit

Permalink
[Feb 15, 2022] Document CODEOWNERS errors (github#24861)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebrock authored Feb 16, 2022
1 parent 0240435 commit 9861c1b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,14 @@ To reduce the size of your CODEOWNERS file, consider using wildcard patterns to

A CODEOWNERS file uses a pattern that follows most of the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files, with [some exceptions](#syntax-exceptions). The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. Users must have `read` access to the repository and teams must have explicit `write` access, even if the team's members already have access. You can also refer to a user by an email address that has been added to their account on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}, for example `[email protected]`.

CODEOWNERS paths are case sensitive, because {% data variables.product.prodname_dotcom %} uses a case sensitive file system. Since CODEOWNERS are evaluated by {% data variables.product.prodname_dotcom %}, even systems that are case insensitive (for example, macOS) must use paths and files that are cased correctly in the CODEOWNERS file.

{% if codeowners-errors %}
If any line in your CODEOWNERS file contains invalid syntax, that line will be skipped. When you navigate to the CODEOWNERS file in your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}, you can see any errors highlighted. A list of errors in a repository's CODEOWNERS file is also accessible via the API. For more information, see "[Repositories](/rest/reference/repos#list-codeowners-errors)" in the REST API documentation.
{% else %}
If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews.
{% endif %}

CODEOWNERS paths are case sensitive, because {% data variables.product.prodname_dotcom %} uses a case sensitive file system. Since CODEOWNERS are evaluated by {% data variables.product.prodname_dotcom %}, even systems that are case insensitive (for example, macOS) must use paths and files that are cased correctly in the CODEOWNERS file.
### Example of a CODEOWNERS file
```
# This is a comment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ _Traffic_
- [`GET /repos/:owner/:repo/check-suites/:check_suite_id`](/rest/reference/checks#get-a-check-suite) (:read)
- [`GET /repos/:owner/:repo/check-suites/:check_suite_id/check-runs`](/rest/reference/checks#list-check-runs-in-a-check-suite) (:read)
- [`POST /repos/:owner/:repo/check-suites/:check_suite_id/rerequest`](/rest/reference/checks#rerequest-a-check-suite) (:write)
{% if codeowners-errors %}
- [`GET /repos/:owner/:repo/codeowners/errors`](/rest/reference/repos#list-codeowners-errors) (:read)
{% endif %}
- [`GET /repos/:owner/:repo/commits`](/rest/reference/commits#list-commits) (:read)
- [`GET /repos/:owner/:repo/commits/:sha`](/rest/reference/commits#get-a-commit) (:read)
- [`GET /repos/:owner/:repo/commits/:sha/check-runs`](/rest/reference/checks#list-check-runs-for-a-git-reference) (:read)
Expand Down
5 changes: 5 additions & 0 deletions data/features/codeowners-errors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
versions:
fpt: '*'
ghec: '*'
ghes: '>=3.5'
ghae: 'issue-6078'

0 comments on commit 9861c1b

Please sign in to comment.