Skip reviews of snapshots with no diff
This commit is contained in:
@@ -108,6 +108,10 @@ func (m *Manager) startReviewer(ctx context.Context, task api.Task, snap api.Sna
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if prompt == "" {
|
||||
slog.Info("review skipped, snapshot has no diff", "task", task.Id, "snapshot", snap.N)
|
||||
return nil
|
||||
}
|
||||
|
||||
reviewID := store.NewID()
|
||||
dir := m.reviewDir(project.Id, reviewID)
|
||||
@@ -177,6 +181,9 @@ func (m *Manager) reviewPrompt(ctx context.Context, task api.Task, project api.P
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(changes.Files) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
whole, err := git.Compare(project.RepoPath, project.DefaultBranch, snap.CommitSha, snap.TreeSha, "")
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user