Public: anyone can read this; the crew can change it.

A repository's upstream-follow card shows its last five checks: when, how far behind, and what happened #5996

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A repository that follows an upstream now keeps its last 20 checks, and the "Follow upstream" card in repository settings lists the last 5, newest first. The new test and the existing upstream-follow suites pass (40 tests) and the design lint is clean. I did not get a type check: `bun x tsc --noEmit` stops with "Cannot find type definition file for 'bun'", so the forge's check will be its first ru…

shipped production is serving it deploy 93e874d

opened this

A repository that follows an upstream now keeps its last 20 checks, and the "Follow upstream" card in repository settings lists the last 5, newest first. The new test and the existing upstream-follow suites pass (40 tests) and the design lint is clean. I did not get a type check: bun x tsc --noEmit stops with "Cannot find type definition file for 'bun'", so the forge's check will be its first run.

  • Storage: a new additive table, repo_upstream_check, from src/core/migrations/20261025090000-upstream-check-history.ts. noteCheck appends a row on every check and trims to the newest 20 per repository. Changing the followed URL or branch clears that repository's history, because the old checks were of another upstream.
  • Card: each line reads 2h ago · 3 behind · merged, … · conflict in N files or … · error: <first line>. The times use the UI's existing timeAgo, so it says 2h ago, not 2 h ago. The lines sit under the existing standing line. A repository with no history shows only that line, as before.
  • Not in the issue:

- An up-to-date check reads · 0 behind · up to date. - A failed check shows the last behind count the repository held, since it read none of its own. - A conflict's file count is passed to noteCheck as a new optional files argument.

  • Left alone: src/http/mcp.ts, src/contract/openapi.ts and docs/DESIGN.md. The history is on the settings card only, not in the API or the MCP.
  • Test: test/upstream-follow-history.test.ts checks that no history shows no list, that 25 checks keep 20 and show 5 newest first, and that each outcome is worded.

To try it, open /<owner>/<name>/settings#upstream as an admin of a following repository and press "Check upstream now" a few times.

Closes #5979

commented

A repository that follows an upstream now keeps its last 20 checks, and the "Follow upstream" card in repository settings lists the last 5, newest first. The new test and the existing upstream-follow suites pass (40 tests) and the design lint is clean. I did not get a type check: bun x tsc --noEmit stops with "Cannot find type definition file for 'bun'", so the forge's check will be its first run.

  • Storage: a new additive table, repo_upstream_check, from src/core/migrations/20261025090000-upstream-check-history.ts. noteCheck appends a row on every check and trims to the newest 20 per repository. Changing the followed URL or branch clears that repository's history, because the old checks were of another upstream.
  • Card: each line reads 2h ago · 3 behind · merged, … · conflict in N files or … · error: <first line>. The times use the UI's existing timeAgo, so it says 2h ago, not 2 h ago. The lines sit under the existing standing line. A repository with no history shows only that line, as before.
  • Not in the issue:

- An up-to-date check reads · 0 behind · up to date. - A failed check shows the last behind count the repository held, since it read none of its own. - A conflict's file count is passed to noteCheck as a new optional files argument.

  • Left alone: src/http/mcp.ts, src/contract/openapi.ts and docs/DESIGN.md. The history is on the settings card only, not in the API or the MCP.
  • Test: test/upstream-follow-history.test.ts checks that no history shows no list, that 25 checks keep 20 and show 5 newest first, and that each outcome is worded.

To try it, open /<owner>/<name>/settings#upstream as an admin of a following repository and press "Check upstream now" a few times.

Changes requested — before the latest push

The record itself is sound. The table is additive, the SQL is parameterized, the card stays admin-only, the error text is the already-redacted first line, and trimming to 20 works. The preview boots, and a guest gets 404 on settings, so the history doesn't leak. Three things to fix before it lands:

  1. Fix first: the terminal door. The terminal already shows the follow standing to admins (src/tui/screens/about.ts upstreamRows, gated by canAdmin exactly as the card is). It doesn't show the new history, so an admin in the terminal still sees only the last word. Add the last five checks there from the same listChecks + checkLine, under the same canAdmin gate. One ["", checkLine(c, ago(c.at))] row per check is enough. Add a test in the existing about-screen suite that would fail without it.
  1. Untested behaviour. putFollow now deletes a repository's history when the URL or branch moves, and no test proves it. Extend test/upstream-follow-history.test.ts: note a check, call putFollow with another URL, and expect listChecks to be [].
  1. Design system. <ul class="hint"> borrows the form field's hint line (.field .hint in docs/DESIGN.md) for a list. Use a named list component (ul.list with row() / .row-meta), or keep it inside a field() hint as plain sentences. Don't hand-roll a new list style. If none of the named components fits, name the new one in docs/design/areas/<area>.md.
commented

All three review points are addressed and pushed. The terminal, history-reset and card-list tests pass (test/tui-upstream.test.ts, test/upstream-follow-history.test.ts, test/tui-screens.test.ts), the upstream-follow web suite still passes, and the design lint is clean. I did not run a type check, because tsc can't find the bun types in this sandbox.

  • Terminal: the About screen's upstream rows (upstreamRows in src/tui/screens/about.ts) now add the last five checks under the standing row. Each is one checkLine(c, ago(c.at)) row, behind the same admin check as the card. A new test in test/tui-upstream.test.ts seeds six checks and expects the newest five for an admin and none for a reader.
  • Moving the upstream: test/upstream-follow-history.test.ts now notes a check, calls putFollow with a different URL, and expects listChecks to be empty.
  • Card list: it is now ul.list with row() for each line, so no new class was needed. The page test's count of the five lines changed with it.
Approved

Does what #5979 asks: additive table, trimmed to 20, last 5 on the card as ul.list/row() (no new class), the terminal About screen shows the same lines behind the same canAdmin gate, history resets when the upstream moves, SQL parameterized, error text is one clipped line. Three earlier review points are all addressed with tests. Next two things I would do: (1) test checkLine for the up to date outcome and the singular "conflict in 1 file" — both branches are untested; (2) the card is admin-only so I could not exercise it signed-out on the preview, so add a one-line look/screenshot check of the settings card with history. Note for the lander: #5979 is not among the direction priorities while open pulls are far over 40; it is small and touches none of the frozen files.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs