@@ -27,6 +27,12 @@ type Querier interface { |
| 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 | 29 | DeleteWorkflowArtifactsByIDs(ctx context.Context, db DBTX, dollar_1 []int64) (int64, error) |
| 30 | + // Idempotent: re-disabling an already-disabled workflow is a no-op |
| 31 | + // and does not bump disabled_at. |
| 32 | + DisableWorkflow(ctx context.Context, db DBTX, arg DisableWorkflowParams) error |
| 33 | + // Returns affected-rows so the handler can distinguish 200 (re-enabled) |
| 34 | + // from 404-ish no-op. |
| 35 | + EnableWorkflow(ctx context.Context, db DBTX, arg EnableWorkflowParams) (int64, error) |
| 30 | 36 | // Idempotent insert: if a row with the same (repo_id, workflow_file, |
| 31 | 37 | // trigger_event_id) already exists, returns no rows (pgx.ErrNoRows in |
| 32 | 38 | // Go). The handler treats that as a successful no-op so worker |
@@ -65,6 +71,9 @@ type Querier interface { |
| 65 | 71 | InsertWorkflowRun(ctx context.Context, db DBTX, arg InsertWorkflowRunParams) (WorkflowRun, error) |
| 66 | 72 | // SPDX-License-Identifier: AGPL-3.0-or-later |
| 67 | 73 | InsertWorkflowStep(ctx context.Context, db DBTX, arg InsertWorkflowStepParams) (WorkflowStep, error) |
| 74 | + // SPDX-License-Identifier: AGPL-3.0-or-later |
| 75 | + // Hot path for trigger.Enqueue: skip enqueueing when the row exists. |
| 76 | + IsWorkflowDisabled(ctx context.Context, db DBTX, arg IsWorkflowDisabledParams) (bool, error) |
| 68 | 77 | ListActiveWorkflowRunsForAdmin(ctx context.Context, db DBTX, arg ListActiveWorkflowRunsForAdminParams) ([]WorkflowRun, error) |
| 69 | 78 | ListAllStepLogChunksForStep(ctx context.Context, db DBTX, stepID int64) ([]WorkflowStepLogChunk, error) |
| 70 | 79 | ListArtifactsForRun(ctx context.Context, db DBTX, runID int64) ([]ListArtifactsForRunRow, error) |
@@ -73,6 +82,9 @@ type Querier interface { |
| 73 | 82 | // cancel request. cancel-in-progress releases the slot by flipping that job |
| 74 | 83 | // flag even if the runner is still draining the old container. |
| 75 | 84 | ListBlockingConcurrencyRunsForUpdate(ctx context.Context, db DBTX, arg ListBlockingConcurrencyRunsForUpdateParams) ([]WorkflowRun, error) |
| 85 | + // Used by the workflows-list endpoint to mark `state: "disabled"` |
| 86 | + // entries without round-tripping through Is for every file. |
| 87 | + ListDisabledWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]string, error) |
| 76 | 88 | ListExpiredWorkflowArtifactsForCleanup(ctx context.Context, db DBTX, arg ListExpiredWorkflowArtifactsForCleanupParams) ([]ListExpiredWorkflowArtifactsForCleanupRow, error) |
| 77 | 89 | ListJobsForRun(ctx context.Context, db DBTX, runID int64) ([]ListJobsForRunRow, error) |
| 78 | 90 | ListOrgSecrets(ctx context.Context, db DBTX, orgID pgtype.Int8) ([]ListOrgSecretsRow, error) |