Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

14 linesCodeBlameRaw
1-- ?2 the workspace, ?3 the start of `since` as `YYYY-MM-DDT00:00:00`.
2-- Pull requests opened or merged since then, newest first, one more than
3-- are returned so the caller knows when there were more. A pull
4-- request's milestone is its work item's, else its own when that is one
5-- of the workspace's (until the move to work items finishes, a pull
6-- request may still hold its repository's old number).
7SELECT pr.repo_id, pr.number, pr.title, pr.status, pr.agent, pr.owner_id, pr.owner_name,
8 pr.created_at, pr.merged_at, i.number AS item,
9 COALESCE(i.milestone,
10 (SELECT m.number FROM milestones m WHERE m.workspace = ?2 AND m.number = pr.milestone)) AS milestone
11FROM pr LEFT JOIN work_items i ON i.id = pr.item_id AND i.workspace = ?2
12WHERE pr.created_at >= ?3 OR (pr.status = 'merged' AND pr.merged_at >= ?3)
13ORDER BY pr.created_at DESC, pr.repo_id, pr.number DESC
14LIMIT 3001