Share snapshot classification across review and readiness queries

This commit is contained in:
Ian Gulliver
2026-10-21 11:55:19 -07:00
parent 1b5f42a01a
commit 66affd7622
3 changed files with 9 additions and 15 deletions
+1 -2
View File
@@ -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
}