Skip to content

Commit 876d97e

Browse files
committed
log when auto-assignment happens
1 parent 625c09f commit 876d97e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/sentry/models/projectownership.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
from typing import TYPE_CHECKING, Any, Mapping, Optional, Sequence, Tuple, Union
23

34
from django.db import models
@@ -18,6 +19,8 @@
1819
from sentry.models import ProjectCodeOwners, Team
1920
from sentry.services.hybrid_cloud.user import RpcUser
2021

22+
logger = logging.getLogger(__name__)
23+
2124
READ_CACHE_DURATION = 3600
2225

2326

@@ -303,6 +306,19 @@ def handle_auto_assignment(cls, project_id, event):
303306
project_id=project_id,
304307
group_id=event.group.id,
305308
)
309+
logger.info(
310+
"handle_auto_assignment.success",
311+
extra={
312+
"event": event.event_id,
313+
"group": event.group_id,
314+
"project": event.project_id,
315+
"organization": event.project.organization_id,
316+
# owner_id returns a string including the owner type (user or team) and id
317+
"assignee": issue_owner.owner_id(),
318+
"reason": "created" if assignment["new_assignment"] else "updated",
319+
**details,
320+
},
321+
)
306322

307323
@classmethod
308324
def _matching_ownership_rules(

0 commit comments

Comments
 (0)