Repository navigation
feat(update): show a rebasing banner while the Count rebuilds a branch - #361
Merged
Merged
Conversation
A ticked re-check box or a rebuild that regenerates lockfiles now puts a banner at the top of the Count's part of the PR description, with an animated image pinned to the running release. The server shows it as soon as the tick arrives; a CLI or Action run shows it when it reaches the PR. The final rewrite takes it down, a failed or held rebuild's acknowledgement pass does too, and a banner left by a stopped run keeps the next run off the receipts path until it is gone.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 28fe47a | Commit Preview URL Branch Preview URL |
Nov 23 2026, 12:19 AM |
…everywhere A banner refuses only its own PR's receipt instead of every receipt in the repository. The server's acknowledgement holds the repository across its read and write and skips while a run holds it, its tasks are drained at shutdown, and a closed or already bannered PR costs no read. Banner markers are matched as whole CRLF-aware lines, every block comes off and stray markers never take text with them. Closures, PRs closed mid-rebuild and runs that stop before rebuilding take the banner down, the acknowledgement pass tries every PR, and its failure fails the repository so no quiet-run answer hides a banner left up.
…nowledgements run side by side The lifecycle tracks every open PR showing a banner when it is prepared, not only the ones its announcement wrote, so a banner the server put up comes down when someone closes or merges the PR mid-run, on the normal and the withdraw path. Server acknowledgements share a per-repository read lock that runs take exclusively, take turns per PR, and drain beside the worker at shutdown, aborted and joined when the deadline passes. The banner always opens its own line after the start marker.
A failed or stale run now removes the repository's quiet-run row, so the sweep cannot skip a repository whose banner a failed run left up. The lifecycle records bannered PRs off the open listing, before any fresh read, and drops one only after the Count's own closure, so an obsolete PR its owner closes during preparation still loses its banner.
…er goes up A run that may leave a banner up — one that will announce, or whose PRs already carry one — removes the repository's quiet-run row before the banner is written, so a run killed or timed out before record_runs never leaves the sweep an earlier answer to skip a stuck banner with. Plain and receipt-restored runs write nothing extra; a run that cannot remove the row shows no banner.
…o its transcript is stable
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behaviour
While a rebuild takes long enough to notice, the Count shows a banner at the top of his part of the PR description, between
<!-- patchula-begin -->and the ownership marker. Text outside his part is kept byte for byte. The banner is wrapped in<!-- patchula-rebasing -->…<!-- patchula-rebasing-end -->lines:The image is an
<img width="80" height="32" alt="🦷 rebasing…">(the Count's animated bat), so the alt text carries the meaning on its own. There is no timestamp; GitHub's "edited" note on the description gives the relative time.Triggers
acknowledgeable(before, pr)). Once the delivery is queued (not on duplicate deliveries), it starts a tracked acknowledgement task.Lifecycle::announceruns right after the lifecycle is prepared and before lockfile generation. It shows the banner for planned plans whose open PR is ticked. Wording: "re-checking it against<base>…".<base>and regenerating its lockfiles…".Clearing
renderreuses it without the banner, so the body hash differs and the PR gets one write.Lifecycle::acknowledge(formerlyacknowledge_rechecks) takes the banner down and unticks the box. It tries every PR and returns the first error after the rest. If it fails, the repository fails, so no quiet-run answer is recorded and the server retries.Lifecycle::withdrawtakes the banners down and leaves the ticks for the next run.body::closurestrips the banner.rebasing-bannerinrestore_write), and the run isn't settled from receipts alone. Every other receipt still restores, and the acknowledgement pass clears the banner.Pacing cost
Every banner write is a normal
Client::patch, preceded by a fresh read, and both go through the existing write pacing. A slow rebuild costs one extra description write when its result rewrites the description anyway, and two when it would otherwise have left the description alone.The server's acknowledgement writes through a clone of the installation engine's own GitHub client (
Engine::github()), published next to the engine with the key it was built from. That way it shares the same write budget even while a batch holds the engine.No new client type and no new write path.
Request counts in
targeted_clicks_…:bannerorigin, beside unrelated open and owner-closed PRs): 13, with a single body PATCH.Image URL
https://raw.githubusercontent.com/sweepies/count-patchula/v<version>/assets/rebasing.svg.<version>isenv!("CARGO_PKG_VERSION"), the workspace version; it is not hard-coded and was not bumped.I checked with
curl -sIagainst an existing SVG in a public repository: raw.githubusercontent.com answerscontent-type: image/svg+xmlwithx-content-type-options: nosniff, which GitHub's image proxy accepts. Thegithub.com/…/raw/…form only redirects there, so the raw URL is used directly.On GitHub Enterprise Server without access to github.com, or offline, only the alt text shows; the docs say so.
Test transcripts mask
/count-patchula/v<version>/assets/, so a release bump doesn't move the snapshots.Image
assets/rebasing.svgis the animated bat; it replaced the first commit's static placeholder.After review
An adversarial review found the following; all are fixed in d181d12, except finding 4, which was fixed earlier.
rebasing-banner), andcompletealso requires no banner, following theobsoletepattern. The test is a newbannerorigin intargeted_clicks_keep_unrelated_open_and_closed_receipts_fast: unrelated open and closed PRs stay restored (no extra requests between 3 and 6 dependencies, no unrelated PR fetched), no PR gets a banner, and there is one body PATCH.try_locks it and skips if a run holds it. Otherwise it holds the lock across its fresh read and its write, so no run's write can land between them.JoinSet, reaped as new ones start, drained at shutdown for up to 10 seconds, then aborted.acknowledgements_use_the_engine_client_and_never_race_a_run(server, realEngineswithFakeGitHub).\r\neverywhere. Round-trip tests cover CRLF, LF, and an LF banner that GitHub turned into CRLF.closurestrips the banner (unit test). PRs this run announced that someone closed or merged meanwhile get a body-only cleanup (a_banner_comes_down_when_the_pr_closes_mid_rebuild_or_the_run_stops).withdrawtakes the banners down and keeps the ticks.acknowledgetries every PR.Settlement.acknowledgedcarries a failure, and the engine fails the repository on it, sorecord_quietdoesn't run and the server retries.>line, closing line, plus the blank line after) comes off.pr/banner.rs.Engines.writersentries are dropped on slot discard and ignored on a key mismatch.Engines::writerandacknowledge_tickare tested as above.Housekeeping:
catalog-controlsstays at 27 (bumped once in this PR); only its hash changed.Re-check (a8701df)
A second review confirmed the seven fixes above and found five more problems:
a_server_banner_comes_down_when_the_pr_closes_mid_run_or_the_repository_fails(engine, normal path).a_cleanup_failure_withdraws_the_banner_and_keeps_the_tick, open and closed variants (engine, withdraw path).acknowledgements_drain_within_their_bound(completion, and abort at exactly 10 seconds).with_bannerglued the banner marker onto it. The banner now always starts on its own line; removing it leaves the start marker on its own line, and from then on the round trip is exact. Unit test.acknowledgeableskips closed PRs, boxes that were already ticked, and PRs whose banner is up.Engines::writerrebuilds the engine when the settings change its key.Second re-check (7329bec)
A third review confirmed N1–N5 and found two remaining problems:
record_runsnow clears the repository's quiet-run row (Engine::clear_quiet, built onCache::clear_state) on every outcome other than Complete.patchula.pkland asserts that the sweep skips the repository after the successful run and runs it in full after the failed one.internals/engine.mdandguide/pull-requests.mdsay so.banneredand kept its banner.banneredis now filled right after the open listing, before any fresh read.bannered, asclose_batcheddoes.an_obsolete_bannered_pr_never_keeps_its_banner_however_it_closes. In the Count-closes case, the closure has no banner and nothing more is written. In the owner-closes case, the acknowledgement pass strips the banner and the PR stays closed.The
catalog-controlshash was updated (still version 27).Third re-check (28fe47a)
announcewrote a banner never reachedrecord_runs; this covers a remote run hitting its time limit, an OOM, a panic, or a killed server. Remote jobs aren't requeued, so the earlier quiet-run row survived and the sweep could skip the stuck banner for up to six hours.Write::repositorynow clears the repository's quiet-run row before the first banner goes up.Lifecycle::may_leave_banners, which sharesannounce's selection), so plain fast runs and receipt-restored runs write nothing extra.a_run_stopped_after_its_banner_leaves_the_sweep_no_answer_to_skip_with. Each stopped run gets its own engine over the shared cache, through a transport that stops answering for good after a chosen request.guide/pull-requests.mdandinternals/engine.mdsay so.The
catalog-controlshash was updated (still version 27).Follow-ups
Fourth re-check
R3 verified fixed:
may_leave_bannersandannounceshare one selection, so the clear before the first banner can't drift from what's written. Nothing else remained except R4, a race in the new stopped-run test: the release-notes prefetch runs beside the banner write, so a stop right after that write could vary the recorded requests. That test now turns release notes off. It passed 10 times in a row on the same transcript hash, and the engine suite and parity are green.