Repository navigation
Description
Split from #3634.
The metrics row must stay near its level before #3601 over a period with two rollouts. The code change can be built and tested offline. The live check waits on two deployments after merge, so this part is deferred. Acceptance criteria: run two rollouts with the new code; record sum by (row)(increase(devops_cli_github_requests_total[1h])) with row metrics; show that the row stays near its pre-#3601 level of about 222 to 305 requests an hour; and state the result in a comment on the fix issue.
Proposed design
Problem statement
The metrics row of the roadmap poll must not cost more GitHub requests than it did before #3601. The live level needs two deployments of the fix after merge, so a pull request cannot measure it. This issue pins the five-request baseline of one metrics-row round with an offline test. A separate issue records the two-rollout measurement.
Acceptance criteria
Requirement: Row label on the GitHub request counter
The metrics row MUST record each GitHub request that it makes under the row label value metrics on devops_cli_github_requests_total.
Scenario: One metrics-row round through the due table
- WHEN a test runs the metrics row through
run_due_jobswith the fake GitHub edges and a fresh store - THEN the counter samples with
row="metrics"sum to the exact number of requests that the round made
Requirement: Request budget of one metrics-row round
The test MUST assert that one metrics-row round with one page of each listing makes at most five GitHub requests, and fail with the recorded count and the budget when it makes more.
Scenario: One more page of open items
- WHEN the test runs one metrics-row round as the GitHub App against a fake that returns one more page of open items than the budget allows
- THEN the test fails and reports the recorded request count and the budget constant of five
Requirement: The test gates the merge
The request-count test MUST run in the Tests & Coverage check that gates merges into main.
Scenario: Pull request check run
- WHEN CI runs the
Tests & Coveragecheck on a pull request - THEN the check collects the metrics-row request-count test and fails on an excess request
Existing Tool Considered
No alternatives check has run: the item type is test, a skip class, so the check gives not-applicable; alternatives is null. Prometheus is open and maintained and covers the live measurement with sum by (row)(increase(devops_cli_github_requests_total[1h])), and the repository already runs it, but it cannot assert a request count offline. pytest is open and maintained and, with the existing fake GitHub edges (GitHubFake and GitHubApiFake), covers the offline assertion. The change builds no new code and adds no library.
Key questions
- How does the change verify the metrics row request cost without a live deployment?: Add an offline test that runs one metrics-row round as the GitHub App against the fake GitHub edges and asserts the count against a budget constant of five. The two-rollout live measurement goes to a separate blocked issue. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, tests/github/test_github_api_metrics.py, tests/roadmap/test_roadmap_run.py:1344, tests/roadmap/test_roadmap_run.py:1500]
- Chosen: Offline request-count test. It runs in CI on every pull request, needs no deployment (ADR 0004), and pins the five-request baseline.
- Rejected: Live measurement only. It needs two deployments after merge, and no pull request can run it.
- Rejected: Manual dashboard inspection. It is not repeatable and it gates no merge.
- Which label carries the roadmap row on the GitHub request counter?: The
rowlabel. The metrics row runs inrequest_scope(row="metrics"), and the measurement query groups byrow. [sources: src/devops_cli/roadmap/run.py:1348, docs/TELEMETRY.md:90, tests/github/test_github_api_metrics.py:141] - What value does the offline test use as the per-round request budget?: A named constant of five: the every-issue listing, the Actions runs, the milestones, the open-issue listing and the repository metadata of one round with one page per listing. The four traffic reads are skipped under the App, and the
/rate_limitread is not counted. The test seeds one page per listing and a warm age cache, so a second page of open items makes six and fails. (best practice) [sources: src/devops_cli/github/metrics.py:829, src/devops_cli/github/metrics.py:833, src/devops_cli/github/metrics.py:834, src/devops_cli/github/metrics.py:835, src/devops_cli/github/metrics.py:836, src/devops_cli/github/metrics.py:761, src/devops_cli/github/metrics.py:622, src/devops_cli/github/metrics.py:348, src/devops_cli/github/metrics.py:417, src/devops_cli/config/defaults.py:767, k8s/monitoring/dashboards/devops-cli.json:1040, src/devops_cli/roadmap/run.py:1476]- Chosen: Named constant of five. It is the exact count of the five reads of one pre-feat(telemetry): measure how long roadmap items wait in each state #3601 round with one page per listing, so any extra request or page fails offline in CI.
- Rejected: Value read from a live Prometheus query. CI has no production Prometheus access, and the live series needs two deployments after merge.
- Rejected: No budget, count only. A count with no bound fails on no regression and gates nothing.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-08: not-applicable.
Class: test, no search.
Tool: none found.
Activity
devops-cli-service commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(telemetry)scope of the title gives the scope.It confirms a shipped fix but depends on two future deployments, so it is not urgent.It proves the fix holds in production and prevents a silent regression of the GitHub budget.The work is two rollouts and one Prometheus query; no new code is needed.Both target the metrics row cost after #3601, but #3634 fixes the per-pod cache and the candidate verifies the fix over two rollouts.devops-cli-service commentedon Nov 7, 2026
Status set to Ready at 8436734 (see proposed design in issue body).
Moved to new items: #3996.
devops-cli-service commentedon Nov 8, 2026
Alternatives check: not-applicable
Class: test. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
test(github): pin the metrics row GitHub request budget (#3794)