Add Co-authored-by trailers to Merge's squash commit
This commit is contained in:
@@ -519,6 +519,30 @@ func (s *Store) closeTask(ctx context.Context, id string, status api.TaskStatus,
|
||||
return s.GetTask(ctx, id)
|
||||
}
|
||||
|
||||
func (s *Store) Participants(ctx context.Context, taskID string) ([]api.Participant, error) {
|
||||
rows, err := s.db.QueryContext(ctx, `
|
||||
SELECT u.login, u.display_name, u.git_name, u.git_email
|
||||
FROM events e JOIN users u ON u.login = e.actor
|
||||
WHERE e.task_id = ? AND e.kind = 'user.message'
|
||||
GROUP BY u.login ORDER BY min(e.seq)
|
||||
`, taskID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
participants := []api.Participant{}
|
||||
for rows.Next() {
|
||||
p := api.Participant{}
|
||||
err = rows.Scan(&p.Login, &p.DisplayName, &p.GitName, &p.GitEmail)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
participants = append(participants, p)
|
||||
}
|
||||
return participants, rows.Err()
|
||||
}
|
||||
|
||||
func (s *Store) EventsAfter(ctx context.Context, after int64, limit int) ([]api.Event, error) {
|
||||
rows, err := s.db.QueryContext(ctx, `
|
||||
SELECT seq, kind, project_id, task_id, agent_session_id, actor, payload, created_at
|
||||
|
||||
Reference in New Issue
Block a user