Repository navigation
Description
Problem
The requests that no job row sends are the third largest source of requests that GitHub counts. Prometheus, 2026-11-07, one hour, job="roadmap-service", status other than 304: other 236 (of 696 with 304 included). They are the poll of each lane of each repository, before any row runs (run_due_jobs in src/devops_cli/roadmap/run.py):
_fetch_filtered_changescallsstore.changes_since, which listsrepos/<repo>/issues/events. Each lane that has a row with a due rule reads the same listing._person_comment_stampslistsrepos/<repo>/issues/commentswhen a row that may run failed before.
The listing of events changes in a busy repository, so each read is a 200 answer and counts.
Expected
The poll of a repository reads the issue events once for all its lanes. The lanes share the result for one poll.
Acceptance criteria
- A test shows that one poll of a repository with three lanes sends one request for the issue events.
- After the change is live,
sum(increase(devops_cli_github_requests_total{job="roadmap-service", row="other", status!="304"}[1h]))is lower than 236, and the issue records the result.
Existing tool considered
The store and the session already exist, and the change adds a per-poll cache to them. No library is needed.
Related
Related: #3939, #3672 (an idle repository polls less often), #3497.
Proposed design
Problem statement
The Service sends a separate issue-events request for each lane that reads changes in one poll. In a busy repository every read is a 200 answer and increases GitHub request use. The change caches the issue-events listing for one repository poll so all lanes share it.
Acceptance criteria
Requirement: One issue-events request per poll
One poll of a repository SHALL read the issue-events listing once for all lanes that need it.
Scenario: Three lanes share one request
- WHEN a poll runs three lanes of one repository and each lane has a due row that reads issue events
- THEN the fake GitHub session records one request for
repos/<repo>/issues/events.
Requirement: Cache lifetime
The issue-events cache MUST last for one poll only.
Scenario: A second poll sends a new request
- WHEN a second poll runs after the first poll has completed
- THEN the fake GitHub session records a new request for the issue-events listing.
Requirement: Per-lane cutoff
The shared listing MUST contain every event at or after each lane's own cutoff.
Scenario: Lanes with different cutoffs share one listing
- WHEN two lanes use different cutoffs in the same poll
- THEN each lane receives every event at or after its own cutoff from the one cached listing.
Requirement: Cache isolation by repository
The cache MUST keep the issue-events listing of one repository separate from another repository's listing.
Scenario: Two repositories in one poll
- WHEN one poll reads issue events for two repositories
- THEN the fake GitHub session records one request for each repository's issue-events listing.
Existing Tool Considered
No alternatives check has run. No open, maintained library covers this need: the store and the GitHub session already exist, and the change adds a per-poll cache to them. The written cost is about 100 lines of code, about 20k tokens to build, keep and fix, and one working day.
Key questions
- Where does the cache live so all lanes of one poll share it?: A
PollCacheis created once inservice_jobsand passed to every lane'sservice_job. The cache holds a lock because the lanes run in separate workers. (best practice) [sources: src/devops_cli/roadmap/run.py, src/devops_cli/roadmap/run.py:1419]- Chosen: Shared
PollCachefromservice_jobs. Each lane builds its own store, so only an object shared by the lane partials can serve all lanes. - Rejected: Cache on each
RoadmapStore. Each lane gets its own store, so the cache is not shared. - Rejected: Module-level global cache. It lives across polls and can hide events from the next poll.
- Chosen: Shared
- What does the cache hold: filtered changes or the raw issue-events listing?: The cache holds the raw issue-events listing for the repository. Each lane filters the listing with its own cutoff. (best practice) [sources: src/devops_cli/roadmap/run.py:995, openspec/changes/archive/2026-11-07-3939-request-budget-counts-github/design.md:13]
- Chosen: Raw issue-events listing. Lanes can use different cutoffs and still share one request.
- Rejected: Filtered
Changelist per cutoff. A lane with a different cutoff misses the cache and sends a second request.
- How long does the cache live?: The cache lives for one poll only. The Service discards it after the lanes of the poll finish. (best practice) [sources: docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md]
- Chosen: One poll. The next poll must see new events, as ADR 0003 requires.
- Rejected: A TTL equal to the poll interval. A TTL can outlive the poll and hide an event from the next poll.
- Rejected: A persistent cache. It never sees new events.
- Which reads does this item own?: This item owns the shared read of the issue-events listing only. The comment listing in
_person_comment_stampsstays out of scope. Open issues fix(roadmap): stage_ready backs off after a failed check #3671, fix(roadmap): scoped intake reads a bounded page count #3670 and feat(service): an idle repository polls less often #3672 own other status-lane read costs. (best practice) [sources: src/devops_cli/roadmap/run.py:995, src/devops_cli/roadmap/run.py:1188]- Chosen: Issue-events listing only. The reply assigns other status-lane read costs to open issues and says to file no new issue.
- Rejected: Issue-events and comment listings. It changes the scope and duplicates open work.
- How does the cache identify one listing?: The cache keys the listing by repository and the issue-events request URL. It does not key by lane. (best practice) [sources: src/devops_cli/roadmap/run.py:995]
- Chosen: Repository and request URL. All lanes request the same listing, so the URL identifies the shared result.
- Rejected: Lane. A lane key defeats sharing.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-09: none.
Tool: none found.
Activity
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(service)scope of the title gives the scope.The third largest source of counted requests is eliminated, but no feature is broken and no user is blocked.It removes redundant API calls that consume the project's GitHub quota and may trigger rate limits.The body states the change adds a per-poll cache to the existing store and session, with no new library needed.Both reduce counted GitHub requests in the roadmap service, but #3941 targets the metrics row while this candidate targets the other row (lane polling of issue events).dan-petty commentedon Nov 7, 2026
Answer from project standards: this item owns the shared read of issue events for all lanes. The cost of the other status-lane reads has its own open issues:
The analysis of the status rows (stage_ready, release_comments, metrics) found only request cost in the reads of these rows. File no new issue for that read cost.
Two other faults of the status lane have their own issues in #3027. One is a state record that the Service cannot write. The other is a status read that fails without failing its row.
Measure the result of this item with the query in its acceptance criteria, and record the number.
devops-cli-service commentedon Nov 8, 2026
Status set to Ready at d3770f5 (see proposed design in issue body).
Moved to new items: #4126.
devops-cli-service commentedon Nov 9, 2026
Alternatives check: none
Reason: The searches returned only generic HTTP response-cache libraries (hishel, requests-cache), which cache a URL's response for a TTL or revalidate it with ETags; neither gives the per-poll lifetime shared across lanes that the issue needs, and a TTL cache would hide events from the next poll, which the design explicitly rejects. The fix is a small in-process cache keyed by repository and issue-events URL inside the existing store and session code, so no open tool covers the need.
Tool: none found
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.
test(service): import the poll cache inside the tests (#3942)
devops-cli-service commentedon Nov 14, 2026
Released in v0.138.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.138.0
devops-cli-service commentedon Nov 14, 2026
Live since 2026-11-14 15:02 UTC