@@ -26,7 +26,14 @@ type Querier interface { |
| 26 | 26 | DeleteRepoVariable(ctx context.Context, db DBTX, arg DeleteRepoVariableParams) error |
| 27 | 27 | DeleteStaleStepLogChunksForCleanup(ctx context.Context, db DBTX, completedAt pgtype.Timestamptz) (int64, error) |
| 28 | 28 | DeleteStepLogChunks(ctx context.Context, db DBTX, stepID int64) error |
| 29 | + DeleteWorkflowArtifactByID(ctx context.Context, db DBTX, id int64) (int64, error) |
| 29 | 30 | DeleteWorkflowArtifactsByIDs(ctx context.Context, db DBTX, dollar_1 []int64) (int64, error) |
| 31 | + // Cascades to workflow_jobs → workflow_steps → workflow_step_log_chunks |
| 32 | + // and workflow_artifacts via the on-delete-cascade FK chain. The |
| 33 | + // S3-side artifact blobs are NOT removed here; the handler queries |
| 34 | + // the artifact object_keys first and deletes them best-effort after |
| 35 | + // the row is gone. |
| 36 | + DeleteWorkflowRunByID(ctx context.Context, db DBTX, id int64) (int64, error) |
| 30 | 37 | // Idempotent: re-disabling an already-disabled workflow is a no-op |
| 31 | 38 | // and does not bump disabled_at. |
| 32 | 39 | DisableWorkflow(ctx context.Context, db DBTX, arg DisableWorkflowParams) error |
@@ -76,6 +83,10 @@ type Querier interface { |
| 76 | 83 | IsWorkflowDisabled(ctx context.Context, db DBTX, arg IsWorkflowDisabledParams) (bool, error) |
| 77 | 84 | ListActiveWorkflowRunsForAdmin(ctx context.Context, db DBTX, arg ListActiveWorkflowRunsForAdminParams) ([]WorkflowRun, error) |
| 78 | 85 | ListAllStepLogChunksForStep(ctx context.Context, db DBTX, stepID int64) ([]WorkflowStepLogChunk, error) |
| 86 | + // Used by the run-delete REST handler to drive a best-effort S3 |
| 87 | + // cleanup after the workflow_runs row (and its cascaded |
| 88 | + // workflow_artifacts rows) have been removed. |
| 89 | + ListArtifactObjectKeysForRun(ctx context.Context, db DBTX, runID int64) ([]string, error) |
| 79 | 90 | ListArtifactsForRun(ctx context.Context, db DBTX, runID int64) ([]ListArtifactsForRunRow, error) |
| 80 | 91 | // Older queued/running runs with the same group block the new run while they |
| 81 | 92 | // still have at least one queued/running job that has not already received a |