Kyle Carberry
c5b8611c5a
feat(gitsync): enrich PR status with author, base branch, review info (#23038)
## Summary
Adds 7 new fields to the PR status stored by gitsync, all sourced from
the existing GitHub API calls (**zero additional HTTP requests**):
| Field | Source | Purpose |
|---|---|---|
| `author_login` | `pull.user.login` | PR author username |
| `author_avatar_url` | `pull.user.avatar_url` | PR author avatar for UI
|
| `base_branch` | `pull.base.ref` | Target branch (e.g. `main`) |
| `pr_number` | `pull.number` | Explicit PR number |
| `commits` | `pull.commits` | Number of commits in PR |
| `approved` | Derived from reviews | True when ≥1 approved, no
outstanding changes requested |
| `reviewer_count` | Derived from reviews | Distinct reviewers with a
decisive state |
## Changes
- **`gitprovider/gitprovider.go`**: Added 7 fields to `PRStatus` struct.
- **`gitprovider/github.go`**: Expanded the anonymous struct in
`FetchPullRequestStatus` to decode new JSON fields. Replaced
`hasOutstandingChangesRequested()` with `summarizeReviews()` returning a
`reviewStats` struct with `changesRequested`, `approved`, and
`reviewerCount`.
- **Migration 000434**: Adds 7 columns to `chat_diff_statuses`.
- **`queries/chats.sql`**: Updated `UpsertChatDiffStatus`
INSERT/VALUES/ON CONFLICT.
- **`gitsync/gitsync.go`**: Maps new `PRStatus` fields into upsert
params.
- **`gitsync/worker.go`**: Maps new columns in row-to-model converter.
- **`codersdk/chats.go`**: Added fields to SDK `ChatDiffStatus` type.
- **`coderd/chats.go`**: Maps new DB fields in
`convertChatDiffStatus()`.
- Auto-generated: `models.go`, `queries.sql.go`, `dump.sql`,
`typesGenerated.ts`.
2026-03-13 18:54:07 -04:00
..
2025-08-20 12:19:14 +01:00
2026-03-06 14:43:53 +02:00
2026-02-24 15:27:03 +00:00
2025-12-02 16:50:09 +02:00
2026-02-06 09:52:17 -07:00
2026-03-06 21:05:26 +02:00
2026-03-12 21:32:57 +00:00
2026-02-27 16:50:56 +00:00
2026-03-13 18:54:07 -04:00
2025-12-02 14:17:52 +00:00
2024-09-26 21:01:49 +01:00
2023-09-15 15:09:40 +01:00
2026-03-10 13:52:55 -04:00
2026-03-12 21:32:57 +00:00
2026-03-12 21:32:57 +00:00
2026-03-12 21:32:57 +00:00
2025-08-07 10:14:58 -06:00
2026-03-04 12:54:39 +02:00
2025-08-30 03:39:37 +10:00
2023-06-25 13:17:00 +00:00
2025-03-27 10:03:53 +00:00
2025-03-20 13:41:54 +01:00
2026-03-12 21:32:57 +00:00
2025-09-30 23:54:21 +01:00
2026-01-14 09:47:50 -08:00
2023-06-02 11:16:46 +02:00
2025-11-20 17:12:25 +01:00
2025-11-20 17:12:25 +01:00
2025-10-07 13:10:38 +00:00
2025-10-07 13:10:38 +00:00
2026-03-12 21:32:57 +00:00
2025-10-07 13:10:38 +00:00
2023-11-21 11:21:25 +00:00
2024-11-05 08:12:56 -06:00
2022-04-01 15:45:23 -05:00
2023-07-27 02:21:04 +10:00
2026-01-12 18:19:19 -08:00
2026-03-12 21:32:57 +00:00
2026-01-26 14:27:17 +04:00
2026-02-24 17:04:42 +00:00
2025-01-31 13:55:46 +01:00
2025-10-28 03:16:41 +11:00
2026-02-05 14:38:55 -06:00
2025-05-29 08:55:19 -05:00
2026-03-12 21:32:57 +00:00
2025-05-14 12:21:36 -05:00
2025-12-12 11:41:46 +00:00
2024-05-20 13:30:19 +00:00
2025-10-07 13:10:38 +00:00
2025-08-30 03:39:37 +10:00
2026-03-12 21:32:57 +00:00
2025-08-07 15:58:59 -04:00
2026-03-11 10:19:08 -07:00
2026-01-30 17:19:19 +00:00
2024-03-06 09:23:57 -05:00
2025-03-03 18:41:01 +01:00
2026-02-19 16:56:29 +00:00
2026-03-12 21:32:57 +00:00
2025-03-20 14:10:45 +00:00
2026-02-24 17:04:42 +00:00
2023-08-16 15:22:00 +03:00
2026-03-12 21:32:57 +00:00
2026-03-10 12:17:32 -05:00
2024-11-16 21:56:19 +01:00
2024-11-16 21:56:19 +01:00
2026-02-27 16:50:56 +00:00
2024-09-24 10:51:49 +01:00