Delete all inactionable jobs

GARM cares about jobs in queued state for anything that requires
decision making. Anything else is purely informational.

This change cleans up all inactionable jobs and refuses to record jobs
that are not already in the database, have an inactionable state and
which do not have a runner we own handling them.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2026-02-10 14:08:44 +02:00 committed by Gabriel
parent eeb8bf6457
commit ec0fd6e3f8
9 changed files with 487 additions and 187 deletions

View file

@ -400,7 +400,7 @@ type WorkflowJob struct {
Conclusion string
// Status is the phase of the lifecycle that the job is currently in.
// "queued", "in_progress" and "completed".
Status string
Status string `gorm:"index:idx_workflow_jobs_status_instance_id,priority:1"`
// Name is the name if the job that was triggered.
Name string
@ -409,7 +409,7 @@ type WorkflowJob struct {
GithubRunnerID int64
InstanceID *uuid.UUID `gorm:"index:idx_instance_job"`
InstanceID *uuid.UUID `gorm:"index:idx_instance_job;index:idx_workflow_jobs_status_instance_id,priority:2"`
Instance Instance `gorm:"foreignKey:InstanceID"`
RunnerGroupID int64