Happy review
This commit is contained in:
@@ -142,6 +142,18 @@ func (m *Manager) startReviewer(ctx context.Context, task api.Task, snap api.Sna
|
||||
return err
|
||||
}
|
||||
if prompt == "" {
|
||||
now := time.Now().UTC()
|
||||
err = m.store.CreateReview(ctx, api.Review{
|
||||
Id: store.NewID(),
|
||||
TaskId: task.Id,
|
||||
SnapshotN: snap.N,
|
||||
State: api.ReviewStateSkipped,
|
||||
CreatedAt: now,
|
||||
FinishedAt: &now,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
slog.Info("review skipped, snapshot has no diff", "task", task.Id, "snapshot", snap.N)
|
||||
return nil
|
||||
}
|
||||
@@ -494,6 +506,9 @@ func reviewLine(r api.Review) string {
|
||||
if r.State == api.ReviewStateFailed {
|
||||
return fmt.Sprintf("review of snapshot %d failed: %s", r.SnapshotN, clip(r.Error, 300))
|
||||
}
|
||||
if r.State == api.ReviewStateSkipped {
|
||||
return fmt.Sprintf("review of snapshot %d skipped: no changes", r.SnapshotN)
|
||||
}
|
||||
res := map[string]any{}
|
||||
if r.Result != nil {
|
||||
res = *r.Result
|
||||
|
||||
Reference in New Issue
Block a user