Skip to content

fix(github): ask no traffic endpoint as the App - #2759

Merged
dan-petty merged 6 commits into
mainfrom
fix/2752-metrics-traffic-403
Oct 30, 2026
Merged

dan-petty merged 6 commits into
mainfrom
fix/2752-metrics-traffic-403

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The roadmap Service asked GitHub for the repository traffic as the GitHub App. GitHub refuses that with HTTP 403, because the App token cannot read traffic. The metrics row failed on each round and logged the refusal.

This change fixes the cause:

  • A process that acts as the App now sends no request to the four traffic paths. Its report has traffic_collected false. It still sends the stars and the forks.
  • A process that acts as a person sends the four requests as before.
  • If GitHub refuses a path with a 403 that names the integration, the process asks that path once and not again. A 502 or a 403 with another message does not set this guard.
  • devops gh metrics prints "not collected" for the traffic that a process did not collect.
  • The Service sends none of the six traffic gauges. Only devops gh metrics --emit-telemetry, run with a person's gh login, sends them. The telemetry reference, the instrument text, ADR 0015 and the descriptions of the four traffic panels of the project dashboard say so.
  • The five copies of the read-and-catch block in github/metrics.py are now one helper. The ceiling of swallowed failures of that module goes down from 8 to 4.

The change adds no permission to the App token. A person can still give the metrics row its own token with Administration (read), as ADR 0015 allows.

Closes #2752

@dan-petty

Copy link
Copy Markdown
Owner Author

Test results (local, hooks on):

  • Full uv run devops ci: all 19 checks pass. The test check took 336 s (5m 36s) on a busy host, and that is over the 5 minute budget. CI-speed work is tracked in perf(ci): the Tests & Coverage check averages 382 s on main, over the 5-minute limit #2699.
  • uv run devops ci fail-to-pass --base origin/main: 4 tests fail on the base and pass on the branch. tests/test_github_metrics.py also fails to collect on the base. The 4 are test_a_refusal_by_the_token_is_a_403_that_names_the_integration, test_doc_generator_telemetry_docs, test_each_traffic_panel_names_the_workstation_command_that_sends_its_numbers and test_the_metrics_job_of_the_app_asks_no_traffic_endpoint.

Review findings, all fixed:

  • Archived tasks.md named the option refused_traffic. The code uses traffic_answer. The record now says traffic_answer.
  • The docs did not say where the traffic numbers still come from. The telemetry reference now says once that only devops gh metrics --emit-telemetry, run with a person's gh login, sends them. The six table rows are short again. The four traffic panels of the project dashboard say the same in their descriptions. A test covers each.

Findings declined: none.

@dan-petty
dan-petty marked this pull request as ready for review October 30, 2026 04:09
@dan-petty
dan-petty merged commit 692c15f into main Oct 30, 2026
18 checks passed
@dan-petty
dan-petty deleted the fix/2752-metrics-traffic-403 branch October 30, 2026 08:20
dan-petty pushed a commit that referenced this pull request Oct 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.22.1](v0.22.0...v0.22.1)
(2026-10-30)


### Bug Fixes

* **github:** ask no traffic endpoint as the App
([#2759](#2759))
([692c15f](692c15f)),
closes [#2752](#2752)
* **roadmap:** a stop of the Service is not a failed round
([#2756](#2756))
([0b7e190](0b7e190)),
closes [#2753](#2753)
* **roadmap:** say why an implement step stopped
([#2762](#2762))
([cd56ce4](cd56ce4)),
closes [#2758](#2758)
* **service:** render and alert on the hourly request budget
([#2760](#2760))
([809d85b](809d85b)),
closes [#2755](#2755)
* **service:** run the implement row on the status lane
([#2763](#2763))
([cd94f2c](cd94f2c)),
closes [#2757](#2757)


### Performance Improvements

* **ci:** cut test job time and guard its mean
([#2764](#2764))
([e76f656](e76f656)),
closes [#2699](#2699)

---
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(telemetry): the metrics row asks four traffic endpoints that answer 403 and spends a fifth of the Service budget

1 participant