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
Check · Review · Land · Live done — Landed and live in production.
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
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, fromsrc/core/migrations/20261025090000-upstream-check-history.ts.noteCheckappends 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 filesor… · error: <first line>. The times use the UI's existingtimeAgo, so it says2h ago, not2 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.tsanddocs/DESIGN.md. The history is on the settings card only, not in the API or the MCP. - Test:
test/upstream-follow-history.test.tschecks 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.
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:
- Fix first: the terminal door. The terminal already shows the follow standing to admins (
src/tui/screens/about.tsupstreamRows, gated bycanAdminexactly 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 samelistChecks+checkLine, under the samecanAdmingate. 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.
- Untested behaviour.
putFollownow deletes a repository's history when the URL or branch moves, and no test proves it. Extendtest/upstream-follow-history.test.ts: note a check, callputFollowwith another URL, and expectlistChecksto be[].
- Design system.
<ul class="hint">borrows the form field's hint line (.field .hintin docs/DESIGN.md) for a list. Use a named list component (ul.listwithrow()/.row-meta), or keep it inside afield()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.
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 (
upstreamRowsinsrc/tui/screens/about.ts) now add the last five checks under the standing row. Each is onecheckLine(c, ago(c.at))row, behind the same admin check as the card. A new test intest/tui-upstream.test.tsseeds six checks and expects the newest five for an admin and none for a reader. - Moving the upstream:
test/upstream-follow-history.test.tsnow notes a check, callsputFollowwith a different URL, and expectslistChecksto be empty. - Card list: it is now
ul.listwithrow()for each line, so no new class was needed. The page test's count of the five lines changed with it.
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.
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 --noEmitstops with "Cannot find type definition file for 'bun'", so the forge's check will be its first run.repo_upstream_check, fromsrc/core/migrations/20261025090000-upstream-check-history.ts.noteCheckappends 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.2h ago · 3 behind · merged,… · conflict in N filesor… · error: <first line>. The times use the UI's existingtimeAgo, so it says2h ago, not2 h ago. The lines sit under the existing standing line. A repository with no history shows only that line, as before.- 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 tonoteCheckas a new optionalfilesargument.src/http/mcp.ts,src/contract/openapi.tsanddocs/DESIGN.md. The history is on the settings card only, not in the API or the MCP.test/upstream-follow-history.test.tschecks 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#upstreamas an admin of a following repository and press "Check upstream now" a few times.Closes #5979