Skip to content

Conversation

jasonyuezhang
Copy link
Owner

All saved metric detectors have a resolution threshold, if the values match warning/critical then assume they used automatic resolution


Copied from getsentry#101049
Original PR: getsentry#101049

All saved metric detectors have a resolution threshold, if the values match warning/critical then assume they used automatic resolution
Copy link

Preserve Metric Detector Automatic Resolution on Edit

This PR updates the logic for determining the resolution strategy in metric detector editing. It refines how the form reconstructs whether the 'automatic' or 'manual' resolution radio option should be selected. Now, if the saved metric detector's OK threshold matches either the warning or critical threshold values, the form assumes 'automatic' was intended; otherwise, 'manual' is used. This better matches user expectations and preserves the intended resolution method when editing.

Key Changes

• Refactored processDetectorConditions in static/app/views/detectors/components/forms/metric/metricFormData.tsx to infer resolutionStrategy as 'automatic' if the OK threshold matches warning/critical values
• Replaced previous defaulting of manual whenever an OK threshold existed with logic that checks for threshold equivalence
• Added or expanded unit tests in static/app/views/detectors/edit.spec.tsx to verify correct detection and UI selection of automatic/manual states

Affected Areas

static/app/views/detectors/components/forms/metric/metricFormData.tsx (form data processing for metric detectors)
static/app/views/detectors/edit.spec.tsx (testing for detector resolution logic)

This summary was automatically generated by @propel-code-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants