Show open pull requests in the Review stage #13

Merged
arne merged 11 commits from feat/pr-tracking into main 2026-04-05 20:24:08 +02:00
Owner

The Review stage on every project page has been empty since #5 because
orbit had no concept of pull requests. This PR adds the full tracking
stack: a new pull_requests table mirroring the issue table's shape,
webhook updates on every PR lifecycle event (opened, edited, closed,
reopened), periodic sync as a safety net for dropped webhook deliveries,
and handler logic that populates the Review stage with open non-draft
PRs sorted by activity. Draft PRs are tracked but hidden — they become
visible the moment the draft flag flips.

PR activity also factors into the home page's project-row dot state: a
project with a recent PR but no other movement now glows sodium instead
of sitting quiet.

Claude removal

The claude package is gone entirely. Its only job was summarizing PR
diffs into history entry text on merge, but the summaries were verbose
and often read worse than the PR title they replaced. The merge handler
now stores pr.Title verbatim as the history entry's summary. The trade
is automation for discipline: write good PR titles and descriptions, and
the History stage reads well for free.

Full audit: claude/ package deleted, import chain cleaned through
main.go, api/api.go, api/webhooks.go, and config.go,
ORBIT_CLAUDE_API_KEY env variable retired, forgejo.GetPullRequestDiff
(orphaned after the removal) also deleted. The historySummary helper
in the web layer used to prepend PR #N: to entries with a PR number
attached; that prefix is gone too, matching the new "lean on the PR
title" posture.

Scope expansion: sync tests

sync.go was untested before this PR. Adding the new PR sync was an
opportunity to lock in the existing issue sync's behavior with tests, so
sync_test.go covers both paths — 4 issue sync cases and 4 PR sync
cases. Any future regression in the shared sync infrastructure will now
be caught by the suite.

Follow-ups

  • Expand-on-click UI for PR bodies — the body field is stored, the UI
    is a separate spec.
  • Deleted-on-Forgejo PR reconciliation — rare edge case, manual cleanup
    for now.
  • Review metadata (approved / changes-requested badges) if they prove
    useful.
  • Stacked PR / branch graph visualization using base_ref and head_ref
    fields.

Closes arne/orbit#7.

The Review stage on every project page has been empty since #5 because orbit had no concept of pull requests. This PR adds the full tracking stack: a new `pull_requests` table mirroring the issue table's shape, webhook updates on every PR lifecycle event (opened, edited, closed, reopened), periodic sync as a safety net for dropped webhook deliveries, and handler logic that populates the Review stage with open non-draft PRs sorted by activity. Draft PRs are tracked but hidden — they become visible the moment the draft flag flips. PR activity also factors into the home page's project-row dot state: a project with a recent PR but no other movement now glows sodium instead of sitting quiet. ## Claude removal The `claude` package is gone entirely. Its only job was summarizing PR diffs into history entry text on merge, but the summaries were verbose and often read worse than the PR title they replaced. The merge handler now stores `pr.Title` verbatim as the history entry's summary. The trade is automation for discipline: write good PR titles and descriptions, and the History stage reads well for free. Full audit: `claude/` package deleted, import chain cleaned through `main.go`, `api/api.go`, `api/webhooks.go`, and `config.go`, `ORBIT_CLAUDE_API_KEY` env variable retired, `forgejo.GetPullRequestDiff` (orphaned after the removal) also deleted. The `historySummary` helper in the web layer used to prepend `PR #N:` to entries with a PR number attached; that prefix is gone too, matching the new "lean on the PR title" posture. ## Scope expansion: sync tests `sync.go` was untested before this PR. Adding the new PR sync was an opportunity to lock in the existing issue sync's behavior with tests, so `sync_test.go` covers both paths — 4 issue sync cases and 4 PR sync cases. Any future regression in the shared sync infrastructure will now be caught by the suite. ## Follow-ups - Expand-on-click UI for PR bodies — the body field is stored, the UI is a separate spec. - Deleted-on-Forgejo PR reconciliation — rare edge case, manual cleanup for now. - Review metadata (approved / changes-requested badges) if they prove useful. - Stacked PR / branch graph visualization using `base_ref` and `head_ref` fields. Closes arne/orbit#7.
arne added 10 commits 2026-04-05 19:28:27 +02:00
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the pull_requests schema table (alongside projects/ideas/issues/
history_entries in the migrate block), the PullRequest Go type, and
three Store methods: UpsertPullRequest, ListPullRequests, and
ListOpenPullRequests. Includes 7 table-driven tests covering insert,
update, draft flag, nullable merged_at round-trip, open/draft filtering,
ordering, and empty-project behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Expand PullRequest from 4 fields to 12 (state, draft, merged_at,
updated_at, html_url, user, head, base). Add PRUser and PRRef nested
types. Add ListRepoPullRequests paginating with state=all&limit=50,
matching the ListRepoIssues pattern. Four new tests cover happy path,
empty repo, 404, and multi-page pagination.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add prs []store.PullRequest as the 4th parameter to projectLastActivity,
between issues and history. The body loops over ForgejoUpdatedAt for each
PR. Existing tests are migrated to a table-driven structure and two new
subtests are added: "pr beats others" and "history beats pr". Both
web.go call sites receive a nil placeholder; Task 7 will replace them
with real PR data fetched from the store.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The historySummary helper previously prepended 'PR #N:' to any history
entry with a PR number attached, producing titles like 'PR #11: feat:
ship the thing'. With the Claude summarization path removed in this PR,
the summary field already holds the raw PR title verbatim. The prefix
is redundant noise in the History stage timeline — the PR number is
still on the record if a future UI wants to render it separately.
arne force-pushed feat/pr-tracking from b58afe3654 to dd0f77c383 2026-04-05 19:46:53 +02:00 Compare
arne merged commit cf3098be35 into main 2026-04-05 20:24:08 +02:00
arne changed title from feat: pull request tracking and Claude removal to Show open pull requests in the Review stage 2026-04-05 22:08:50 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
arne/orbit!13
No description provided.