Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(issues): structured issue annotations #74648

Merged
merged 4 commits into from
Jul 22, 2024

Conversation

oioki
Copy link
Member

@oioki oioki commented Jul 22, 2024

No description provided.

@oioki oioki requested a review from malwilley July 22, 2024 17:04
@oioki oioki requested review from a team as code owners July 22, 2024 17:04
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 22, 2024
Copy link

codecov bot commented Jul 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.16%. Comparing base (f7390a6) to head (0119690).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #74648      +/-   ##
==========================================
+ Coverage   73.62%   78.16%   +4.53%     
==========================================
  Files        6722     6723       +1     
  Lines      299893   299908      +15     
  Branches    51597    51587      -10     
==========================================
+ Hits       220797   234411   +13614     
+ Misses      72356    59178   -13178     
+ Partials     6740     6319     -421     
Files Coverage Δ
src/sentry/api/serializers/models/group.py 93.25% <100.00%> (+1.23%) ⬆️
src/sentry/integrations/mixins/issues.py 87.13% <100.00%> (+0.58%) ⬆️
src/sentry/models/platformexternalissue.py 100.00% <100.00%> (ø)
src/sentry/plugins/bases/issue.py 37.17% <ø> (+2.78%) ⬆️
src/sentry/plugins/bases/issue2.py 73.45% <ø> (+32.92%) ⬆️

... and 921 files with indirect coverage changes

@@ -145,7 +145,7 @@ class BaseGroupSerializerResponse(BaseGroupResponseOptional):
isSubscribed: bool
subscriptionDetails: GroupSubscriptionResponseOptional | None
hasSeen: bool
annotations: Sequence[str]
annotations: dict[str, str]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should create another TypedDict (similar to GroupProjectResponse and others at the top of the file) and type this as Sequence[Annotation]

@@ -348,7 +348,7 @@ def map_external_issues_to_annotations(self, external_issues):
for ei in external_issues:
link = self.get_issue_url(ei.key)
label = self.get_issue_display_name(ei) or ei.key
annotations.append(f'<a href="{link}">{label}</a>')
annotations.append({"url": link, "display_name": label})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already mentioned, but since we changed this to displayName in the frontend we need to change it here as well

Copy link
Member

@armenzg armenzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@@ -348,7 +348,7 @@ def map_external_issues_to_annotations(self, external_issues):
for ei in external_issues:
link = self.get_issue_url(ei.key)
label = self.get_issue_display_name(ei) or ei.key
annotations.append(f'<a href="{link}">{label}</a>')
annotations.append({"url": link, "displayName": label})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no more usage of a href in the APIs 👍🏻

@oioki oioki merged commit 5c67952 into master Jul 22, 2024
52 checks passed
@oioki oioki deleted the fix/backend-issues-annotations-structured branch July 22, 2024 20:53
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants