feat: keep a list live, and hand a running job to gh run watch #34
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/live-checks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
Problem
A list went stale the moment it was drawn, and
<CR>on a running check gavean empty buffer and
no log: job is in_progress.Measured on
rust-lang/rustwhile a job ran: 27 of 35 steps complete and thelog endpoint still returned 215 bytes of
BlobNotFound, while the same job'spage streamed those steps' output in a browser. GitHub publishes live text only
over its own socket; the stored log arrives when the job ends.
ghhas trackedthis since 2021 — cli/cli#3484.
Solution
The list polls itself. Every ten seconds, while any check is running or
pending, it re-runs the reload that
Ralready performs — so the view isrestored, a failed poll leaves the previous content, and
busyand thegeneration guard work unchanged. It stops when the checks settle, when no
window shows the buffer, or on wipe.
<CR>on a running check opensgh run watchin a terminal for thatcheck's workflow.
TermClosefires when the run ends, which is exactly whenthe log becomes fetchable, so the terminal is replaced by the real log buffer.
-works there too, since #23 made the parent remembered rather than derived.Cost
ci.Check.run_idcomes back, reverting three characters of #24 — thediscriminator regex already captured it.
Polling is one GraphQL request per tick, on the 5000/hr GraphQL budget, and it
is the same query
gh pr checks --watchruns. Doing it ourselves rather thanscraping that command's output means it works for bare commits as well as pull
requests, and gives real job ids: in a terminal
ghtruncates them to thewindow width.
No new module. The timer lives beside the load it repeats.