Skip to content

Commit 572fa55

Browse files
authored
Drop IDOrderDesc for listing Actions task and always order by id DESC (#31150)
Close #31066 Just follow what `FindRunOptions` and `FindScheduleOptions` do.
1 parent 1137a03 commit 572fa55

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

models/actions/task_list.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ type FindTaskOptions struct {
5454
UpdatedBefore timeutil.TimeStamp
5555
StartedBefore timeutil.TimeStamp
5656
RunnerID int64
57-
IDOrderDesc bool
5857
}
5958

6059
func (opts FindTaskOptions) ToConds() builder.Cond {
@@ -84,8 +83,5 @@ func (opts FindTaskOptions) ToConds() builder.Cond {
8483
}
8584

8685
func (opts FindTaskOptions) ToOrders() string {
87-
if opts.IDOrderDesc {
88-
return "`id` DESC"
89-
}
90-
return ""
86+
return "`id` DESC"
9187
}

routers/web/shared/actions/runners.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ func RunnerDetails(ctx *context.Context, page int, runnerID, ownerID, repoID int
7979
Page: page,
8080
PageSize: 30,
8181
},
82-
Status: actions_model.StatusUnknown, // Unknown means all
83-
IDOrderDesc: true,
84-
RunnerID: runner.ID,
82+
Status: actions_model.StatusUnknown, // Unknown means all
83+
RunnerID: runner.ID,
8584
}
8685

8786
tasks, count, err := db.FindAndCount[actions_model.ActionTask](ctx, opts)

0 commit comments

Comments
 (0)