Skip to content

Commit 09b3bc5

Browse files
ref: rm Everyone (#90245)
last reference removed in f6d209a <!-- Describe your PR here. -->
1 parent 16e5f82 commit 09b3bc5

File tree

4 files changed

+8
-30
lines changed

4 files changed

+8
-30
lines changed

src/sentry/api/endpoints/event_owners.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ def get(self, request: Request, project, event_id) -> Response:
3535

3636
owners, rules = ProjectOwnership.get_owners(project.id, event.data)
3737

38-
# For sake of the API, we don't differentiate between
39-
# the implicit "everyone" and no owners
40-
if owners == ProjectOwnership.Everyone:
41-
owners = []
42-
4338
serialized_owners = serialize(Actor.resolve_many(owners), request.user, ActorSerializer())
4439

4540
# Make sure the serialized owners are in the correct order

src/sentry/integrations/slack/message_builder/issues.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,7 @@ def get_suggested_assignees(
268268
project: Project, event: Event | GroupEvent, current_assignee: RpcUser | Team | None
269269
) -> list[str]:
270270
"""Get suggested assignees as a list of formatted strings"""
271-
suggested_assignees = []
272-
issue_owners, _ = ProjectOwnership.get_owners(project.id, event.data)
273-
if (
274-
issue_owners != ProjectOwnership.Everyone
275-
): # we don't want every user in the project to be a suggested assignee
276-
suggested_assignees = issue_owners
271+
suggested_assignees, _ = ProjectOwnership.get_owners(project.id, event.data)
277272
try:
278273
suspect_commit_users = Actor.many_from_object(get_suspect_commit_users(project, event))
279274
suggested_assignees.extend(suspect_commit_users)

src/sentry/models/projectownership.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import enum
43
import logging
54
from collections.abc import Mapping, Sequence
65
from typing import TYPE_CHECKING, Any
@@ -35,9 +34,6 @@
3534
READ_CACHE_DURATION = 3600
3635

3736

38-
_Everyone = enum.Enum("_Everyone", "EVERYONE")
39-
40-
4137
@region_silo_model
4238
class ProjectOwnership(Model):
4339
__relocation_scope__ = RelocationScope.Organization
@@ -54,9 +50,6 @@ class ProjectOwnership(Model):
5450
codeowners_auto_sync = models.BooleanField(default=True, null=True)
5551
suspect_committer_auto_assignment = models.BooleanField(default=False)
5652

57-
# An object to indicate ownership is implicitly everyone
58-
Everyone = _Everyone.EVERYONE
59-
6053
class Meta:
6154
app_label = "sentry"
6255
db_table = "sentry_projectownership"
@@ -110,7 +103,7 @@ def get_ownership_cached(cls, project_id):
110103
@classmethod
111104
def get_owners(
112105
cls, project_id: int, data: Mapping[str, Any]
113-
) -> tuple[_Everyone | list[Actor], Sequence[Rule] | None]:
106+
) -> tuple[list[Actor], Sequence[Rule] | None]:
114107
"""
115108
For a given project_id, and event data blob.
116109
We combine the schemas from IssueOwners and CodeOwners.

src/sentry/notifications/utils/participants.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,23 +211,18 @@ def get_owners(
211211

212212
if event:
213213
owners, _ = ProjectOwnership.get_owners(project.id, event.data)
214+
if not owners:
215+
outcome = "empty"
216+
recipients = []
217+
else:
218+
outcome = "match"
219+
recipients = owners[-1:]
214220
else:
215-
owners = ProjectOwnership.Everyone
216-
217-
if not owners:
218-
outcome = "empty"
219-
recipients: list[Actor] = list()
220-
221-
elif owners == ProjectOwnership.Everyone:
222221
outcome = "everyone"
223222
users = user_service.get_many_by_id(
224223
ids=list(project.member_set.values_list("user_id", flat=True))
225224
)
226225
recipients = Actor.many_from_object(users)
227-
228-
else:
229-
outcome = "match"
230-
recipients = owners[-1:]
231226
return (recipients, outcome)
232227

233228

0 commit comments

Comments
 (0)