Skip to content

Commit

Permalink
log when auto-assignment happens
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Feb 27, 2023
1 parent 625c09f commit 876d97e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/sentry/models/projectownership.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from typing import TYPE_CHECKING, Any, Mapping, Optional, Sequence, Tuple, Union

from django.db import models
Expand All @@ -18,6 +19,8 @@
from sentry.models import ProjectCodeOwners, Team
from sentry.services.hybrid_cloud.user import RpcUser

logger = logging.getLogger(__name__)

READ_CACHE_DURATION = 3600


Expand Down Expand Up @@ -303,6 +306,19 @@ def handle_auto_assignment(cls, project_id, event):
project_id=project_id,
group_id=event.group.id,
)
logger.info(
"handle_auto_assignment.success",
extra={
"event": event.event_id,
"group": event.group_id,
"project": event.project_id,
"organization": event.project.organization_id,
# owner_id returns a string including the owner type (user or team) and id
"assignee": issue_owner.owner_id(),
"reason": "created" if assignment["new_assignment"] else "updated",
**details,
},
)

@classmethod
def _matching_ownership_rules(
Expand Down

0 comments on commit 876d97e

Please sign in to comment.