Skip to content

Commit

Permalink
fixed missing import
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Nov 23, 2020
1 parent 8716b86 commit 6dd664d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import moment from 'moment';
import { getCustomMetricLabel } from '../../../../common/formatters/get_custom_metric_label';
import { toMetricOpt } from '../../../../common/snapshot_metric_i18n';
import { AlertStates, InventoryMetricConditions } from './types';
import { ResolvedActionGroup } from '../../../../../alerts/common';
import { RecoveredActionGroup } from '../../../../../alerts/common';
import { AlertExecutorOptions } from '../../../../../alerts/server';
import { InventoryItemType, SnapshotMetricType } from '../../../../common/inventory_models/types';
import { InfraBackendLibs } from '../../infra_types';
Expand Down Expand Up @@ -103,7 +103,7 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) =
}
if (reason) {
const actionGroupId =
nextState === AlertStates.OK ? ResolvedActionGroup.id : FIRED_ACTIONS.id;
nextState === AlertStates.OK ? RecoveredActionGroup.id : FIRED_ACTIONS.id;
alertInstance.scheduleActions(actionGroupId, {
group: item,
alertState: stateToAlertMessage[nextState],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { createMetricThresholdExecutor, FIRED_ACTIONS } from './metric_threshold_executor';
import { Comparator, AlertStates } from './types';
import * as mocks from './test_mocks';
import { ResolvedActionGroup } from '../../../../../alerts/common';
import { RecoveredActionGroup } from '../../../../../alerts/common';
import { AlertExecutorOptions } from '../../../../../alerts/server';
import {
alertsMock,
Expand Down Expand Up @@ -367,7 +367,7 @@ describe('The metric threshold alert type', () => {
expect(mostRecentAction(instanceID).id).toBe(FIRED_ACTIONS.id);
expect(getState(instanceID).alertState).toBe(AlertStates.ALERT);
await execute([2]);
expect(mostRecentAction(instanceID).id).toBe(ResolvedActionGroup.id);
expect(mostRecentAction(instanceID).id).toBe(RecoveredActionGroup.id);
expect(getState(instanceID).alertState).toBe(AlertStates.OK);
});
test('does not continue to send a recovery alert if the metric is still OK', async () => {
Expand All @@ -383,7 +383,7 @@ describe('The metric threshold alert type', () => {
expect(mostRecentAction(instanceID).id).toBe(FIRED_ACTIONS.id);
expect(getState(instanceID).alertState).toBe(AlertStates.ALERT);
await execute([2]);
expect(mostRecentAction(instanceID).id).toBe(ResolvedActionGroup.id);
expect(mostRecentAction(instanceID).id).toBe(RecoveredActionGroup.id);
expect(getState(instanceID).alertState).toBe(AlertStates.OK);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { first, last } from 'lodash';
import { i18n } from '@kbn/i18n';
import moment from 'moment';
import { ResolvedActionGroup } from '../../../../../alerts/common';
import { RecoveredActionGroup } from '../../../../../alerts/common';
import { AlertExecutorOptions } from '../../../../../alerts/server';
import { InfraBackendLibs } from '../../infra_types';
import {
Expand Down Expand Up @@ -89,7 +89,7 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) =>
const firstResult = first(alertResults);
const timestamp = (firstResult && firstResult[group].timestamp) ?? moment().toISOString();
const actionGroupId =
nextState === AlertStates.OK ? ResolvedActionGroup.id : FIRED_ACTIONS.id;
nextState === AlertStates.OK ? RecoveredActionGroup.id : FIRED_ACTIONS.id;
alertInstance.scheduleActions(actionGroupId, {
group,
alertState: stateToAlertMessage[nextState],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import expect from '@kbn/expect';
import { Response as SupertestResponse } from 'supertest';
import { ResolvedActionGroup } from '../../../../../plugins/alerts/common';
import { RecoveredActionGroup } from '../../../../../plugins/alerts/common';
import { Space } from '../../../common/types';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
import {
Expand Down Expand Up @@ -174,7 +174,7 @@ instanceStateValue: true
params: {},
},
{
group: ResolvedActionGroup.id,
group: RecoveredActionGroup.id,
id: indexRecordActionId,
params: {
index: ES_TEST_INDEX_NAME,
Expand Down Expand Up @@ -237,7 +237,7 @@ instanceStateValue: true
params: {},
},
{
group: ResolvedActionGroup.id,
group: RecoveredActionGroup.id,
id: indexRecordActionId,
params: {
index: ES_TEST_INDEX_NAME,
Expand Down

0 comments on commit 6dd664d

Please sign in to comment.