refactor: pipeline run log

This commit is contained in:
xiaojunnuo
2022-10-28 16:08:12 +08:00
parent 25d5a99b3d
commit 3dfdd3c31c
24 changed files with 381 additions and 153 deletions
+20 -3
View File
@@ -1,3 +1,5 @@
import { Logger } from "log4js";
export enum RunStrategy {
AlwaysRun,
SkipWhenSucceed,
@@ -27,9 +29,9 @@ export type EventHandler = {
};
export type RunnableStrategy = {
runStrategy: RunStrategy;
onSuccess: EventHandler[];
onError: EventHandler[];
runStrategy?: RunStrategy;
onSuccess?: EventHandler[];
onError?: EventHandler[];
};
export type Step = Runnable & {
@@ -79,7 +81,20 @@ export type Log = {
text: string;
};
export enum ResultType {
success,
error,
skip,
}
export type HistoryResultGroup = {
[key: string]: {
runnable: Runnable;
res: HistoryResult;
};
};
export type HistoryResult = {
type: string;
title: string;
/**
* 任务状态
@@ -92,4 +107,6 @@ export type HistoryResult = {
*/
result?: string;
errorMessage?: string;
logs: string[];
logger: Logger;
};