You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ref(codeowners): improve example for issue ownership (#15012)
We've seen some confusion in how issue ownership works, especially on
how stack traces are used in ownership assignment (ex.
https://sentry.slack.com/archives/C058J6Y4HQU/p1757596036812509). This
emphasizes that we use _all_ stack trace frames when evaluating issue
owners, and makes the example more comprehensive to illustrate this.
## IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+
## PRE-MERGE CHECKLIST
*Make sure you've checked the following before merging your changes:*
- [x] Checked Vercel preview for correctness, including links
- [x] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
Copy file name to clipboardExpand all lines: docs/product/issues/ownership-rules/index.mdx
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,10 @@ description: "Learn how to set up ownership rules to automatically assign issues
6
6
7
7
<Includename="only-error-issues-note.mdx" />
8
8
9
-
Sentry offers multiple ways to define the "ownership" of an issue. With ownership defined, we can automatically assign issues and send alerts to the owner. Sentry defines ownership with _code owners_and _ownership rules_. Code owners functionality lets you import your [GitHub](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) or [GitLab](https://docs.gitlab.com/ee/user/project/code_owners.html) CODEOWNERS file, and then we assign issues according to those file paths. Ownership rules allow you to override the assignments based on code owners and provide advanced matcher types (for example, urls and tags). These rules can also match on the file paths of files in the stack trace, URL of the request, or event tags.
9
+
Sentry offers multiple ways to define the "ownership" of an issue. With ownership defined, we can automatically assign issues and send alerts to the owner. Sentry defines ownership with _ownership rules_ and _code owners_. Ownership rules can assign issues based on the file paths in the event stack trace, URL of the request, or event tags, and also allow you to override rules in code owners. Code owners functionality lets you import your [GitHub](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) or [GitLab](https://docs.gitlab.com/ee/user/project/code_owners.html) CODEOWNERS file and assign issues based on the file paths in the event stack trace.
10
10
11
11
Once an issue has been assigned, whether manually by a user or automatically by Sentry, future auto-assignment will be turned off for that issue.
12
12
13
-
## Methods
14
-
15
-
Ownership rules and code owners are matched against individual events in an issue. This matching is relied upon in other areas of [sentry.io](https://sentry.io), as described in the following sections.
16
-
17
13
### Ownership Rules
18
14
19
15
You can set ownership by defining ownership rules per project. To configure ownership rules, navigate to **[Project] > Settings > Ownership Rules**, or click on the "Create Ownership Rule" button on an **Issue Details** page.
@@ -100,54 +96,58 @@ Create external team/user mappings for your GitHub/GitLab teams and users by nav
100
96
101
97
## Evaluation Flow
102
98
103
-
If you have both ownership rules and code owners, Sentry evaluates an event’s in-app frames against the rules in the following order:
99
+
Ownership rules and code owners are matched against individual events in an issue. Sentry evaluates an event by checking if _any_ of its in-app stack trace frames match a rule from:
104
100
105
101
1. Code owners, top-to-bottom
106
-
107
-
a. If there are multiple owners in the rule, left-to-right
108
-
109
102
2. Ownership rules, top-to-bottom
110
103
111
-
a. If there are multiple owners in the rule, left-to-right
112
-
113
-
After evaluation, the last rule matching returns the assignment. The order of the event’s stack trace filepaths is irrelevant in determining the rule assignment.
104
+
The _last_ rule that matches for an event is used for issue assignment. If there are multiple owners in a rule, we take the leftmost owner. The order of in-app stack trace frames in an event is not used in determining the rule assignment.
114
105
115
106
### Example
116
107
108
+
Sentry receives an event with the following stack trace:
When Sentry receives an event with a stack trace filepath: `dist/frontend/components/sidebar.js`, we:
133
-
134
-
1. Evaluate against the code owners top-to-bottom; we get one match with two owners in the rule.
135
132
136
-
a. Evaluate the rule left-to-right; we choose the first owner.
133
+
For this event, we:
137
134
135
+
1. Evaluate against the code owners top-to-bottom; we get three matches.
138
136
2. Evaluate against the ownership rules top-to-bottom; we get two matches.
139
137
140
138
The matches, in order, are:
141
139
142
140
```
143
141
[
144
-
"codeowners:*.js #ecosystem",
145
-
"path:*.js #ecosystem",
146
-
"path:dist/frontend/components/* #frontend"
142
+
"codeowners:backend/ #engineering-team", # match on frame 2 and 3
143
+
"codeowners:models/ #models-team", # match on frame 1
144
+
"codeowners:backend/api/ #api-team", # match on frame 3
145
+
"path:backend/endpoints/* #api-team", # match on frame 2
146
+
"path:backend/endpoints/auth/* #auth-team #enterprise-team", # match on frame 2
147
147
]
148
148
```
149
149
150
-
Sentry will return the last matching rule, which in this case is `path:dist/frontend/components/* #frontend`
150
+
Sentry will return the last matching rule, which in this case is `path:backend/endpoints/auth/* #auth-team #enterprise-team`. Although there are two owners in the last matching rule, Sentry will assign the issue to the first owner, `#auth-team`.
0 commit comments