getsentry / getsentry/sentry

Codeowners - Issue seem to be assigned to first match of codeowners

Open
#88,883 3 comments 0 reactions 0 assignees View on GitHub
Product Area: Issues
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

I'm debugging a Codeowners Assignment issue of a project using the Angular SDK.
They have setup their codeowners where they put the first rule as * to create a fallback on issues that don't have a match. To my understanding we evaluate top to bottom so that approach should be fine.
This example (see linked case) shows me a stack trace path where /libs/trading/ is in which should assign the issue to 7 people from the ownership rule.
I've unassigned the issue and retriggered the assignment to evaluate the behaviour
But still I see in the activity tab: Assigned via Codeowners Rule: codeowners:* -> Member A, B
It feels like a bug that it's still assigned to that first record.

![Image](https://github.com/user-attachments/assets/55e4f5d4-7120-454e-b831-2218145cf9ba)
![Image](https://github.com/user-attachments/assets/64e62104-08b6-4563-86c6-c725cb3dbda2)

Full context in [Case](https://www.notion.so/sentry/310ed14cfcc04288bf9679a0c250d908?p=1ce8b10e4b5d803e85b2ec63116b8e3f&pm=s)

### Expected Result

Assignement based on true match

### Actual Result

First match (I'm unable to figure out what the evaluation does)

### Product Area

Unknown

### Link

_No response_

### DSN

_No response_

### Version

_No response_

Contributor guide

Open the contributing guide

Research direction

No repository file, test, or entry point is named. Start by reproducing the Codeowners assignment with the linked case and the provided rule ordering, then trace the assignment evaluation; done means a path matching a later rule is assigned according to that true match rather than the fallback rule.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.