Skip to content

fix(github): treat the traffic API 403 as expected - #2823

Merged
dan-petty merged 1 commit into
mainfrom
fix/2626-traffic-api-403
Oct 31, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/2626-traffic-api-403

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Detect the permanent HTTP 403 'Resource not accessible by integration' error when GitHub App tokens call repository traffic endpoints. Log one debug line per repository instead of four warning lines per cycle, and skip emitting traffic gauges.

  • Detect integration 403 in _read_json and get_repository_traffic_metrics in src/devops_cli/github/metrics.py.
  • Log one DEBUG line per repository and zero WARNING lines when traffic endpoints are refused by the token.
  • Set traffic_collected=False in TrafficSummaryMetric when traffic calls are refused by integration token so zero-valued gauges are not emitted.
  • Update tests in tests/test_github_metrics.py.
  • Verified with fail-to-pass check (devops ci fail-to-pass --base origin/main).

Change: openspec/changes/archive/2026-10-31-2626-traffic-api-403/
Closes #2626

Detect the permanent HTTP 403 "Resource not accessible by integration" on GitHub traffic API calls, log one DEBUG line per repository instead of four WARNING lines, and skip emitting traffic gauges.

- Detect integration 403 in `_read_json` and `get_repository_traffic_metrics` in `src/devops_cli/github/metrics.py`.
- Log one DEBUG line per repository and zero WARNING lines when traffic endpoints are refused by the token.
- Set `traffic_collected=False` in `TrafficSummaryMetric` when traffic calls are refused by integration token so zero-valued gauges are not emitted.
- Update tests in `tests/test_github_metrics.py`.
- Verified with fail-to-pass check (`devops ci fail-to-pass --base origin/main`).

Change: `openspec/changes/archive/2026-10-31-2626-traffic-api-403/`
Closes #2626
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/github GitHub Projects v2, Views, Milestones, Labels, and PR automation labels Oct 31, 2026
@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 02:58
@dan-petty
dan-petty merged commit e66a124 into main Oct 31, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/2626-traffic-api-403 branch October 31, 2026 02:58
dan-petty pushed a commit that referenced this pull request Oct 31, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.24.0](v0.23.0...v0.24.0)
(2026-10-31)


### Features

* **cli:** declare dry-run class and enforce with ratchet test
([#2817](#2817))
([840d3eb](840d3eb)),
closes [#2230](#2230)
* **gh:** list dry-run requests in project, views and pages
([#2820](#2820))
([6a9a24e](6a9a24e)),
closes [#2236](#2236)
* **k8s:** raise the context of the condor and hawk Ollama tiers
([#2824](#2824))
([325fbdb](325fbdb)),
closes [#2822](#2822)


### Bug Fixes

* **ci:** the scope git of a pull request title has no label
([#2821](#2821))
([2c5ae30](2c5ae30)),
closes [#2800](#2800)
* **github:** treat the traffic API 403 as expected
([#2823](#2823))
([e66a124](e66a124)),
closes [#2626](#2626)

---
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/github GitHub Projects v2, Views, Milestones, Labels, and PR automation 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(github): treat the traffic API 403 for integration tokens as expected

1 participant