Gitlab CODEOWNERS with custom groups doesn't parse
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 22h 21m
- Merged PRs (30d)
- 586
Description
### Environment
SaaS ([https://sentry.io/]())
### Steps to Reproduce
Import a Gitlab `CODEOWERS` from connected repo that has named sections with a default owner that maps to mapped teams. eg. we have something that looks something like this:
```
[Team Core] @org/team-core
folder-1/
[Team Other] @org/team-other
folder-2/
```
### Expected Result
Should parse the CODEOWNERS file and rules correctly, and assign the code that it is owned to the correct team or person.
The documentation about this syntax is here: [https://docs.gitlab.com/user/project/codeowners/reference/#set-default-code-owner-for-a-section]()
### Actual Result
Got an error banner that reads
> There was 1 ownership issue within Sentry on the latest sync with the CODEOWNERS file
>
> The following usernames do not have an association in the organization: org-name
**Core\]**
And there is a new codeowner entry in the ownership table called `[Team`
### Product Area
Settings - Projects
### Link
https://{ORG_SLUG}.sentry.io/settings/projects/{PROJECT_SLUG}/ownership/
### DSN
[https://42a75d0589aa4085b0a6b61a48f8bead@o1301086.ingest.sentry.io/6570851]()
### Version
*No response*
Contributor guide
Research direction
Start by locating the GitLab CODEOWNERS parser used during repository ownership sync, then reproduce the issue with the named-section example containing default owners. Confirm that sections such as [Team Core] are parsed as sections and that folder-1/ and folder-2/ map to the intended teams or people without an ownership error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gitlab, python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100