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(cmp_alerts): Set comparisonDelta null type for incident rule and dont send null in stats request #29308

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion static/app/actionCreators/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Options = {
* @param {String[]} options.team List of teams to query for
* @param {String} options.period Time period to query for, in the format: <integer><units> where units are "d" or "h"
* @param {String} options.interval Time interval to group results in, in the format: <integer><units> where units are "d", "h", "m", "s"
* @param {String} options.comparisonDelta Comparison delta
* @param {Number} options.comparisonDelta Comparison delta for change alert event stats to include comparison stats
* @param {Boolean} options.includePrevious Should request also return reqsults for previous period?
* @param {Number} options.limit The number of rows to return
* @param {String} options.query Search query
Expand Down
9 changes: 4 additions & 5 deletions static/app/views/alerts/incidentRules/ruleForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,10 @@ class RuleFormContainer extends AsyncComponent<Props, State> {
triggers: triggersClone,
resolveThreshold: rule.resolveThreshold,
thresholdType: rule.thresholdType,
comparisonDelta: rule.comparisonDelta,
comparisonType:
rule.comparisonDelta === undefined || rule.comparisonDelta === null
? AlertRuleComparisonType.COUNT
: AlertRuleComparisonType.CHANGE,
comparisonDelta: rule.comparisonDelta ?? undefined,
comparisonType: !rule.comparisonDelta
? AlertRuleComparisonType.COUNT
: AlertRuleComparisonType.CHANGE,
projects: [this.props.project],
owner: rule.owner,
};
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/alerts/incidentRules/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export type UnsavedIncidentRule = {
aggregate: string;
thresholdType: AlertRuleThresholdType;
resolveThreshold: number | '' | null;
comparisonDelta?: number;
comparisonDelta?: number | null;
eventTypes?: EventTypes[];
owner?: string | null;
};
Expand Down