#612

github-prs: share the counts and the pooled pull-request list across panes

Openwiiiimmopened 13d ago

Several github-prs panes on one machine make one list pass and one set of counts per refresh between them.

Context / problem

A large board takes about 14 search rounds plus about 28 enrichment requests per pass and can take minutes. Every pane repeats it, and a timed-out GitHub request costs extra rate-limit points. Part of stealth-factory/opscope#630.

Scope

In:

  • Readings: who the token belongs to, merge counts, arrival counts, and the pooled list (one reading for all sources, because sources share each request).
  • The lease is renewed each round and each enrichment chunk.
  • The two count fetches claim on the poller thread; only the HTTP work runs on their threads.
  • total, capped, served and stopped reach other panes with the list.
  • Source filter, text filter, sort and stats toggle stay per pane. limit does not change the reading.
  • A rate-limit record: GitHub answers a spent GraphQL limit with HTTP 200, an errors array and x-ratelimit-remaining: 0, so graphql() must keep the response headers.
  • The 502/503/504 retries stay inside the fetch. A pass that still fails is a refusal held for refresh, so N panes make one retry, not N.
  • Freshness row, share_readings, example and docs, including that PR titles are stored for up to 2 hours.

Out:

  • Partial publishes during a long pass.
  • The detail view (fetch_detail).

Acceptance

  • Two panes with the same sources make one list pass.
  • A pane started during another pane's pass shows the previous list and pane N asking now.
  • A list too large to share says so on screen.
Agent notes
  • Poller main.rs:1959; discover_owners :1368, fetch_counts :1017, fetch_created :1096, fetch_list :1448 with list_query :417, enrich :341, enrich_computed :380; fetch_round :1288, retry_again :1328; graphql() :259 discards headers.
  • Keys: ghprs.who/1:{host}:{fp}, ghprs.merged/1:{host}:{fp}:{hash(scope)}, ghprs.created/1:..., ghprs.list/1:{host}:{fp}:{hash(sources, extra args)}.
  • Size (estimate): about 0.6 KB per PR; 665 PRs is about 400 KB. Raise the per-value cap for this widget.

Activity

1
linear-code[bot]13d ago