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

A preview that does not start shows its last start lines and the cause on the pull page #17904

opened this

Merged 21h 44m ago, live in production

A pull whose preview stopped before answering now shows why under its checks line, and the last 20 lines of its start in a fold. I did not find the cause for trevato.dev, since my shell can only reach this app and its previews. Once this is live, its pull page should show the cause.

Notes

opened this

A pull whose preview stopped before answering now shows why under its checks line, and the last 20 lines of its start in a fold. I did not find the cause for trevato.dev, since my shell can only reach this app and its previews. Once this is live, its pull page should show the cause.

  • Cause words: the sentence comes from servingWords, the one source the proxy page and the preview tool use. It already carries run_command.ts's hint (for example "not installed or not on PATH"), so the pull page cannot say something different.
  • Lines: read from the failed deploy run's log, which is redacted as written and again as read. The page renders them escaped, with a link to the whole log. The fold is hidden when there are no lines.
  • Where it shows: only on open pulls whose preview is failed. A running, starting or never-deployed preview shows nothing.
  • Terminal: the pull screen's checks line gets the cause and the last three lines.
  • Code:
    • src/apps/start_output.ts (new) reads the status and the log.
    • src/web/pages/pull-start.ts (new) renders the strip.
    • Both are wired into src/web/pages/pull.ts and src/tui/screens/pull.ts.
  • How-to: docs/features/preview-start-failure.md.
  • Tests: test/preview-start-output.test.ts starts real fixtures with startProcess.
    • A fixture that exits at once shows its lines and the cause. An env value it echoes is not shown.
    • A fixture that never listens shows the timeout words.
    • A hostile line is escaped and only the last 20 lines are kept.
    • Running, unknown and missing previews show nothing.
  • Checks run: tsc is clean, the gate reports 32 of 32 rules satisfied, and design-lint is clean. The new tests and the pull, TUI and hollow/doorless suites I ran pass. scripts/fast.ts named 3,032 files, so I ran no broader suite and left it to the forge's check.
  • Left out: the lines are the tail of the whole deploy log, not only the process's own output. A start that fails after a long install shows the last 20 lines of the run, ending with the failed: line. I added no new data to the environment state to separate them.
  • Reused: servingWords and readRunLog, plus the existing disclosure component.
[
 {"go": "/<owner>/<app>/pulls/<n> for an open pull whose preview failed to start", "look": "under the checks line", "expect": "'The preview did not start: <cause>' and a fold 'Last N lines of its start' with the escaped lines and a 'Whole log' link", "ask": "Is the cause the same sentence the app page shows?"},
 {"go": "a pull whose preview is running", "look": "under the checks line", "expect": "no start strip"}
]

Closes #17892

Show 7 earlier items

7 earlier comments
commented

I changed nothing this round, so there is nothing new to push. This is the same comment as last time, now for head c8fe7a0, and nothing in it applies to this pull.

  • Look pages: the gate resolves / from a commit on this branch, so there is no failure.
  • Both doors: the terminal pull screen (src/tui/screens/pull.ts) shows the same cause and last start lines as the web page. The pull has a No door: line explaining that this extends the existing screen rather than adding a new one.
  • Test input: test/preview-start-output.test.ts has no as never, and tsc was clean on the previous head.
  • Issue number: the Direction: commit carries (#17892).
  • Dead code: test/unused-exports.test.ts passes.
  • Gate and tests: bun scripts/gate.ts reports no failures at c8fe7a0. test/preview-start-output.test.ts and test/unused-exports.test.ts pass, 8 tests in all. I did not rerun tsc at c8fe7a0.

The branch is level with origin.

commented

The red on c8fe7a0 (run 01m8ydb48z6kb71025w5qe5v4r) is not the look-pages note: 4 of 2193 failed in the feature-note index tests ("a note naming an unknown topic is not listed, and the tree has none", "every note says its topic and its row, and the topic is a heading of the index", "no feature note is an orphan"; test/feature-orphans.test.ts).

Cause: docs/features/preview-start-failure.md says topic: Pulls and previews, which is not one of the ### headings in docs/features/README.md, so the note is listed nowhere. Fix, one line in its front matter:

topic: When something is wrong

(or Ship and undo if you'd rather file it with pulls; both are real headings). Don't add a new heading for one note. Then push; nothing else in the run's failures points at your code.

commented

The feature-note index failures should be fixed. I changed topic: Pulls and previews to topic: When something is wrong in docs/features/preview-start-failure.md, as you suggested, and pushed.

test/feature-orphans.test.ts and test/feature-doors.test.ts now pass (11 tests), and bun scripts/gate.ts reports no failures. I did not rerun the rest of the suite; the forge's check does that on this push.

The four generic refusal items in the comment were already met. The terminal pull screen shows what the page shows, the test builds real input, Direction: carries (#17892), and the dead-code test passes.

[{"go":"/pulls/17904","look":"a pull whose preview failed to start, under its checks line","expect":"the cause and last start lines appear, escaped, and the terminal pull screen shows the same"}]
commented

<!-- look-pages e1547613bf7a --> Look pages for e154761, from the gate:

  • look pages (named): this pull changes src/web/pages/pull-start.ts, src/web/pages/pull.ts; a commit names /
commented

I changed nothing this round and pushed nothing; the branch is level with origin at e1547613b. The comment repeats the earlier notes for this head, and the gate reports no failures.

  • Look pages: this is information, not a failure. A commit on the branch names /.
  • Both doors: the terminal pull screen shows the same cause and last start lines as the web page.
  • Test input: test/preview-start-output.test.ts has no as never.
  • Issue number: the Direction: commit carries (#17892).
  • Dead code: test/unused-exports.test.ts passed earlier on this branch.
  • Feature-note failures: the topic fix I pushed last round, e1547613b, is what addressed them.
commented

<!-- look-pages 2811eb098c2b --> Look pages for 2811eb0, from the gate:

  • look pages (named): this pull changes src/web/pages/pull-start.ts, src/web/pages/pull.ts; a commit names /
commented

<!-- look-pages a9c121944a85 --> Look pages for a9c1219, from the gate:

  • look pages (named): this pull changes src/web/pages/pull-start.ts, src/web/pages/pull.ts; a commit names /
commented

This is the gate's look-pages note for a9c1219, and it needs no action. A commit on this branch already names /, so the gate has no failure, and I pushed nothing new.

Everything from the last round is already on the branch at a9c1219.

  • New tests: test/preview-start-wiring.test.ts renders the pull page and the terminal's pull screen with a failed and a running preview, four tests in all.
  • Exact assertion: the timeout test in test/preview-start-output.test.ts now asserts the exact servingWords sentence.
  • Terminal line: a failed start is its own segment in the terminal's checks line, no longer part of the red-main note.

The gate reported no failures at that head.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs