This repository has been archived on 2026-07-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
gitea-codex/internal/store/store.go
T
Space-Banane 85c0e735dc
ci / test (pull_request) Successful in 21s
ci / publish (pull_request) Has been skipped
fix. harden Go review flow
Fix runner bootstrap and auth handling, preserve queued SHAs, make event/job acceptance atomic, fence stale runs, correct retries and prompts, add fake end-to-end coverage, and fix deployment defaults.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-12 22:20:48 +02:00

26 lines
1.1 KiB
Go

package store
import (
"context"
"time"
"gitea-codex-bot/internal/domain"
)
type Store interface {
Migrate(context.Context) error
InsertWebhookEvent(context.Context, domain.WebhookEvent) (bool, error)
CooldownRemaining(context.Context, string, int, time.Duration) (int, error)
EnqueueJob(context.Context, domain.WebhookEvent, domain.ParsedCommand) (domain.Job, error)
EnqueueAcceptedJob(context.Context, domain.WebhookEvent, domain.ParsedCommand, time.Duration) (domain.Job, bool, int, error)
ClaimNextJob(context.Context, time.Time, time.Duration, int) (*domain.Job, *domain.ReviewRun, error)
FinishJob(context.Context, int64, int64, bool, bool, *domain.ReviewResult, error) error
LatestFailedJob(context.Context) (*domain.Job, error)
LatestJob(context.Context) (*domain.Job, error)
LatestSuccessfulReview(context.Context, string, int) (*domain.Job, error)
PendingCount(context.Context, string, int) (int, error)
UpsertBotComment(context.Context, string, int, string, int64, string) error
BotCommentID(context.Context, string, int, string) (int64, error)
Close() error
}