migrationUi.ts 630 B

123456789101112131415161718
  1. import type {Organization} from 'sentry/types/organization';
  2. import type {MetricRule} from 'sentry/views/alerts/rules/metric/types';
  3. import {Dataset} from 'sentry/views/alerts/rules/metric/types';
  4. /**
  5. * Enable ignoring archived issues in metric alerts
  6. */
  7. export const hasIgnoreArchivedFeatureFlag = (organization: Organization): boolean =>
  8. organization.features.includes('metric-alert-ignore-archived');
  9. export const ruleNeedsErrorMigration = (rule: MetricRule): boolean => {
  10. return (
  11. 'dataset' in rule &&
  12. rule.dataset === Dataset.ERRORS &&
  13. 'query' in rule &&
  14. !rule.query.includes('is:unresolved')
  15. );
  16. };