@@ -17,6 +17,7 @@ type Querier interface { |
| 17 | ClaimQueuedWorkflowJob(ctx context.Context, db DBTX, arg ClaimQueuedWorkflowJobParams) (ClaimQueuedWorkflowJobRow, error) | 17 | ClaimQueuedWorkflowJob(ctx context.Context, db DBTX, arg ClaimQueuedWorkflowJobParams) (ClaimQueuedWorkflowJobRow, error) |
| 18 | CompleteWorkflowRun(ctx context.Context, db DBTX, arg CompleteWorkflowRunParams) (WorkflowRun, error) | 18 | CompleteWorkflowRun(ctx context.Context, db DBTX, arg CompleteWorkflowRunParams) (WorkflowRun, error) |
| 19 | CountRunningJobsForRunner(ctx context.Context, db DBTX, runnerID int64) (int32, error) | 19 | CountRunningJobsForRunner(ctx context.Context, db DBTX, runnerID int64) (int32, error) |
| | 20 | + CountWorkflowCachesForRepo(ctx context.Context, db DBTX, arg CountWorkflowCachesForRepoParams) (int64, error) |
| 20 | CountWorkflowRunsForRepo(ctx context.Context, db DBTX, arg CountWorkflowRunsForRepoParams) (int64, error) | 21 | CountWorkflowRunsForRepo(ctx context.Context, db DBTX, arg CountWorkflowRunsForRepoParams) (int64, error) |
| 21 | DeleteOldRunnerJWTUsesForCleanup(ctx context.Context, db DBTX, expiresAt pgtype.Timestamptz) (int64, error) | 22 | DeleteOldRunnerJWTUsesForCleanup(ctx context.Context, db DBTX, expiresAt pgtype.Timestamptz) (int64, error) |
| 22 | DeleteOldWorkflowRunsForCleanup(ctx context.Context, db DBTX, completedAt pgtype.Timestamptz) (int64, error) | 23 | DeleteOldWorkflowRunsForCleanup(ctx context.Context, db DBTX, completedAt pgtype.Timestamptz) (int64, error) |
@@ -28,6 +29,10 @@ type Querier interface { |
| 28 | DeleteStepLogChunks(ctx context.Context, db DBTX, stepID int64) error | 29 | DeleteStepLogChunks(ctx context.Context, db DBTX, stepID int64) error |
| 29 | DeleteWorkflowArtifactByID(ctx context.Context, db DBTX, id int64) (int64, error) | 30 | DeleteWorkflowArtifactByID(ctx context.Context, db DBTX, id int64) (int64, error) |
| 30 | DeleteWorkflowArtifactsByIDs(ctx context.Context, db DBTX, dollar_1 []int64) (int64, error) | 31 | DeleteWorkflowArtifactsByIDs(ctx context.Context, db DBTX, dollar_1 []int64) (int64, error) |
| | 32 | + DeleteWorkflowCacheByID(ctx context.Context, db DBTX, arg DeleteWorkflowCacheByIDParams) (int64, error) |
| | 33 | + // Returns the deleted rows' object_keys so the handler can purge the |
| | 34 | + // backing tarballs from object storage. |
| | 35 | + DeleteWorkflowCachesByKey(ctx context.Context, db DBTX, arg DeleteWorkflowCachesByKeyParams) ([]string, error) |
| 31 | // Cascades to workflow_jobs → workflow_steps → workflow_step_log_chunks | 36 | // Cascades to workflow_jobs → workflow_steps → workflow_step_log_chunks |
| 32 | // and workflow_artifacts via the on-delete-cascade FK chain. The | 37 | // and workflow_artifacts via the on-delete-cascade FK chain. The |
| 33 | // S3-side artifact blobs are NOT removed here; the handler queries | 38 | // S3-side artifact blobs are NOT removed here; the handler queries |
@@ -61,6 +66,7 @@ type Querier interface { |
| 61 | GetRunnerByTokenHash(ctx context.Context, db DBTX, tokenHash []byte) (GetRunnerByTokenHashRow, error) | 66 | GetRunnerByTokenHash(ctx context.Context, db DBTX, tokenHash []byte) (GetRunnerByTokenHashRow, error) |
| 62 | GetStepLogChunkBefore(ctx context.Context, db DBTX, arg GetStepLogChunkBeforeParams) (WorkflowStepLogChunk, error) | 67 | GetStepLogChunkBefore(ctx context.Context, db DBTX, arg GetStepLogChunkBeforeParams) (WorkflowStepLogChunk, error) |
| 63 | GetStepLogChunkByStepSeq(ctx context.Context, db DBTX, arg GetStepLogChunkByStepSeqParams) (WorkflowStepLogChunk, error) | 68 | GetStepLogChunkByStepSeq(ctx context.Context, db DBTX, arg GetStepLogChunkByStepSeqParams) (WorkflowStepLogChunk, error) |
| | 69 | + GetWorkflowCacheByID(ctx context.Context, db DBTX, id int64) (WorkflowCache, error) |
| 64 | GetWorkflowJobByID(ctx context.Context, db DBTX, id int64) (WorkflowJob, error) | 70 | GetWorkflowJobByID(ctx context.Context, db DBTX, id int64) (WorkflowJob, error) |
| 65 | GetWorkflowJobSecretMask(ctx context.Context, db DBTX, jobID int64) (WorkflowJobSecretMask, error) | 71 | GetWorkflowJobSecretMask(ctx context.Context, db DBTX, jobID int64) (WorkflowJobSecretMask, error) |
| 66 | GetWorkflowRunByID(ctx context.Context, db DBTX, id int64) (WorkflowRun, error) | 72 | GetWorkflowRunByID(ctx context.Context, db DBTX, id int64) (WorkflowRun, error) |
@@ -73,6 +79,12 @@ type Querier interface { |
| 73 | InsertRunner(ctx context.Context, db DBTX, arg InsertRunnerParams) (WorkflowRunner, error) | 79 | InsertRunner(ctx context.Context, db DBTX, arg InsertRunnerParams) (WorkflowRunner, error) |
| 74 | InsertRunnerToken(ctx context.Context, db DBTX, arg InsertRunnerTokenParams) (RunnerToken, error) | 80 | InsertRunnerToken(ctx context.Context, db DBTX, arg InsertRunnerTokenParams) (RunnerToken, error) |
| 75 | // SPDX-License-Identifier: AGPL-3.0-or-later | 81 | // SPDX-License-Identifier: AGPL-3.0-or-later |
| | 82 | + // Called by the future runner-side upload handler when an |
| | 83 | + // actions/cache step completes its tarball upload. Idempotent on |
| | 84 | + // (repo_id, cache_key, cache_version, git_ref): a re-upload with the |
| | 85 | + // same coordinates updates size + last_accessed_at + object_key. |
| | 86 | + InsertWorkflowCache(ctx context.Context, db DBTX, arg InsertWorkflowCacheParams) (WorkflowCache, error) |
| | 87 | + // SPDX-License-Identifier: AGPL-3.0-or-later |
| 76 | InsertWorkflowJob(ctx context.Context, db DBTX, arg InsertWorkflowJobParams) (WorkflowJob, error) | 88 | InsertWorkflowJob(ctx context.Context, db DBTX, arg InsertWorkflowJobParams) (WorkflowJob, error) |
| 77 | // SPDX-License-Identifier: AGPL-3.0-or-later | 89 | // SPDX-License-Identifier: AGPL-3.0-or-later |
| 78 | InsertWorkflowRun(ctx context.Context, db DBTX, arg InsertWorkflowRunParams) (WorkflowRun, error) | 90 | InsertWorkflowRun(ctx context.Context, db DBTX, arg InsertWorkflowRunParams) (WorkflowRun, error) |
@@ -107,6 +119,10 @@ type Querier interface { |
| 107 | ListRunners(ctx context.Context, db DBTX) ([]ListRunnersRow, error) | 119 | ListRunners(ctx context.Context, db DBTX) ([]ListRunnersRow, error) |
| 108 | ListStepLogChunks(ctx context.Context, db DBTX, arg ListStepLogChunksParams) ([]WorkflowStepLogChunk, error) | 120 | ListStepLogChunks(ctx context.Context, db DBTX, arg ListStepLogChunksParams) ([]WorkflowStepLogChunk, error) |
| 109 | ListStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListStepsForJobRow, error) | 121 | ListStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListStepsForJobRow, error) |
| | 122 | + // Paginated list filtered optionally by ref + key. NULL params skip |
| | 123 | + // the filter. Sorted by last_accessed_at DESC so an operator sees the |
| | 124 | + // live caches first. |
| | 125 | + ListWorkflowCachesForRepo(ctx context.Context, db DBTX, arg ListWorkflowCachesForRepoParams) ([]WorkflowCache, error) |
| 110 | ListWorkflowRunWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]ListWorkflowRunWorkflowsForRepoRow, error) | 126 | ListWorkflowRunWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]ListWorkflowRunWorkflowsForRepoRow, error) |
| 111 | ListWorkflowRunsForRepo(ctx context.Context, db DBTX, arg ListWorkflowRunsForRepoParams) ([]ListWorkflowRunsForRepoRow, error) | 127 | ListWorkflowRunsForRepo(ctx context.Context, db DBTX, arg ListWorkflowRunsForRepoParams) ([]ListWorkflowRunsForRepoRow, error) |
| 112 | LockRunnerByID(ctx context.Context, db DBTX, id int64) (WorkflowRunner, error) | 128 | LockRunnerByID(ctx context.Context, db DBTX, id int64) (WorkflowRunner, error) |
@@ -129,6 +145,9 @@ type Querier interface { |
| 129 | RevokeAllTokensForRunner(ctx context.Context, db DBTX, runnerID int64) error | 145 | RevokeAllTokensForRunner(ctx context.Context, db DBTX, runnerID int64) error |
| 130 | StartWorkflowRun(ctx context.Context, db DBTX, id int64) (WorkflowRun, error) | 146 | StartWorkflowRun(ctx context.Context, db DBTX, id int64) (WorkflowRun, error) |
| 131 | TouchRunnerHeartbeat(ctx context.Context, db DBTX, arg TouchRunnerHeartbeatParams) error | 147 | TouchRunnerHeartbeat(ctx context.Context, db DBTX, arg TouchRunnerHeartbeatParams) error |
| | 148 | + // Bumps last_accessed_at on cache hit. Called by the future |
| | 149 | + // restore-side handler. |
| | 150 | + TouchWorkflowCache(ctx context.Context, db DBTX, id int64) error |
| 132 | UpdateStepLogChunk(ctx context.Context, db DBTX, arg UpdateStepLogChunkParams) error | 151 | UpdateStepLogChunk(ctx context.Context, db DBTX, arg UpdateStepLogChunkParams) error |
| 133 | UpdateWorkflowJobStatus(ctx context.Context, db DBTX, arg UpdateWorkflowJobStatusParams) (WorkflowJob, error) | 152 | UpdateWorkflowJobStatus(ctx context.Context, db DBTX, arg UpdateWorkflowJobStatusParams) (WorkflowJob, error) |
| 134 | UpdateWorkflowStepLogObject(ctx context.Context, db DBTX, arg UpdateWorkflowStepLogObjectParams) (WorkflowStep, error) | 153 | UpdateWorkflowStepLogObject(ctx context.Context, db DBTX, arg UpdateWorkflowStepLogObjectParams) (WorkflowStep, error) |