refactor(state): delete the dead IncrementRetryCount RPC (breaking change, accepted)

IncrementRetryCount had zero production callers -- only tests and the
staterpc plumbing referenced it. taskactions.Service.applyRetry already
uses the atomic RetryTask exclusively, which increments retry_count and
requeues in one transaction.

Unlike ListCaptures/ListUndispatchedCaptures (kept as declared-unconsumed
compatibility surfaces because a rolling deploy could have an old
client/server pairing mid-flight), this repo has one production consumer
(see AGENTS.md's solo-project note), so the breaking removal is accepted
outright rather than deprecated-and-kept. Deleted the Go method, the
storecontract interface entry, the staterpc server/client methods, and the
RPC/messages from state.proto, regenerating the .pb.go/_grpc.pb.go pair.

Test fixtures that used IncrementRetryCount as a setup helper now drive
retry_count through the real path instead: queries_test.go bumps it via
direct SQL (same package, no contract to route through), and
api_tasks_actions_test.go now loops RetryTask+Transition, which exercises
production code instead of a deleted one.
This commit is contained in:
sam committed 2026-09-15 11:24:57 +10:00
1 parent ac38c442d5
commit e84aded3fb
11 files changed
+325 -505

No files matched your search

+7 -1
View File
@@ -225,8 +225,14 @@ func TestRetryEnforcesMaxRetries(t *testing.T) {
srv, task, _, _, _ := actionServer(t, workflow.StatusParked, "it broke")
operatorActions(t, srv).cfg = config.NewHolder(config.Config{MaxRetries: tc.maxRetries})
ctx := t.Context()
// Drive retry_count up through the real atomic retry path
// (RetryTask) rather than a raw counter bump, re-parking
// between retries so each call sees the fromStatus it needs.
for range tc.priorCount {
if err := srv.Store.IncrementRetryCount(ctx, task.ID); err != nil {
if err := srv.Store.RetryTask(ctx, task.ID, workflow.StatusParked, ""); err != nil {
t.Fatal(err)
}
if err := srv.Store.Transition(ctx, task.ID, workflow.StatusQueued, workflow.StatusParked, "re-parked for test fixture"); err != nil {
t.Fatal(err)
}
}