Skip to content

Commit 823a67a

Browse files
committed
Merge remote-tracking branch 'origin' into jb/node/24
2 parents 4dacd06 + 2adccee commit 823a67a

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

src/sentry/api/serializers/models/release.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
from sentry.models.releases.release_project import ReleaseProject
2626
from sentry.release_health.base import ReleaseHealthOverview
2727
from sentry.users.api.serializers.user import UserSerializerResponse
28+
from sentry.users.models.user import User
29+
from sentry.users.services.user.model import RpcUser
2830
from sentry.users.services.user.serial import serialize_generic_user
2931
from sentry.users.services.user.service import user_service
3032
from sentry.utils import metrics
@@ -111,7 +113,13 @@ def _expose_current_project_meta(current_project_meta):
111113
return rv
112114

113115

114-
def _get_authors_metadata(item_list, user):
116+
class _AuthorList(TypedDict):
117+
authors: list[Author]
118+
119+
120+
def _get_authors_metadata(
121+
item_list: list[Release], user: User | RpcUser | AnonymousUser
122+
) -> dict[Release, _AuthorList]:
115123
"""
116124
Returns a dictionary of release_id => authors metadata,
117125
where each commit metadata dict contains an array of
@@ -126,7 +134,8 @@ def _get_authors_metadata(item_list, user):
126134
"""
127135
author_ids = set()
128136
for obj in item_list:
129-
author_ids.update(obj.authors)
137+
if obj.authors is not None:
138+
author_ids.update(obj.authors)
130139

131140
if author_ids:
132141
authors = list(CommitAuthor.objects.filter(id__in=author_ids))
@@ -144,18 +153,17 @@ def _get_authors_metadata(item_list, user):
144153
else:
145154
users_by_author = {}
146155

147-
result = {}
156+
result: dict[Release, _AuthorList] = {}
148157
for item in item_list:
149158
item_authors = []
150159
seen_authors = set()
151-
for user in (users_by_author.get(a) for a in item.authors):
152-
if user and user["email"] not in seen_authors:
153-
seen_authors.add(user["email"])
154-
item_authors.append(user)
160+
if item.authors is not None:
161+
for user_resp in (users_by_author.get(a) for a in item.authors):
162+
if user_resp and user_resp["email"] not in seen_authors:
163+
seen_authors.add(user_resp["email"])
164+
item_authors.append(user_resp)
155165

156-
result[item] = {
157-
"authors": item_authors,
158-
}
166+
result[item] = {"authors": item_authors}
159167
return result
160168

161169

@@ -226,7 +234,9 @@ class NonMappableUser(TypedDict):
226234

227235

228236
def get_users_for_authors(
229-
organization_id: int, authors: list[CommitAuthor], user=None
237+
organization_id: int,
238+
authors: list[CommitAuthor],
239+
user: User | AnonymousUser | RpcUser | None = None,
230240
) -> Mapping[str, Author]:
231241
"""
232242
Returns a dictionary of author_id => user, if a Sentry

static/app/views/issueDetails/streamline/sidebar/seerDrawer.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import Feature from 'sentry/components/acl/feature';
66
import {Breadcrumbs as NavigationBreadcrumbs} from 'sentry/components/breadcrumbs';
77
import {Flex} from 'sentry/components/container/flex';
88
import {ProjectAvatar} from 'sentry/components/core/avatar/projectAvatar';
9-
import {FeatureBadge} from 'sentry/components/core/badge/featureBadge';
109
import {Button} from 'sentry/components/core/button';
1110
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
1211
import {LinkButton} from 'sentry/components/core/button/linkButton';
@@ -215,16 +214,6 @@ export function SeerDrawer({group, project, event}: SeerDrawerProps) {
215214
<SeerDrawerNavigator>
216215
<Flex align="center" gap={space(1)}>
217216
<Header>{t('Seer')}</Header>
218-
<FeatureBadge
219-
type="beta"
220-
tooltipProps={{
221-
title: tct(
222-
'This feature is in beta. Try it out and let us know your feedback at [email:[email protected]].',
223-
{email: <a href="mailto:[email protected]" />}
224-
),
225-
isHoverable: true,
226-
}}
227-
/>
228217
<QuestionTooltip
229218
isHoverable
230219
title={

tests/sentry/api/serializers/test_release.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ def test_simple(self):
130130
== current_project_meta["last_release_version"]
131131
)
132132

133+
def test_authors_is_none(self):
134+
release = Release.objects.create(
135+
organization_id=self.organization.id, version="1", authors=None
136+
)
137+
release.add_project(self.project)
138+
result = serialize(release, self.user)
139+
assert result["authors"] == []
140+
133141
def test_mobile_version(self):
134142
user = self.create_user()
135143
project = self.create_project()

0 commit comments

Comments
 (0)