2
0

feat(actions): add waiting jobs view filtered by runner label

Adds a new page to view all waiting/blocked jobs for a specific runner label. This helps administrators identify which jobs are queued for particular runner labels and diagnose runner capacity issues.
This commit is contained in:
2026-01-25 11:27:07 -05:00
parent d32d3e1360
commit 73ab59f158
6 changed files with 139 additions and 10 deletions

View File

@@ -315,3 +315,24 @@ func GetQueueDepthByLabels(ctx context.Context) ([]QueueDepthByLabel, error) {
return result, nil
}
// GetWaitingJobsByLabel returns all waiting/blocked jobs that have the specified label in their RunsOn
func GetWaitingJobsByLabel(ctx context.Context, label string) ([]*ActionRunJob, error) {
var jobs []*ActionRunJob
err := db.GetEngine(ctx).Where("status IN (?, ?)", StatusWaiting, StatusBlocked).Find(&jobs)
if err != nil {
return nil, err
}
// Filter by label
var filtered []*ActionRunJob
for _, job := range jobs {
for _, l := range job.RunsOn {
if l == label {
filtered = append(filtered, job)
break
}
}
}
return filtered, nil
}