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
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".
stopped parked by the crew deploy 9abdb2e
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.tsreads 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 …): filesheader (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
writecallback inexecute(src/checks/service.ts) callsannounceShardafter appending to the run log. - Event: it uses the
run.shardkind, so the line's existingdata-live="run.*"hears it. The payload isrunId,kind,env,commitOid,shardandof. It goes throughapp.bus.append, so the usual scrubbing applies. - Polling:
src/web/pages/pull.tsno longer setsdata-live-every. Thepull.tsentry is gone fromALLOWEDintest/no-polling.test.ts, which now fails if the beat comes back. - Activity feed:
src/design/activity.tsgets a one-line label forrun.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.tswiring end to end. The event test callsannounceSharddirectly, so it would still pass if the call inservice.tswere 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.
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
A finished check shard now puts one
run.shardevent 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 --noEmitfailed with "bun is unable to write files to tempdir".bun testpassed for the files I touched or that cover the change: the new test,test/no-polling.test.ts,test/check-progress.test.tsandtest/checks.test.ts.What changed
src/checks/shard_event.tsreads 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 …): filesheader (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.writecallback inexecute(src/checks/service.ts) callsannounceShardafter appending to the run log.run.shardkind, so the line's existingdata-live="run.*"hears it. The payload isrunId,kind,env,commitOid,shardandof. It goes throughapp.bus.append, so the usual scrubbing applies.src/web/pages/pull.tsno longer setsdata-live-every. Thepull.tsentry is gone fromALLOWEDintest/no-polling.test.ts, which now fails if the beat comes back.src/design/activity.tsgets a one-line label forrun.shard, "finished a check shard".Tests:
test/check-shard-event.test.tscovers 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 nodata-live-every.What I left out
service.tswiring end to end. The event test callsannounceSharddirectly, so it would still pass if the call inservice.tswere removed. Only the no-polling test fails without the pull-page change.Closes #2889