You've already forked agentic-coding-workflow
chore(jobs): align log keys + add prune no-op test + down-migration comment
Cross-cutting review polish: - worker.go: id/type → job_id/job_type; one stray attempts → attempt for consistency with the other 4 sites in the same file. - runners/workspace_fetch.go: ws_id → workspace_id (matches the dispatched notify.Message metadata key). - runners/worktree_prune.go: id → worktree_id (same reason). - runners/worktree_prune_test.go: add TestWorktreePrune_NoRowsIsNoOp for symmetry with the no-op tests in the other 4 runner test files. - migrations/0005_jobs.down.sql: comment that DROP TABLE jobs cascades to drop the three idx_jobs_* indexes automatically.
This commit is contained in:
@@ -75,7 +75,7 @@ func (r *WorktreePrune) warningPhase(ctx context.Context) {
|
||||
}
|
||||
for _, w := range rows {
|
||||
if err := r.repo.MarkPruneWarning(ctx, w.ID); err != nil {
|
||||
r.log.Error("worktree_prune.mark_warning", "id", w.ID, "err", err.Error())
|
||||
r.log.Error("worktree_prune.mark_warning", "worktree_id", w.ID, "err", err.Error())
|
||||
continue
|
||||
}
|
||||
if derr := r.disp.Dispatch(ctx, notify.Message{
|
||||
@@ -90,7 +90,7 @@ func (r *WorktreePrune) warningPhase(ctx context.Context) {
|
||||
},
|
||||
CreatedAt: time.Now().UTC(),
|
||||
}); derr != nil {
|
||||
r.log.Error("worktree_prune.dispatch", "id", w.ID, "err", derr.Error())
|
||||
r.log.Error("worktree_prune.dispatch", "worktree_id", w.ID, "err", derr.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,14 +109,14 @@ func (r *WorktreePrune) executionPhase(ctx context.Context) {
|
||||
continue
|
||||
}
|
||||
if rmErr := r.gitr.WorktreeRemove(ctx, started.MainPath, started.Path); rmErr != nil {
|
||||
r.log.Error("worktree_prune.remove_failed", "id", w.ID, "err", rmErr.Error())
|
||||
r.log.Error("worktree_prune.remove_failed", "worktree_id", w.ID, "err", rmErr.Error())
|
||||
if rbErr := r.repo.FinishPruneRollback(ctx, w.ID); rbErr != nil {
|
||||
r.log.Error("worktree_prune.rollback", "id", w.ID, "err", rbErr.Error())
|
||||
r.log.Error("worktree_prune.rollback", "worktree_id", w.ID, "err", rbErr.Error())
|
||||
}
|
||||
continue
|
||||
}
|
||||
if err := r.repo.FinishPruneSuccess(ctx, w.ID); err != nil {
|
||||
r.log.Error("worktree_prune.finish_success", "id", w.ID, "err", err.Error())
|
||||
r.log.Error("worktree_prune.finish_success", "worktree_id", w.ID, "err", err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user