Skip to content

fix(service): Name the row of each GitHub request and cut the waste - #6033

Merged
dan-petty merged 3 commits into
mainfrom
fix/6012-name-request-rows
Nov 16, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/6012-name-request-rows

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Every GitHub request of a Service round now names its loop: poll or webhook for the round's own reads, idle_check for the open-work read. The ast-grep rule github-request-scope-row refuses a request_scope with no row. Only the lane of intake reads the open work, in place of all 14 lanes: an estimated 1220 of the 4000 counted requests an hour. roadmap.metrics.interval_minutes (default 13) lets the cluster slow the metrics row, and the failed-delivery window grows with it. The measurement by loop is in a comment.

Closes #6012

Change: openspec/changes/archive/2026-11-16-6012-name-request-rows/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/service The long-running devops Service and its lanes labels Nov 16, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Measurement: the GitHub requests of the Service by loop (#6012)

Source. devops_cli_github_requests_total{job="roadmap-service"}, mean of the 6 hours to 2026-11-16T19:40Z, from read-only Prometheus queries. "Counted" is a request with a status other than 304; the budget gives back the place of a 304 (#3939). The live Service has 7 repositories with 14 lanes each and service.poll_interval_seconds: 300. The budget made the poll slower: 9.38 polls an hour for each repository (devops_cli_service_triggers_total, about 384 s). devops-cli also got 42.9 webhook triggers an hour, and the 6 other repositories got none. The budget held rounds 254 times in the 6 hours. The pod restarted 5 times in the 6 hours.

What each loop reads (from the code)

Loop (row) Reads How often, each repository
idle_check (was other) GET issues?state=open (1 page for each 100 open issues and pull requests), and GET pulls when no open Item Before: after the round of each of the 14 lanes, for each poll and each webhook round. After: the lane of intake only
poll / webhook (was other) GET issues/events back to the oldest cutoff (lane of intake); the newest issue (ETag, mostly 304) when the intake rule needs it; GET issues/comments (1 page) only in a poll round where a due row failed before; GET /user once Each round of the lane of intake
metrics Issue listing (snapshot and changes); the label events of each open Item whose status or owner changed since the last run of this process, so every open Item after a restart; workflow runs; milestones; open issues (taxonomy); the repository and 4 traffic reads; the hooks and the deliveries of each hook; open issues, open pulls and the check runs of job drafts (inbox); labels and the labels file Every 13 min (4.6 an hour)
refine Listing; each selected item, its body and its comments; the newest commit of each path; closures; milestones Every 7 min (8.6 an hour), at most 7 items
watch Open pull requests (GraphQL batch, REST fallback) Every 3 min

Requests an hour

Loop devops-cli counted / 304 Each quiet repository (mean of 6) 7 repositories counted Estimate from the code
other 569 / 1241 145 / 15 1440 Quiet: 9.4 polls × (14 idle reads + 1 events read) = 141. devops-cli: about 16 rounds × 14 lanes × 8 pages = 1790 attempts, most of them 304
metrics 687 / 0 75 1135 Quiet: about 16 for each run × 4.6 = 74. devops-cli: about 30 for each run × 4.6 = 140, and about 550 label-event reads
refine 414 20 536 devops-cli: about 48 for each round × 8.6
implement 311 6.7 351
watch 112 20 231
release_comments 31 4.2 56
stage 42 1.5 51
alternatives 38 0.6 42
intake 15 2.9 32
plan_drift 16 1.5 25
open 5 3.3 25
retitle 10 0.9 15
fix_plan 1.5 1.1 8
All 2252 283 about 3950 Budget 4000

The 3 largest loops and their waste

  1. other, 1440 an hour. About 1340 of it is the idle read: each of the 14 lanes read the same open-issue listing after each round, so 13 of 14 reads were waste. The rest is the issue events of the lane of intake.
  2. metrics, 1135 an hour. devops-cli spends 687. A run costs about 30 requests. The rest is the label events of the 731 open Items: the row keeps their label times in the process only, so each restart reads them all again. The 15-minute windows after the restarts show 250 to 555 requests. Each quiet repository spends 75 an hour on data that changes little.
  3. refine, 536 an hour. devops-cli spends about 48 requests in each round at 8.6 rounds an hour. Each round reads each selected item, its body, its comments and the newest commit of each path again.

Cuts of this pull request

Cut Saving
Only the lane of intake reads the open work Estimate: about 1220 counted requests an hour (6 × 122 + about 490 for devops-cli), 31% of the budget, and about 1150 fewer 304 answers. The poll interval that the budget sets falls back to 300 s, so a part of this goes to more polls: a quiet repository then sends about 43 poll and idle_check attempts an hour, not 156
roadmap.metrics.interval_minutes (code default 13, no change) 0 at the default. At 26 minutes the steady runs halve: about 300 an hour (6 × 37 + about 70). The label-event reads after a restart stay

The idle_check and poll/webhook rows show the new split one hour after the release. Read it with sum by (repo, row, status) (increase(devops_cli_github_requests_total{job="roadmap-service"}[1h])).

What #6013 should cache first

  1. The label events of each open Item (item ages of metrics): about 550 counted requests an hour in devops-cli, mostly after restarts. The issues labeled and unlabeled webhooks give each change, and a cache in Valkey survives a restart.
  2. Each issue and the open-issue listing (title, body, labels, state): refine (536 an hour), the listing and inbox reads of metrics, and the idle_check read that stays (about 40 an hour for devops-cli, 9.4 for each quiet repository).
  3. The comments of each item that refine reads in each round.

@dan-petty
dan-petty marked this pull request as ready for review November 16, 2026 20:44
@devops-cli-service

Copy link
Copy Markdown
Contributor

Pull request #6033 has merge conflicts with main at commit c70b3e919e3f. GitHub cannot merge it. Rebase the branch onto the current main, resolve the conflicts and push the branch.

Each GitHub request of a Service round names its loop: poll or webhook
for the round's own reads, idle_check for the read of the open work.
Only the lane of intake reads the open work, in place of each lane.
roadmap.metrics.interval_minutes sets the interval of the metrics row,
and the window of failed hook deliveries grows with it. The ast-grep
rule github-request-scope-row refuses a request scope with no row.
The metrics row reads the failed hook deliveries since its last good
read, at least the last 15 minutes, and follows the Link of each page.
roadmap.metrics holds only interval_minutes.
@dan-petty
dan-petty force-pushed the fix/6012-name-request-rows branch from c70b3e9 to 5203f05 Compare November 16, 2026 21:17
@dan-petty
dan-petty merged commit 9632a4f into main Nov 16, 2026
25 checks passed
@dan-petty
dan-petty deleted the fix/6012-name-request-rows branch November 16, 2026 21:27
dan-petty pushed a commit that referenced this pull request Nov 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.169.1](v0.169.0...v0.169.1)
(2026-11-16)


### Bug Fixes

* **deps:** update certifi to v2026.10.23
([#6028](#6028))
([d4d4785](d4d4785))
* **roadmap:** Count a refine result of alternatives as a success
([#6044](#6044))
([fefa043](fefa043)),
closes [#6037](#6037)
* **roadmap:** Keep the Renovate dashboard out of the roadmap rows
([#6049](#6049))
([49f76e4](49f76e4))
* **service:** Name the row of each GitHub request and cut the waste
([#6033](#6033))
([9632a4f](9632a4f)),
closes [#6012](#6012)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/service The long-running devops Service and its lanes type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(service): Name the row of each GitHub request and cut the waste

1 participant