Gnome toolbar for Tangled code review.

perf(helper): cache finished CI results by revision #26

Merged permadeath.com
targeting main from azurite-frogmouth.test.pds.did.bot/gnome-shell-extension-tangled-reviewer:claude/cache-finished-ci
Merged opened by and assigned to permadeath.com
targeting main from azurite-frogmouth.test.pds.did.bot/gnome-shell-extension-tangled-reviewer:claude/cache-finished-ci

Closes #22. The helper now keeps each PR's finished CI result under its ticket and head commit, so a refresh only asks the spindle (org.tangled.ci.queryPipelines) about PRs that aren't settled. A result is settled when every workflow ended (success, failed, timeout, cancelled), or when there is no run and the revision is over 5 minutes old, since a fresh push may not have its pipeline yet. Running and blocked runs are asked about on every refresh, as before. A Jetstream org.tangled.review.patch event drops the PR's cached results, even when the head commit stays the same. The new map lives next to the client's other caches (finishedCi), and it doesn't change their shapes.

Retries: spindles aren't on Jetstream, so a cached result is trusted for 10 minutes and then asked about again. A retried pipeline's new result therefore shows within 10 minutes of the next refresh after it, or at once if the PR gets a new revision. The README's "Known limitations" says so.

Measured with the helper's protocol against live Tangled (you: permadeath.com, watch: permadeath.com, lance.blue, 29–31 PRs). Before, on main: 9 queries on the first refresh, then 8 on every refresh (about 1.0 s of spindle time each). After: 11 on the first refresh; 0 on refreshes with no revision pushed in the last 5 minutes; 2 (about 0.23 s) while one PR there was newly pushed. Over 8 minutes, refreshes 2 to 9 made 0, 0, 2, 2, 2, 2, 2, 2. Once every 10 minutes, one refresh asks all the settled PRs again: about 9 queries.

🤖 Generated with Claude Code

Commits 0