Share snapshot classification across review and readiness queries
This commit is contained in:
@@ -33,8 +33,7 @@ func (s *Store) SettleMergeFacts(ctx context.Context, taskID string, g GitFacts)
|
||||
}
|
||||
|
||||
f := api.MergeFacts{UnmergedCommits: g.UnmergedCommits, UnmergedFiles: g.UnmergedFiles, UnreviewedChanges: g.UnreviewedChanges}
|
||||
err = tx.QueryRowContext(ctx, `SELECT coalesce(max(n), 0) FROM snapshots WHERE task_id = ? AND trigger NOT IN (?, ?, ?)`,
|
||||
taskID, string(api.SnapshotTriggerAnswer), string(api.SnapshotTriggerFork), string(api.SnapshotTriggerAskHuman)).Scan(&f.ReviewSnapshot)
|
||||
err = tx.QueryRowContext(ctx, `SELECT coalesce(max(n), 0) FROM snapshots WHERE task_id = ? AND trigger NOT IN `+cutPointTriggers, taskID).Scan(&f.ReviewSnapshot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user