Skip to content

Commit

Permalink
rollback StatusChangeArgsWithMessage to StatusChangeArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
maximpn committed Jan 27, 2023
1 parent 960b788 commit 01b52fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,14 @@ export interface RunningStatusChangeArgs {
newStatus: RuleExecutionStatus.running;
}

export interface StatusChangeArgsWithMessage {
newStatus: Exclude<RuleExecutionStatus, RuleExecutionStatus.running>;
metrics?: MetricsArgs;
message: string;
}
/**
* Information about the status change event.
*/
export type StatusChangeArgs = RunningStatusChangeArgs | StatusChangeArgsWithMessage;
export interface StatusChangeArgs {
newStatus: RuleExecutionStatus;
message?: string;
metrics?: MetricsArgs;
}

export interface MetricsArgs {
searchDurations?: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { throwAuthzError } from '../../../../machine_learning/validation';
import { buildRouteValidation } from '../../../../../utils/build_validation/route_validation';
import type { SecuritySolutionPluginRouter } from '../../../../../types';

import type { RuleExecutionContext, StatusChangeArgsWithMessage } from '../../../rule_monitoring';
import type { RuleExecutionContext, StatusChangeArgs } from '../../../rule_monitoring';

import type { ConfigType } from '../../../../../config';
import { alertInstanceFactoryStub } from '../../../signals/preview/alert_instance_factory_stub';
Expand Down Expand Up @@ -123,7 +123,7 @@ export const previewRulesRoute = async (
const spaceId = siemClient.getSpaceId();
const previewId = uuidv4();
const username = security?.authc.getCurrentUser(request)?.username;
const loggedStatusChanges: Array<RuleExecutionContext & StatusChangeArgsWithMessage> = [];
const loggedStatusChanges: Array<RuleExecutionContext & StatusChangeArgs> = [];
const previewRuleExecutionLogger = createPreviewRuleExecutionLogger(loggedStatusChanges);
const runState: Record<string, unknown> = {};
const logs: RulePreviewLogs[] = [];
Expand Down

0 comments on commit 01b52fe

Please sign in to comment.