Repository navigation
fix(service): the metrics row sends too many counted requests - #6095
Merged
Merged
Conversation
dan-petty
marked this pull request as ready for review
November 17, 2026 03:16
The metrics row sent five requests in each round. It listed open issues a second time to count taxonomy labels. It also queried workflow runs and milestones through gh without conditional requests. Derive taxonomy counts from the open Items in the roadmap store. Query workflow runs and milestones through the GitHub session. Reduce the per-round request budget from five to four.
The metrics row now reads the workflow runs and the milestones through the GitHub session (#3941). The row tests faked only gh, so the session reads got a 404, reached the network guard, or failed to mint a token for the App. GitHubFake.serve_session answers the session GETs of the repository through the web fake. The App tests use a real RSA key and answer the token exchange. The change removed one blind except from metrics.py, so the swallowed failures ceiling of the file falls from 4 to 3.
dan-petty
force-pushed
the
fix/3941-metrics-row-counted-requests
branch
from
November 17, 2026 08:13
808e40d to
5f46994
Compare
Owner
Author
Fix of the failing checksThe branch is rebased onto
Proof: |
dan-petty
enabled auto-merge (squash)
November 17, 2026 08:18
dan-petty
pushed a commit
that referenced
this pull request
Nov 17, 2026
🤖 I have created a release *beep* *boop* --- ## [0.171.0](v0.170.0...v0.171.0) (2026-11-17) ### Features * **roadmap:** Run review scanners in the runner pod ([#6114](#6114)) ([ddde85a](ddde85a)) * **service:** Roll the Service with a surge release ([#6146](#6146)) ([a459b65](a459b65)) ### Bug Fixes * **k8s:** Run kube-linter on the Argo CD builds in CI ([#6112](#6112)) ([dba90f1](dba90f1)), closes [#6068](#6068) * **k8s:** Take the k8s area of the config-read list to zero ([#6124](#6124)) ([0857ee5](0857ee5)), closes [#6119](#6119) * **roadmap:** judge a pyproject tool setting by its diff ([#6089](#6089)) ([0a787eb](0a787eb)), closes [#3491](#3491) * **roadmap:** Name both command registration forms ([#6148](#6148)) ([0d3b1e1](0d3b1e1)) * **roadmap:** Read the files of a named pull request ([#6144](#6144)) ([5a29fed](5a29fed)) * **roadmap:** refuse a placeholder group title in a plan ([#6092](#6092)) ([cfd820b](cfd820b)) * **service:** the metrics row sends too many counted requests ([#6095](#6095)) ([b3fc5dc](b3fc5dc)) --- 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>
dan-petty
added a commit
that referenced
this pull request
Nov 19, 2026
The metrics row read every moved Item before every Item with no entry, in the order of the open list. When 20 or more held Items moved before each round, an Item with no entry and an Item in the 21st place never got a read. The round now reads the Items oldest entry first: an Item that the record does not hold, then a moved Item by the updated_at of its entry. A deferred Item keeps its older entry, so it comes first in the next round. An owned Item with no entry that the cap defers has no label times in the round, so the round skips its claim and logs no false "No labeled event" warning. The warning for an unreadable record now says that the round reads at most 20 Items. docs/CLUSTER.md compares the band of the issue with the same query, with no status filter, for all repositories. The plan states 24 requests for one new pod (#6095 set the fixed reads to 4), drops the repeated tasks and names the live check that follows the merge.
dan-petty
added a commit
that referenced
this pull request
Nov 19, 2026
The metrics row read every moved Item before every Item with no entry, in the order of the open list. When 20 or more held Items moved before each round, an Item with no entry and an Item in the 21st place never got a read. The round now reads the Items oldest entry first: an Item that the record does not hold, then a moved Item by the updated_at of its entry. A deferred Item keeps its older entry, so it comes first in the next round. An owned Item with no entry that the cap defers has no label times in the round, so the round skips its claim and logs no false "No labeled event" warning. The warning for an unreadable record now says that the round reads at most 20 Items. docs/CLUSTER.md compares the band of the issue with the same query, with no status filter, for all repositories. The plan states 24 requests for one new pod (#6095 set the fixed reads to 4), drops the repeated tasks and names the live check that follows the merge.
dan-petty
added a commit
that referenced
this pull request
Nov 19, 2026
Issue #3634 reports a metrics row that spent 627 to 1000 GitHub requests an hour after #3601, against 222 to 305 before it, because each new pod read the label events of every open Item again. This change keeps those label times in `item-label-times.json` of each repository, keyed by the `updated_at` of each Item, so a new pod reads no events of an Item that the file holds. A round reads the events of at most 20 Items, oldest entry first, so Items that move in each round do not keep another Item out. Measured cost of one new pod: 24 GitHub requests in its first round over 30 open Items, the 4 fixed reads of the row and 20 label-event reads. The count is the sum of `devops_cli_github_requests_total` for row `metrics` in one offline round against the GitHub fake. The plan said 25, because the fixed reads were 5 then; #6095 set `METRICS_ROW_GITHUB_REQUEST_BUDGET` to 4. Closes #3634 Change: `openspec/changes/archive/2026-11-18-3634-the-age-metrics-keep-their-reads/` --------- Co-authored-by: devops-cli-service[bot] <349441588+devops-cli-service[bot]@users.noreply.github.com> Co-authored-by: Daniel Petty <contact@danielpetty.com>
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.
Derive taxonomy counts from open Items in the roadmap store. Query workflow runs and milestones through the GitHub session. Reduce the per-round request budget from five to four.
Closes #3941
Change:
openspec/changes/archive/2026-11-17-3941-metrics-row-counted-requests/