Skip to content

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

Change task_run.detail to task_run.comment to be consistent with other table's naming

天舟9458b15fa3c8
diff --git a/api/task_run.go b/api/task_run.go
index 144091ec68..4d1d0e9e1d 100644
--- a/api/task_run.go
+++ b/api/task_run.go
@@ -48,7 +48,7 @@ type TaskRun struct {
Name string `jsonapi:"attr,name"`
Status TaskRunStatus `jsonapi:"attr,status"`
Type TaskType `jsonapi:"attr,type"`
- Detail string `jsonapi:"attr,detail"`
+ Comment string `jsonapi:"attr,comment"`
Payload string `jsonapi:"attr,payload"`
}
@@ -92,8 +92,8 @@ type TaskRunStatusPatch struct {
// Domain specific fields
Status TaskRunStatus
- // The task status detail
- Detail string
+ // Records the status detail (e.g. error message on failure)
+ Comment string
}
type TaskRunService interface {
diff --git a/frontend/src/components/TaskRunTable.vue b/frontend/src/components/TaskRunTable.vue
index 21c84f1f22..2ad8146064 100644
--- a/frontend/src/components/TaskRunTable.vue
+++ b/frontend/src/components/TaskRunTable.vue
@@ -74,7 +74,7 @@
</div>
</BBTableCell>
<BBTableCell class="table-cell w-36">
- {{ taskRun.detail }}
+ {{ taskRun.comment }}
</BBTableCell>
<BBTableCell class="table-cell w-12">
<div class="flex flex-row items-center space-x-2">
@@ -109,7 +109,7 @@ const columnList: BBTableColumn[] = [
title: "Status",
},
{
- title: "Detail",
+ title: "Comment",
},
{
title: "Invoker",
diff --git a/frontend/src/types/pipeline/task.ts b/frontend/src/types/pipeline/task.ts
index bd8beadbc3..21d57f4dc1 100644
--- a/frontend/src/types/pipeline/task.ts
+++ b/frontend/src/types/pipeline/task.ts
@@ -117,6 +117,6 @@ export type TaskRun = {
name: string;
status: TaskRunStatus;
type: TaskType;
- detail: string;
+ comment: string;
payload?: TaskPayload;
};
diff --git a/store/migration/10001__init_schema.sql b/store/migration/10001__init_schema.sql
index fbb218d65a..1640da0f6b 100644
--- a/store/migration/10001__init_schema.sql
+++ b/store/migration/10001__init_schema.sql
@@ -814,7 +814,7 @@ CREATE TABLE task_run (
)
),
`type` TEXT NOT NULL CHECK (`type` LIKE 'bb.task.%'),
- detail TEXT NOT NULL DEFAULT '',
+ comment TEXT NOT NULL DEFAULT '',
payload TEXT NOT NULL DEFAULT ''
);
diff --git a/store/seed/release/10001__init_seed.sql b/store/seed/release/10001__init_seed.sql
index 2b6ee849bf..cce836f0a2 100644
--- a/store/seed/release/10001__init_seed.sql
+++ b/store/seed/release/10001__init_seed.sql
@@ -324,7 +324,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail,
+ comment,
payload
)
VALUES
@@ -347,7 +347,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail,
+ comment,
payload
)
VALUES
diff --git a/store/seed/test/10120__task_run.sql b/store/seed/test/10120__task_run.sql
index db24c500b0..2abefce08f 100644
--- a/store/seed/test/10120__task_run.sql
+++ b/store/seed/test/10120__task_run.sql
@@ -9,7 +9,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail,
+ comment,
payload
)
VALUES
@@ -37,7 +37,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail,
+ comment,
payload
)
VALUES
@@ -64,7 +64,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail
+ comment
)
VALUES
(
@@ -89,7 +89,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail,
+ comment,
payload
)
VALUES
@@ -117,7 +117,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail,
+ comment,
payload
)
VALUES
@@ -145,7 +145,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail,
+ comment,
payload
)
VALUES
@@ -173,7 +173,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail,
+ comment,
payload
)
VALUES
@@ -201,7 +201,7 @@ INSERT INTO
name,
`status`,
`type`,
- detail,
+ comment,
payload
)
VALUES
diff --git a/store/task.go b/store/task.go
index a24e95e212..b9a58eb66f 100644
--- a/store/task.go
+++ b/store/task.go
@@ -331,9 +331,9 @@ func (s *TaskService) patchTaskStatus(ctx context.Context, tx *Tx, patch *api.Ta
}
} else {
taskRunStatusPatch := &api.TaskRunStatusPatch{
- ID: &taskRun.ID,
- TaskId: &patch.ID,
- Detail: patch.Comment,
+ ID: &taskRun.ID,
+ TaskId: &patch.ID,
+ Comment: patch.Comment,
}
switch patch.Status {
case api.TaskDone:
diff --git a/store/task_run.go b/store/task_run.go
index 9902ef0192..f8eed65d06 100644
--- a/store/task_run.go
+++ b/store/task_run.go
@@ -39,7 +39,7 @@ func (s *TaskRunService) CreateTaskRun(ctx context.Context, tx *sql.Tx, create *
payload
)
VALUES (?, ?, ?, ?, 'RUNNING', ?, ?)
- RETURNING id, creator_id, created_ts, updater_id, updated_ts, task_id, name, `+"`status`, `type`, detail, payload"+`
+ RETURNING id, creator_id, created_ts, updater_id, updated_ts, task_id, name, `+"`status`, `type`, comment, payload"+`
`,
create.CreatorId,
create.CreatorId,
@@ -66,7 +66,7 @@ func (s *TaskRunService) CreateTaskRun(ctx context.Context, tx *sql.Tx, create *
&taskRun.Name,
&taskRun.Status,
&taskRun.Type,
- &taskRun.Detail,
+ &taskRun.Comment,
&taskRun.Payload,
); err != nil {
return nil, FormatError(err)
@@ -105,7 +105,7 @@ func (s *TaskRunService) PatchTaskRunStatus(ctx context.Context, tx *sql.Tx, pat
// Build UPDATE clause.
set, args := []string{}, []interface{}{}
set, args = append(set, "`status` = ?"), append(args, patch.Status)
- set, args = append(set, "detail = ?"), append(args, patch.Detail)
+ set, args = append(set, "comment = ?"), append(args, patch.Comment)
// Build WHERE clause.
where := []string{"1 = 1"}
@@ -120,7 +120,7 @@ func (s *TaskRunService) PatchTaskRunStatus(ctx context.Context, tx *sql.Tx, pat
UPDATE task_run
SET `+strings.Join(set, ", ")+`
WHERE `+strings.Join(where, " AND ")+`
- RETURNING id, creator_id, created_ts, updater_id, updated_ts, task_id, name, `+"`status`, `type`, detail, payload"+`
+ RETURNING id, creator_id, created_ts, updater_id, updated_ts, task_id, name, `+"`status`, `type`, comment, payload"+`
`,
args...,
)
@@ -142,7 +142,7 @@ func (s *TaskRunService) PatchTaskRunStatus(ctx context.Context, tx *sql.Tx, pat
&taskRun.Name,
&taskRun.Status,
&taskRun.Type,
- &taskRun.Detail,
+ &taskRun.Comment,
&taskRun.Payload,
); err != nil {
return nil, FormatError(err)
@@ -180,7 +180,7 @@ func (s *TaskRunService) findTaskRunList(ctx context.Context, tx *sql.Tx, find *
name,
`+"`status`,"+`
`+"`type`,"+`
- detail,
+ comment,
payload
FROM task_run
WHERE `+strings.Join(where, " AND "),
@@ -205,7 +205,7 @@ func (s *TaskRunService) findTaskRunList(ctx context.Context, tx *sql.Tx, find *
&taskRun.Name,
&taskRun.Status,
&taskRun.Type,
- &taskRun.Detail,
+ &taskRun.Comment,
&taskRun.Payload,
); err != nil {
return nil, FormatError(err)