Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Store the task check run error in the result payload Detail field to be consistent with task_run
天舟cb8a7b718849
diff --git a/api/task_check_run.go b/api/task_check_run.goindex ca074b2c30..1706a174a4 100644--- a/api/task_check_run.go+++ b/api/task_check_run.go@@ -78,6 +78,7 @@ type TaskCheckResult struct {}type TaskCheckRunResultPayload struct {+ Detail string `json:"detail,omitempty"`ResultList []TaskCheckResult `json:"resultList,omitempty"`}@@ -154,9 +155,7 @@ type TaskCheckRunStatusPatch struct {// Domain specific fieldsStatus TaskCheckRunStatusCode common.Code- // Records the status detail (e.g. error message on failure)- Comment string- Result string+ Result string}type TaskCheckRunService interface {diff --git a/frontend/src/components/TaskCheckRunPanel.vue b/frontend/src/components/TaskCheckRunPanel.vueindex c93e4b9db7..4c9524a47f 100644--- a/frontend/src/components/TaskCheckRunPanel.vue+++ b/frontend/src/components/TaskCheckRunPanel.vue@@ -126,7 +126,7 @@ export default {status: "ERROR",title: "Error",code: props.taskCheckRun.code,- content: props.taskCheckRun.comment,+ content: props.taskCheckRun.result.detail,},];} else if (props.taskCheckRun.status == "CANCELED") {diff --git a/frontend/src/types/pipeline/task.ts b/frontend/src/types/pipeline/task.tsindex 6fa2c574cb..92dd6d79dd 100644--- a/frontend/src/types/pipeline/task.ts+++ b/frontend/src/types/pipeline/task.ts@@ -159,6 +159,7 @@ export type TaskCheckResult = {};export type TaskCheckRunResultPayload = {+ detail: string;resultList: TaskCheckResult[];};diff --git a/server/task_check_scheduler.go b/server/task_check_scheduler.goindex f59f3552e6..48257d1913 100644--- a/server/task_check_scheduler.go+++ b/server/task_check_scheduler.go@@ -124,12 +124,25 @@ func (s *TaskCheckScheduler) Run() error {zap.String("type", string(taskCheckRun.Type)),zap.Error(err),)+ bytes, err := json.Marshal(api.TaskCheckRunResultPayload{+ Detail: err.Error(),+ })+ if err != nil {+ s.l.Error("Failed to marshal task check run result",+ zap.Int("id", taskCheckRun.ID),+ zap.Int("task_id", taskCheckRun.TaskId),+ zap.String("type", string(taskCheckRun.Type)),+ zap.Error(err),+ )+ return+ }+taskCheckRunStatusPatch := &api.TaskCheckRunStatusPatch{ID: &taskCheckRun.ID,UpdaterId: api.SYSTEM_BOT_ID,Status: api.TaskCheckRunFailed,Code: common.ErrorCode(err),- Comment: err.Error(),+ Result: string(bytes),}_, err = s.server.TaskCheckRunService.PatchTaskCheckRunStatus(context.Background(), taskCheckRunStatusPatch)if err != nil {diff --git a/store/task_check_run.go b/store/task_check_run.goindex 080ff7fa75..c9f2de4c1d 100644--- a/store/task_check_run.go+++ b/store/task_check_run.go@@ -206,7 +206,6 @@ func (s *TaskCheckRunService) PatchTaskCheckRunStatusTx(ctx context.Context, txset, args := []string{"updater_id = ?"}, []interface{}{patch.UpdaterId}set, args = append(set, "`status` = ?"), append(args, patch.Status)set, args = append(set, "code = ?"), append(args, patch.Code)- set, args = append(set, "comment = ?"), append(args, patch.Comment)set, args = append(set, "result = ?"), append(args, patch.Result)// Build WHERE clause.