Skip to content

Commit 51707c6

Browse files
authored
chore(typing): Add types to sentry.tasks.commit_context (#68722)
1 parent 4fee912 commit 51707c6

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ module = [
607607
"sentry.reprocessing2",
608608
"sentry.runner.*",
609609
"sentry.snuba.metrics.extraction",
610+
"sentry.tasks.commit_context",
610611
"sentry.tasks.on_demand_metrics",
611612
"sentry.tasks.reprocessing2",
612613
"sentry.utils.iterators",

src/sentry/models/projectownership.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def handle_auto_assignment(
235235
group: Group | None = None,
236236
organization_id: int | None = None,
237237
force_autoassign: bool = False,
238-
logging_extra: dict[str, str | bool] | None = None,
238+
logging_extra: dict[str, str | bool | int] | None = None,
239239
):
240240
"""
241241
Get the auto-assign owner for a project if there are any.

src/sentry/tasks/commit_context.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from __future__ import annotations
22

33
import logging
4-
from collections.abc import Mapping
4+
from collections.abc import Mapping, Sequence
55
from datetime import datetime, timedelta, timezone
66
from typing import Any
77

88
import sentry_sdk
9+
from celery import Task
910
from celery.exceptions import MaxRetriesExceededError
1011
from django.utils import timezone as django_timezone
1112
from sentry_sdk import set_tag
@@ -52,7 +53,7 @@
5253

5354
def queue_comment_task_if_needed(
5455
commit: Commit, group_owner: GroupOwner, repo: Repository, installation: IntegrationInstallation
55-
):
56+
) -> None:
5657
from sentry.tasks.integrations.github.pr_comment import github_comment_workflow
5758

5859
logger.info(
@@ -142,15 +143,14 @@ def queue_comment_task_if_needed(
142143
bind=True,
143144
)
144145
def process_commit_context(
145-
self,
146-
event_id,
147-
event_platform,
148-
event_frames,
149-
group_id,
150-
project_id,
151-
sdk_name=None,
152-
**kwargs,
153-
):
146+
self: Task,
147+
event_id: str,
148+
event_platform: str,
149+
event_frames: Sequence[Mapping[str, Any]],
150+
group_id: int,
151+
project_id: int,
152+
sdk_name: str | None = None,
153+
) -> None:
154154
"""
155155
For a given event, look at the first in_app frame, and if we can find who modified the line, we can then update who is assigned to the issue.
156156
"""

0 commit comments

Comments
 (0)