55 * 2.0.
66 */
77
8- import { SanitizedRuleConfig } from '@kbn/alerting-plugin/common' ;
8+ import { Rule , SanitizedRuleConfig } from '@kbn/alerting-plugin/common' ;
99import { DEFAULT_FLAPPING_SETTINGS } from '@kbn/alerting-plugin/common/rules_settings' ;
1010import { RuleExecutorServices } from '@kbn/alerting-plugin/server' ;
1111import { publicAlertsClientMock } from '@kbn/alerting-plugin/server/alerts_client/alerts_client.mock' ;
@@ -25,7 +25,13 @@ import {
2525import { ISearchStartSearchSource } from '@kbn/data-plugin/public' ;
2626import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks' ;
2727import { MockedLogger } from '@kbn/logging-mocks' ;
28- import { Rule } from '@kbn/alerting-plugin/common' ;
28+ import {
29+ ALERT_EVALUATION_THRESHOLD ,
30+ ALERT_EVALUATION_VALUE ,
31+ ALERT_GROUP ,
32+ ALERT_REASON ,
33+ SLO_BURN_RATE_RULE_TYPE_ID ,
34+ } from '@kbn/rule-registry-plugin/common/technical_rule_data_field_names' ;
2935import { SharePluginStart } from '@kbn/share-plugin/server' ;
3036import { sloDefinitionSchema } from '@kbn/slo-schema' ;
3137import { get } from 'lodash' ;
@@ -41,25 +47,18 @@ import {
4147 SLO_INSTANCE_ID_FIELD ,
4248 SLO_REVISION_FIELD ,
4349} from '../../../../common/field_names/slo' ;
44- import {
45- ALERT_EVALUATION_THRESHOLD ,
46- ALERT_EVALUATION_VALUE ,
47- ALERT_GROUP ,
48- ALERT_REASON ,
49- SLO_BURN_RATE_RULE_TYPE_ID ,
50- } from '@kbn/rule-registry-plugin/common/technical_rule_data_field_names' ;
5150import { SLODefinition , StoredSLODefinition } from '../../../domain/models' ;
5251import { SLONotFound } from '../../../errors' ;
5352import { SO_SLO_TYPE } from '../../../saved_objects' ;
5453import { createSLO } from '../../../services/fixtures/slo' ;
5554import { BurnRateAlert , getRuleExecutor } from './executor' ;
5655import {
56+ LONG_WINDOW ,
57+ SHORT_WINDOW ,
5758 generateAboveThresholdKey ,
5859 generateBurnRateKey ,
5960 generateStatsKey ,
6061 generateWindowId ,
61- LONG_WINDOW ,
62- SHORT_WINDOW ,
6362} from './lib/build_query' ;
6463import { EvaluationBucket } from './lib/evaluate' ;
6564import {
@@ -188,7 +187,7 @@ describe('BurnRateRuleExecutor', () => {
188187 describe ( 'multi-window' , ( ) => {
189188 it ( 'throws when the slo is not found' , async ( ) => {
190189 soClientMock . find . mockRejectedValue ( new SLONotFound ( 'SLO [non-existent] not found' ) ) ;
191- const executor = getRuleExecutor ( { basePath : basePathMock } ) ;
190+ const executor = getRuleExecutor ( basePathMock ) ;
192191
193192 await expect (
194193 executor ( {
@@ -212,7 +211,7 @@ describe('BurnRateRuleExecutor', () => {
212211 it ( 'returns early when the slo is disabled' , async ( ) => {
213212 const slo = createSLO ( { objective : { target : 0.9 } , enabled : false } ) ;
214213 soClientMock . find . mockResolvedValueOnce ( createFindResponse ( [ slo ] ) ) ;
215- const executor = getRuleExecutor ( { basePath : basePathMock } ) ;
214+ const executor = getRuleExecutor ( basePathMock ) ;
216215
217216 const result = await executor ( {
218217 params : someRuleParamsWithWindows ( { sloId : slo . id } ) ,
@@ -264,7 +263,7 @@ describe('BurnRateRuleExecutor', () => {
264263 generateEsResponse ( ruleParams , [ ] , { instanceId : 'bar' } )
265264 ) ;
266265
267- const executor = getRuleExecutor ( { basePath : basePathMock } ) ;
266+ const executor = getRuleExecutor ( basePathMock ) ;
268267 await executor ( {
269268 params : ruleParams ,
270269 startedAt : new Date ( ) ,
@@ -312,7 +311,7 @@ describe('BurnRateRuleExecutor', () => {
312311 generateEsResponse ( ruleParams , [ ] , { instanceId : 'bar' } )
313312 ) ;
314313
315- const executor = getRuleExecutor ( { basePath : basePathMock } ) ;
314+ const executor = getRuleExecutor ( basePathMock ) ;
316315 await executor ( {
317316 params : ruleParams ,
318317 startedAt : new Date ( ) ,
@@ -369,9 +368,7 @@ describe('BurnRateRuleExecutor', () => {
369368 start : new Date ( ) . toISOString ( ) ,
370369 } ) ) ;
371370
372- const executor = getRuleExecutor ( {
373- basePath : basePathMock ,
374- } ) ;
371+ const executor = getRuleExecutor ( basePathMock ) ;
375372
376373 await executor ( {
377374 params : ruleParams ,
@@ -519,9 +516,7 @@ describe('BurnRateRuleExecutor', () => {
519516 start : new Date ( ) . toISOString ( ) ,
520517 } ) ) ;
521518
522- const executor = getRuleExecutor ( {
523- basePath : basePathMock ,
524- } ) ;
519+ const executor = getRuleExecutor ( basePathMock ) ;
525520
526521 await executor ( {
527522 params : ruleParams ,
@@ -643,7 +638,7 @@ describe('BurnRateRuleExecutor', () => {
643638 start : new Date ( ) . toISOString ( ) ,
644639 } ) ) ;
645640
646- const executor = getRuleExecutor ( { basePath : basePathMock } ) ;
641+ const executor = getRuleExecutor ( basePathMock ) ;
647642 await executor ( {
648643 params : ruleParams ,
649644 startedAt : new Date ( ) ,
0 commit comments