Repository navigation
fix(github): treat the traffic API 403 as expected - #2823
Merged
Merged
Conversation
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
marked this pull request as ready for review
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>
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.
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.
_read_jsonandget_repository_traffic_metricsinsrc/devops_cli/github/metrics.py.traffic_collected=FalseinTrafficSummaryMetricwhen traffic calls are refused by integration token so zero-valued gauges are not emitted.tests/test_github_metrics.py.devops ci fail-to-pass --base origin/main).Change:
openspec/changes/archive/2026-10-31-2626-traffic-api-403/Closes #2626