Skip to content

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

Update updater_id when updating TaskRun

天舟89b916fc0d17
diff --git a/api/task_run.go b/api/task_run.go
index 715ee33153..f0f1f9bc6d 100644
--- a/api/task_run.go
+++ b/api/task_run.go
@@ -87,6 +87,9 @@ func (find *TaskRunFind) String() string {
type TaskRunStatusPatch struct {
ID *int
+ // Standard fields
+ UpdaterId int
+
// Related fields
TaskId *int
diff --git a/store/task_run.go b/store/task_run.go
index b56a2542c8..97124b3ad8 100644
--- a/store/task_run.go
+++ b/store/task_run.go
@@ -103,7 +103,7 @@ func (s *TaskRunService) FindTaskRunTx(ctx context.Context, tx *sql.Tx, find *ap
// PatchTaskRunStatusTx updates a taskRun status. Returns the new state of the taskRun after update.
func (s *TaskRunService) PatchTaskRunStatusTx(ctx context.Context, tx *sql.Tx, patch *api.TaskRunStatusPatch) (*api.TaskRun, error) {
// Build UPDATE clause.
- set, args := []string{}, []interface{}{}
+ set, args := []string{"updater_id = ?"}, []interface{}{patch.UpdaterId}
set, args = append(set, "`status` = ?"), append(args, patch.Status)
set, args = append(set, "comment = ?"), append(args, patch.Comment)