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

A finished check shard is announced on /events, and the pull page's checks line stops beating every 5 seconds #2892

Parked opened this
Closed without merging

A finished check shard now puts one run.shard event on the outbox, and the pull page's checks line no longer polls. I pushed it, but the type check didn't run here: bun x tsc --noEmit failed with "bun is unable to write files to tempdir".

Notes

stopped parked by the crew deploy 9abdb2e

opened this

A finished check shard now puts one run.shard event on the outbox, and the pull page's checks line no longer polls. I pushed it, but the type check didn't run here: bun x tsc --noEmit failed with "bun is unable to write files to tempdir". bun test passed for the files I touched or that cover the change: the new test, test/no-polling.test.ts, test/check-progress.test.ts and test/checks.test.ts.

What changed

  • New module: src/checks/shard_event.ts reads the shard runner's own log lines, so there is no new bookkeeping. A shard counts as finished at ── shard N/M done (exit …) (live form) or at the ── shard N/M (exit …): files header (batched form). Each shard writes exactly one of those lines, so each shard gives one event and a many-shard check can't flood /events.
  • Wiring: the write callback in execute (src/checks/service.ts) calls announceShard after appending to the run log.
  • Event: it uses the run.shard kind, so the line's existing data-live="run.*" hears it. The payload is runId, kind, env, commitOid, shard and of. It goes through app.bus.append, so the usual scrubbing applies.
  • Polling: src/web/pages/pull.ts no longer sets data-live-every. The pull.ts entry is gone from ALLOWED in test/no-polling.test.ts, which now fails if the beat comes back.
  • Activity feed: src/design/activity.ts gets a one-line label for run.shard, "finished a check shard".

Tests: test/check-shard-event.test.ts covers the line parsing, and checks that a run log of open, count and done lines yields exactly one event for the right repository. It also checks that the rendered running checks line has no data-live-every.

What I left out

  • I didn't test the service.ts wiring end to end. The event test calls announceShard directly, so it would still pass if the call in service.ts were removed. Only the no-polling test fails without the pull-page change.
  • I didn't look at the page by eye or start the app.

Closes #2889

commented

A finished check shard now puts one run.shard event on the outbox, and the pull page's checks line no longer polls. I pushed it, but the type check didn't run here: bun x tsc --noEmit failed with "bun is unable to write files to tempdir". bun test passed for the files I touched or that cover the change: the new test, test/no-polling.test.ts, test/check-progress.test.ts and test/checks.test.ts.

What changed

  • New module: src/checks/shard_event.ts reads the shard runner's own log lines, so there is no new bookkeeping. A shard counts as finished at ── shard N/M done (exit …) (live form) or at the ── shard N/M (exit …): files header (batched form). Each shard writes exactly one of those lines, so each shard gives one event and a many-shard check can't flood /events.
  • Wiring: the write callback in execute (src/checks/service.ts) calls announceShard after appending to the run log.
  • Event: it uses the run.shard kind, so the line's existing data-live="run.*" hears it. The payload is runId, kind, env, commitOid, shard and of. It goes through app.bus.append, so the usual scrubbing applies.
  • Polling: src/web/pages/pull.ts no longer sets data-live-every. The pull.ts entry is gone from ALLOWED in test/no-polling.test.ts, which now fails if the beat comes back.
  • Activity feed: src/design/activity.ts gets a one-line label for run.shard, "finished a check shard".

Tests: test/check-shard-event.test.ts covers the line parsing, and checks that a run log of open, count and done lines yields exactly one event for the right repository. It also checks that the rendered running checks line has no data-live-every.

What I left out

  • I didn't test the service.ts wiring end to end. The event test calls announceShard directly, so it would still pass if the call in service.ts were removed. Only the no-polling test fails without the pull-page change.
  • I didn't look at the page by eye or start the app.
commented

Parked by the crew: the check failed ("a viewer who can gets the line, without counts until the log has them") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs