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
..
2026-03-04 21:52:22 +04:00
2025-05-13 11:24:51 -05:00
2025-06-20 13:16:55 -06:00
2026-03-10 18:46:01 +00:00
2026-02-24 20:28:50 +02:00
2026-03-13 19:49:34 +01:00
2026-01-08 15:24:11 +04:00
2026-02-17 15:43:02 +01:00
2025-10-23 20:22:51 +03:00
2026-03-03 16:34:33 +03:00
2025-10-09 14:53:08 +02:00
2025-10-09 14:53:08 +02:00
2026-02-27 16:50:56 +00:00
2026-02-24 15:27:03 +00:00
2025-10-15 16:13:59 +00:00
2024-07-29 19:58:48 -05:00
2026-03-13 18:30:49 +01:00
2026-03-13 18:54:07 -04:00
2025-06-24 13:06:02 +02:00
2026-01-08 15:24:11 +04:00
2026-03-04 21:57:23 -05:00
2025-09-15 12:30:17 +10:00
2025-07-30 13:42:39 -07:00
2024-11-15 12:05:21 -06:00
2025-08-29 10:41:32 +02:00
2025-04-15 10:55:30 +02:00
2026-03-13 14:09:39 +00:00
2025-06-20 13:16:55 -06:00
2026-02-20 09:01:00 -06:00
2026-03-13 16:15:33 +02:00
2025-12-15 17:41:47 +00:00
2024-01-31 14:49:55 +01:00
2025-02-18 13:06:19 +01:00
2025-07-07 11:01:17 -06:00
2025-01-31 12:14:24 -07:00
2025-03-31 09:40:24 -03:00
2025-08-19 10:41:33 +02:00
2026-03-04 12:54:39 +02:00
2026-02-20 12:56:00 +11:00
2025-06-20 13:16:55 -06:00
2026-01-09 15:40:26 -07:00
2026-03-06 10:48:58 +00:00
2026-01-15 12:41:28 +03:00
2026-02-23 12:18:44 +01:00
2025-10-06 13:58:37 +02:00
2025-06-20 13:16:55 -06:00
2023-01-13 12:27:21 +01:00
2026-02-03 14:10:49 -06:00
2025-07-02 15:05:42 +00:00
2025-07-28 15:02:26 +01:00
2026-03-02 19:32:36 +11:00
2026-02-27 16:50:56 +00:00
2025-02-27 06:23:18 -05:00
2023-01-29 15:47:24 -06:00
2025-05-29 08:55:19 -05:00
2025-06-20 13:16:55 -06:00
2026-02-03 14:10:49 -06:00
2025-10-27 17:14:16 -06:00
2025-09-26 11:43:32 +02:00
2024-02-14 17:14:49 +00:00
2026-02-13 19:44:50 -05:00
2024-07-24 14:11:29 +10:00
2026-01-08 15:24:11 +04:00
2025-08-19 10:41:33 +02:00
2025-06-20 13:16:55 -06:00
2022-08-25 19:10:42 +03:00
2023-01-29 15:47:24 -06:00
2024-09-10 20:55:50 +10:00
2026-03-11 10:19:08 -07:00
2024-12-19 00:51:30 +04:00
2024-12-19 00:51:30 +04:00
2025-06-16 16:15:59 -06:00
2026-02-06 15:52:54 +00:00
2026-03-06 10:47:55 +01:00
2025-09-10 11:01:54 -05:00
2026-02-17 15:11:04 +00:00
2025-06-20 13:16:55 -06:00
2022-11-08 17:12:06 +00:00
2026-01-08 15:24:11 +04:00
2026-02-19 13:04:53 -05:00
2026-03-04 11:14:52 -07:00