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

Alerting: Fix order-of-magnitude bug in DTO conversion when reading rules #53690

Merged
merged 1 commit into from Aug 12, 2022

Conversation

alexweav
Copy link
Contributor

What this PR does / why we need it:

In the same vein as: #53196

GETting a rule would always return the wrong value for for because of this order-of-magnitude bug in the conversion method. time.Duration and model.Duration use the same order of magnitude in the underlying representation, and don't need to be adjusted. The adjustment caused the value to be wrong (typically the value was lowered so much it got truncated to 0s)

Which issue(s) this PR fixes:
n/a

Special notes for your reviewer:

Didn't add a test for this as our entire DTO package needs better infra. Filed a debt issue instead #53689

@alexweav alexweav added type/bug area/alerting Grafana Alerting add to changelog backport v9.1.x Bot will automatically open backport PR labels Aug 12, 2022
@alexweav alexweav added this to the 9.1.0 milestone Aug 12, 2022
@alexweav alexweav requested a review from a team as a code owner August 12, 2022 19:42
Copy link
Member

@JohnnyQQQQ JohnnyQQQQ left a comment

Choose a reason for hiding this comment

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

Oops, LGTM

@alexweav alexweav added no-changelog Skip including change in changelog/release notes and removed add to changelog labels Aug 12, 2022
@alexweav alexweav merged commit ccd41df into main Aug 12, 2022
@alexweav alexweav deleted the alexweav/alert-dto-time branch August 12, 2022 20:02
grafanabot pushed a commit that referenced this pull request Aug 12, 2022
alexweav added a commit that referenced this pull request Aug 12, 2022
(cherry picked from commit ccd41df)

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Grafana Alerting area/backend backport v9.1.x Bot will automatically open backport PR enterprise-ok no-changelog Skip including change in changelog/release notes type/bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants