Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Add stepList to each stage of the task

天舟e29b9729fd34
diff --git a/frontend/src/plugins/task/DatabaseRequestTemplate.ts b/frontend/src/plugins/task/DatabaseRequestTemplate.ts
index 4bf9d5252d..9843342b5f 100644
--- a/frontend/src/plugins/task/DatabaseRequestTemplate.ts
+++ b/frontend/src/plugins/task/DatabaseRequestTemplate.ts
@@ -36,6 +36,12 @@ const template: TaskTemplate = {
name: "Request database",
type: "SIMPLE",
status: "PENDING",
+ stepList: [
+ {
+ name: "Provide database",
+ type: "DATABASE",
+ },
+ ],
},
],
creatorId: ctx.currentUser.id,
diff --git a/frontend/src/plugins/task/DatabaseSchemaUpdateTemplate.ts b/frontend/src/plugins/task/DatabaseSchemaUpdateTemplate.ts
index 1b20e94391..73193cecd8 100644
--- a/frontend/src/plugins/task/DatabaseSchemaUpdateTemplate.ts
+++ b/frontend/src/plugins/task/DatabaseSchemaUpdateTemplate.ts
@@ -24,6 +24,12 @@ const template: TaskTemplate = {
name: env.name,
type: "ENVIRONMENT",
status: "PENDING",
+ stepList: [
+ {
+ name: "Apply to " + env.name,
+ type: "EXECUTION",
+ },
+ ],
runnable: {
auto: true,
run: () => {
diff --git a/frontend/src/plugins/task/template.ts b/frontend/src/plugins/task/template.ts
index d937b98c6e..f7a6dc40fd 100644
--- a/frontend/src/plugins/task/template.ts
+++ b/frontend/src/plugins/task/template.ts
@@ -24,6 +24,7 @@ const DEFAULT_TEMPLATE = {
name: "Request",
type: "SIMPLE",
status: "PENDING",
+ stepList: [],
},
],
creatorId: ctx.currentUser.id,
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index 17d35506d8..999e5c8eec 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -261,11 +261,18 @@ export type StageRunnable = {
run: () => void;
};
+export type StageStep = {
+ name: string;
+ type: "EXECUTION" | "DATABASE";
+ payload?: Execution | DatabaseId;
+};
+
export type Stage = {
id: StageId;
name: string;
type: StageType;
status: StageStatus;
+ stepList: StageStep[];
environmentId?: EnvironmentId;
runnable?: StageRunnable;
};