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-01-20 17:25:31 +00:00
2026-03-13 16:47:36 +00:00
2026-03-13 18:30:49 +01:00
2026-03-04 17:47:34 +00:00
2026-03-11 10:19:08 -07:00
2026-03-13 18:30:49 +01:00
2026-03-13 18:30:49 +01:00
2026-01-21 11:27:01 +11:00
2026-01-08 15:24:11 +04:00
2026-01-08 15:24:11 +04:00
2026-03-05 11:58:10 +00:00
2026-02-23 22:46:17 -06:00
2026-03-13 18:54:07 -04:00
2026-03-03 10:19:00 -05:00
2026-03-13 18:54:07 -04:00
2026-02-03 17:52:07 +00:00
2026-03-11 10:19:08 -07:00
2025-06-20 17:36:32 +01:00
2025-10-23 14:24:54 +02:00
2026-02-12 09:06:33 +00:00
2026-03-13 18:54:07 -04:00
2025-08-07 11:00:31 +10:00
2026-03-06 21:05:26 +02:00
2026-03-05 22:32:18 +02:00
2026-02-06 09:52:17 -07:00
2025-12-09 08:13:09 -08:00
2026-03-11 10:19:08 -07:00
2025-11-25 11:13:32 +00:00
2026-03-12 21:32:57 +00:00
2026-03-13 18:54:07 -04:00
2025-05-22 19:48:23 +10:00
2025-07-09 09:46:31 +02:00
2025-03-26 01:56:39 -05:00
2026-03-13 16:47:36 +00:00
2026-03-13 18:30:49 +01:00
2026-03-13 18:54:07 -04:00
2026-03-13 18:30:49 +01:00
2025-12-15 08:42:08 -08:00
2026-03-11 10:19:08 -07:00