-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(metrics): Add missing 'return' statement in <WidgetDetails /> #70512
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(metrics): Add missing 'return' statement in <WidgetDetails /> #70512
Conversation
Add a missing 'return' statement in the rendering logic of the <WidgetDetails /> component defined in 'static/app/views/metrics'.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #70512 +/- ##
==========================================
+ Coverage 79.97% 80.00% +0.03%
==========================================
Files 6495 6495
Lines 289790 289919 +129
Branches 49928 49947 +19
==========================================
+ Hits 231753 231950 +197
+ Misses 57625 57558 -67
+ Partials 412 411 -1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks important @edwardgou-sentry can you take a look?
/gcbrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine, but I don't think this actually changes anything because we return MetricDetails
on L60 anyways, and those props are optional.
cc: @obostjancic might be more familiar with the metrics page
Thanks @evanpurkhiser and @edwardgou-sentry for the review! Do you think we can get this merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edwardgou-sentry is right this will not change any behaviour. Though it is cleaner.
thx for fixing @floels 🙌
We should use the proper type guards here. Will do in a follow-up.
Use type guard and remove casting in widget details. - follow-up of #70512
…0512) # Goal The goal of this PR is to add a missing `return` statement in the rendering logic of the `<WidgetDetails />` component defined in `static/app/views/metrics`: https://github.com/getsentry/sentry/blob/6b530ffab46d0b50512f0f4c9df8d084c1feb831/static/app/views/metrics/widgetDetails.tsx#L54-L56 This `return` was most likely forgotten when writing this piece of code. This probably doesn't result in any bug: by incorrectly continuing the rendering function, we end up also rendering a `<MetricDetails />` component with `undefined` `mri`, `op` and `query`. The code makes more sense with the `return` statement though. # Legal Boilerplate Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Use type guard and remove casting in widget details. - follow-up of #70512
Goal
The goal of this PR is to add a missing
return
statement in the rendering logic of the<WidgetDetails />
component defined instatic/app/views/metrics
:sentry/static/app/views/metrics/widgetDetails.tsx
Lines 54 to 56 in 6b530ff
This
return
was most likely forgotten when writing this piece of code. This probably doesn't result in any bug: by incorrectly continuing the rendering function, we end up also rendering a<MetricDetails />
component withundefined
mri
,op
andquery
.The code makes more sense with the
return
statement though.Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.