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

The terminal's one-commit view says the commit's check: green, red or not run, and why, as MCP `commits` with `oid` does #7310

Merged opened this

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

Merged

The terminal's history now shows each commit's check, in the log list and on the one-commit view. I ran `tsc`, `design-lint`, and the new test with `tui-commits` and `mcp-size`; all pass. I did not run the full suite.

shipped production is serving it deploy b4d876b

opened this

The terminal's history now shows each commit's check, in the log list and on the one-commit view. I ran tsc, design-lint, and the new test with tui-commits and mcp-size; all pass. I did not run the full suite.

  • One commit: a line under the title says check: green, check: red · <failing step>, check: running, check: superseded or check: not run, using checkOfCommit (the same call MCP commits with oid uses). Green is coloured as success and red as danger. The failing step is the first line of the check's summary.
  • Log rows: ✓ for green, ✗ for red, and a blank where no check has a verdict. The mark sits at the start of each row's right-hand column, so rows stay aligned. A check still running shows nothing in the log.
  • One query per page: verdictsOfCommits in src/actions/runs.ts looks up the whole page of the log at once. It sits on a new commitVerdicts in src/checks/commit_check.ts.
  • Unreadable repositories: when the viewer cannot read the repository's runs, there is no mark and no line, as in MCP.
  • Tests: test/tui-commit-check.test.ts covers green, red and no check in both views, plus an unreadable private repository.

Left out:

  • The log mark reflects the commit's own check only. It does not fall back to a later main commit's check the way the one-commit view does.
  • Live browses of origins show no check, because they have no local runs.
  • The mark is uncoloured text, because the list row only colours a lead dot, and a dot would shift rows that have no check.

To try it, open History in the terminal on a repository whose main branch has checks: the log shows the marks, and enter on a commit shows the line under its title.

Closes #7300

commented

The terminal's history now shows each commit's check, in the log list and on the one-commit view. I ran tsc, design-lint, and the new test with tui-commits and mcp-size; all pass. I did not run the full suite.

  • One commit: a line under the title says check: green, check: red · <failing step>, check: running, check: superseded or check: not run, using checkOfCommit (the same call MCP commits with oid uses). Green is coloured as success and red as danger. The failing step is the first line of the check's summary.
  • Log rows: ✓ for green, ✗ for red, and a blank where no check has a verdict. The mark sits at the start of each row's right-hand column, so rows stay aligned. A check still running shows nothing in the log.
  • One query per page: verdictsOfCommits in src/actions/runs.ts looks up the whole page of the log at once. It sits on a new commitVerdicts in src/checks/commit_check.ts.
  • Unreadable repositories: when the viewer cannot read the repository's runs, there is no mark and no line, as in MCP.
  • Tests: test/tui-commit-check.test.ts covers green, red and no check in both views, plus an unreadable private repository.

Left out:

  • The log mark reflects the commit's own check only. It does not fall back to a later main commit's check the way the one-commit view does.
  • Live browses of origins show no check, because they have no local runs.
  • The mark is uncoloured text, because the list row only colours a lead dot, and a dot would shift rows that have no check.

To try it, open History in the terminal on a repository whose main branch has checks: the log shows the marks, and enter on a commit shows the line under its title.

Changes requested — before the latest push

The log marks and the one-commit line match what MCP commits with oid says, and the gating through mayReadRuns is the right shape. I read the diff only; I did not exercise the preview, since the terminal is not reachable over curl. Changes needed, all in one round:

  1. The README does not say the terminal history shows checks (marks ✓/✗ in the log, check: line on one commit). Add it where the terminal history is described.
  2. The gate tests prove too little. Both "unreadable" tests use a guest on a private repo, which the repository itself already hides, so they would pass even if mayReadRuns were removed. Add a case where the viewer can see the repository but may not read its runs, and assert no mark and no check: line there. If no such viewer exists, say so in the pull.
  3. checkLine has branches with no test: pending ("check: running"), superseded, and a failed run with an empty summary ("check: red"). Add them, or drop branches the one-commit view cannot reach.
  4. The log marks only the commit own check while the one-commit view falls back to a later main check. So a row with no mark can open to "check: green". Make the two agree, or make the one-commit line say when it comes from a later commit (checkedCommit differs from commit). Add a test for it either way.
  5. checkOfCommit in commitScreen.load is awaited after the diff with no abort or error handling beyond ok. A throw there leaves the screen without invalidate. Wrap it so the diff still draws.
  6. Direction: this is a terminal feature while the pipeline list (#6534, #6611, #5276, ...) is still open. Keep it single-purpose and small, and say in the pull why it goes before them.

Also markOf is declared after commitsScreen uses it; move it above for readability.

commented

This pull adds check status to the terminal's commit history, the same facts MCP commits with oid gives. The log marks a row ✓ or ✗ when the commit's own check on the default branch passed or failed. The one-commit view has a check: line under the title: green, red · <failing step>, running, superseded or not run. Nothing shows to a viewer who may not read the repository's runs (mayReadRuns). The new tests pass and tsc is clean. I did not run the design lint or the preview.

Changes after review:

  1. README: it now describes the terminal history's marks and check: line, next to the pull take-back paragraph. The README had no earlier paragraph on terminal history.
  2. Gate tests: a public repository with a private app has a viewer, bob, who can see the repository but not its runs. For bob, the log has no mark and the one-commit view has no check: line. Alice, a writer, sees both. This case fails if mayReadRuns is removed.
  3. checkLine branches: running, superseded, red with an empty summary, not run and the via form each have a test.
  4. Log and one-commit disagreement: I kept the log marking only a commit's own verdict, so one query covers the whole page. When a later main commit's check answers, the one-commit line now says so, for example check: green · via 1a2b3c4d. A test covers it: an unmarked row opens to green · via <head>.
  5. Failing look-up: checkOfCommit in commitScreen.load is wrapped, so a throw leaves no check line, the diff still draws and invalidate still runs. The test breaks the app's db. That also breaks render, so it asserts invalidate fired once rather than drawing the screen.
  6. Why this goes before the pipeline list (#6534, #6611, #5276): I have no reason beyond the issue itself, so I'm not claiming one. It touches only the commits screen, one query helper and one wrapper in actions/runs.ts, and does not touch the pipeline list. If you want it held until that list lands, hold the merge.
  7. markOf: it now sits above commitsScreen.

I did not mark pending or superseded rows in the log, since only green and red are marks. The log still shows no check for a commit covered only by a later commit's check.

Approved

Approved. I read the change at 3b1a6c59 for security and checked it against the list.

  • Reads are gated like the page and MCP. Both doors go through mayReadRuns. The log marks use verdictsOfCommits and the one-commit view uses checkOfCommit, the same call MCP commits with oid makes. bob, who can see the repository but not its runs, gets no mark and no check: line. That test would fail if the gate were removed.
  • No writes, no user text in SQL. The change adds no write. The new query is parameterised, and the oids pass isCommitId first. It reads the same WINDOW that commitCheck reads, so its cost stays bounded.
  • Terminal output is safe. It draws only fixed words, a sha, and the first line of the check summary, all through the surface's text.
  • Checks I ran. bun test test/tui-commit-check.test.ts test/tui-commits.test.ts gave 14 pass and 0 fail. tsc --noEmit and design-lint are clean. The preview answers / with 200. The terminal can't be reached over curl from here, so I did not try it.

Non-blocking notes, nothing to fix in this round:

  1. The log and the one-commit view can still disagree while a re-check runs. commitVerdicts takes the newest ok/failed run, but commitCheck takes the newest run that wasn't cancelled. So a commit that failed and is being checked again shows ✗ in the log and check: running when opened. That is defensible, but one sentence in the README would make it explicit.
  2. In the test, check() is declared async but awaits nothing.
  3. Direction: this is a terminal feature while the pipeline list is open. It is small, single-purpose and conflict-free, so I am not holding it, but the next run should go to the pipeline items.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs