Skip to content

Commit 5eae651

Browse files
Merge branch 'priscila/ref/quick-start/clean-up-deprecated-code' into priscila/ref/quick-start/rename-variables
2 parents fdf899c + 41741f5 commit 5eae651

File tree

20 files changed

+52
-1035
lines changed

20 files changed

+52
-1035
lines changed

requirements-dev-frozen.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ unidiff==0.7.4
238238
uritemplate==4.1.1
239239
urllib3==2.2.2
240240
vine==5.1.0
241-
virtualenv==20.25.0
241+
virtualenv==20.26.6
242242
wcwidth==0.2.10
243243
werkzeug==3.0.6
244244
wheel==0.38.4

src/sentry/api/helpers/group_index/update.py

+15-37
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
from sentry.types.group import SUBSTATUS_UPDATE_CHOICES, GroupSubStatus, PriorityLevel
5353
from sentry.users.models.user import User
5454
from sentry.users.services.user import RpcUser
55+
from sentry.users.services.user.serial import serialize_generic_user
5556
from sentry.users.services.user.service import user_service
5657
from sentry.users.services.user_option import user_option_service
5758
from sentry.utils import metrics
@@ -194,8 +195,6 @@ def update_groups(
194195

195196
result = dict(serializer.validated_data)
196197

197-
acting_user = user if user.is_authenticated else None
198-
199198
discard = result.get("discard")
200199
if discard:
201200
return handle_discard(request, groups, projects, acting_user)
@@ -219,7 +218,6 @@ def update_groups(
219218
projects,
220219
project_lookup,
221220
acting_user,
222-
user,
223221
result,
224222
)
225223
except MultipleProjectsError:
@@ -232,7 +230,6 @@ def update_groups(
232230
project_lookup,
233231
status_details,
234232
acting_user,
235-
user,
236233
)
237234

238235
return prepare_response(
@@ -344,19 +341,25 @@ def handle_resolve_in_release(
344341
projects: Sequence[Project],
345342
project_lookup: Mapping[int, Project],
346343
acting_user: RpcUser | User | None,
347-
user: RpcUser | User | AnonymousUser,
348344
result: MutableMapping[str, Any],
349345
) -> tuple[dict[str, Any], int | None]:
350346
res_type = None
351347
release = None
352348
commit = None
353349
self_assign_issue = "0"
350+
new_status_details = {}
354351
if acting_user:
355352
user_options = user_option_service.get_many(
356353
filter={"user_ids": [acting_user.id], "keys": ["self_assign_issue"]}
357354
)
358355
if user_options:
359356
self_assign_issue = user_options[0].value
357+
serialized_user = user_service.serialize_many(
358+
filter=dict(user_ids=[acting_user.id]), as_user=serialize_generic_user(acting_user)
359+
)
360+
if serialized_user:
361+
new_status_details["actor"] = serialized_user[0]
362+
360363
res_status = None
361364
if status == "resolvedInNextRelease" or status_details.get("inNextRelease"):
362365
# TODO(jess): We may want to support this for multi project, but punting on it for now
@@ -371,12 +374,7 @@ def handle_resolve_in_release(
371374
"version": ""
372375
}
373376

374-
serialized_user = user_service.serialize_many(filter=dict(user_ids=[user.id]), as_user=user)
375-
new_status_details = {
376-
"inNextRelease": True,
377-
}
378-
if serialized_user:
379-
new_status_details["actor"] = serialized_user[0]
377+
new_status_details["inNextRelease"] = True
380378
res_type = GroupResolution.Type.in_next_release
381379
res_type_str = "in_next_release"
382380
res_status = GroupResolution.Status.pending
@@ -387,12 +385,7 @@ def handle_resolve_in_release(
387385
activity_type = ActivityType.SET_RESOLVED_IN_RELEASE.value
388386
activity_data = {"version": ""}
389387

390-
serialized_user = user_service.serialize_many(filter=dict(user_ids=[user.id]), as_user=user)
391-
new_status_details = {
392-
"inUpcomingRelease": True,
393-
}
394-
if serialized_user:
395-
new_status_details["actor"] = serialized_user[0]
388+
new_status_details["inUpcomingRelease"] = True
396389
res_type = GroupResolution.Type.in_upcoming_release
397390
res_type_str = "in_upcoming_release"
398391
res_status = GroupResolution.Status.pending
@@ -409,12 +402,7 @@ def handle_resolve_in_release(
409402
"version": release.version
410403
}
411404

412-
serialized_user = user_service.serialize_many(filter=dict(user_ids=[user.id]), as_user=user)
413-
new_status_details = {
414-
"inRelease": release.version,
415-
}
416-
if serialized_user:
417-
new_status_details["actor"] = serialized_user[0]
405+
new_status_details["inRelease"] = release.version
418406
res_type = GroupResolution.Type.in_release
419407
res_type_str = "in_release"
420408
res_status = GroupResolution.Status.resolved
@@ -426,13 +414,8 @@ def handle_resolve_in_release(
426414
commit = status_details["inCommit"]
427415
activity_type = ActivityType.SET_RESOLVED_IN_COMMIT.value
428416
activity_data = {"commit": commit.id}
429-
serialized_user = user_service.serialize_many(filter=dict(user_ids=[user.id]), as_user=user)
417+
new_status_details["inCommit"] = serialize(commit, acting_user)
430418

431-
new_status_details = {
432-
"inCommit": serialize(commit, user),
433-
}
434-
if serialized_user:
435-
new_status_details["actor"] = serialized_user[0]
436419
res_type_str = "in_commit"
437420
else:
438421
res_type_str = "now"
@@ -473,7 +456,6 @@ def handle_resolve_in_release(
473456
res_type,
474457
res_status,
475458
acting_user,
476-
user,
477459
self_assign_issue,
478460
activity_type,
479461
activity_data,
@@ -482,7 +464,7 @@ def handle_resolve_in_release(
482464

483465
issue_resolved.send_robust(
484466
organization_id=projects[0].organization_id,
485-
user=(acting_user or user),
467+
user=acting_user,
486468
group=group,
487469
project=project_lookup[group.project_id],
488470
resolution_type=res_type_str,
@@ -506,7 +488,6 @@ def process_group_resolution(
506488
res_type: int | None,
507489
res_status: int | None,
508490
acting_user: RpcUser | User | None,
509-
user: RpcUser | User | AnonymousUser,
510491
self_assign_issue: str,
511492
activity_type: int,
512493
activity_data: MutableMapping[str, Any],
@@ -521,7 +502,7 @@ def process_group_resolution(
521502
"release": release,
522503
"type": res_type,
523504
"status": res_status,
524-
"actor_id": user.id if user and user.is_authenticated else None,
505+
"actor_id": acting_user.id if acting_user and acting_user.is_authenticated else None,
525506
}
526507

527508
# We only set `current_release_version` if GroupResolution type is
@@ -700,7 +681,6 @@ def handle_other_status_updates(
700681
project_lookup: Mapping[int, Project],
701682
status_details: dict[str, Any],
702683
acting_user: RpcUser | User | None,
703-
user: RpcUser | User | AnonymousUser,
704684
) -> dict[str, Any]:
705685
group_ids = [group.id for group in group_list]
706686
queryset = Group.objects.filter(id__in=group_ids)
@@ -721,9 +701,7 @@ def handle_other_status_updates(
721701
group_list, acting_user, projects, sender=update_groups
722702
)
723703
else:
724-
result["statusDetails"] = handle_ignored(
725-
group_list, status_details, acting_user, user
726-
)
704+
result["statusDetails"] = handle_ignored(group_list, status_details, acting_user)
727705
result["inbox"] = None
728706
else:
729707
result["statusDetails"] = {}

src/sentry/conf/server.py

+1
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
826826
"sentry.tasks.auto_ongoing_issues",
827827
"sentry.tasks.check_am2_compatibility",
828828
"sentry.tasks.statistical_detectors",
829+
"sentry.tempest.tasks",
829830
"sentry.debug_files.tasks",
830831
"sentry.tasks.on_demand_metrics",
831832
"sentry.middleware.integrations.tasks",

src/sentry/issues/ignored.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from datetime import datetime, timedelta
77
from typing import Any, TypedDict
88

9-
from django.contrib.auth.models import AnonymousUser
109
from django.utils import timezone
1110

1211
from sentry.db.postgres.transactions import in_test_hide_transaction_boundary
@@ -90,7 +89,6 @@ def handle_ignored(
9089
group_list: Sequence[Group],
9190
status_details: dict[str, Any],
9291
acting_user: RpcUser | User | None,
93-
user: User | RpcUser | AnonymousUser,
9492
) -> IgnoredStatusDetails:
9593
"""
9694
Handle issues that are ignored and create a snooze for them.
@@ -133,17 +131,19 @@ def handle_ignored(
133131
"user_count": ignore_user_count,
134132
"user_window": ignore_user_window,
135133
"state": state,
136-
"actor_id": user.id if user.is_authenticated else None,
134+
"actor_id": acting_user.id if acting_user else None,
137135
},
138136
)
139137

140138
Group.objects.filter(id=group.id, status=GroupStatus.UNRESOLVED).update(
141139
substatus=GroupSubStatus.UNTIL_CONDITION_MET, status=GroupStatus.IGNORED
142140
)
143141
with in_test_hide_transaction_boundary():
144-
serialized_user = user_service.serialize_many(
145-
filter=dict(user_ids=[user.id]), as_user=serialize_generic_user(user)
146-
)
142+
if acting_user:
143+
serialized_user = user_service.serialize_many(
144+
filter=dict(user_ids=[acting_user.id]),
145+
as_user=serialize_generic_user(acting_user),
146+
)
147147
new_status_details = IgnoredStatusDetails(
148148
ignoreCount=ignore_count,
149149
ignoreUntil=ignore_until,

src/sentry/testutils/fixtures.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ def projectkey(self):
6161

6262
@cached_property
6363
def user(self) -> User:
64-
return self.create_user("admin@localhost", is_superuser=True, is_staff=True)
64+
return self.create_user(
65+
"admin@localhost",
66+
is_superuser=True,
67+
is_staff=True,
68+
is_sentry_app=False,
69+
)
6570

6671
@cached_property
6772
def organization(self):

static/app/components/onboardingWizard/newSidebar.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ function Task({task, hidePanel, showWaitingIndicator}: TaskProps) {
267267
todo_id: task.task,
268268
todo_title: task.title,
269269
action: 'clickthrough',
270-
new_experience: true,
271270
});
272271

273272
e.stopPropagation();
@@ -305,7 +304,6 @@ function Task({task, hidePanel, showWaitingIndicator}: TaskProps) {
305304
todo_id: task.task,
306305
todo_title: task.title,
307306
action: 'skipped',
308-
new_experience: true,
309307
});
310308
updateOnboardingTask(api, organization, {
311309
task: taskKey,

static/app/components/onboardingWizard/progressHeader.tsx

-76
This file was deleted.

0 commit comments

Comments
 (0)