Repository navigation
fix(telemetry): read repository traffic as the GitHub App - #4932
Conversation
|
The stage_ready row leaves pull request #4932 a draft. It holds the label |
a644e3e to
69cfef8
Compare
Fail-to-pass
The six tests that fail on the base and pass on the head:
On the head, The same run also replayed the tests of the modules that import Plan findingThe stage review found |
Steps for a person1. Before the merge: check the premiseThe agent session could not run this probe: its permission check refused a script in the Service pod. The probe mints one installation token that asks for kubectl -n devops exec -i deploy/roadmap-service -c service -- /app/.venv/bin/python - <<'PY'
import json, urllib.request
from devops_cli.config.constants import CONST_URL_GITHUB_API_BASE
from devops_cli.github import app_installation as ai
ai.CONST_GITHUB_APP_TOKEN_PERMISSIONS = {"administration": "read", "metadata": "read"}
answer = ai._exchange(ai.configured_app())
print("granted:", sorted((answer.get("permissions") or {}).items()))
for path in ("views", "clones", "popular/referrers", "popular/paths"):
request = urllib.request.Request(
f"{CONST_URL_GITHUB_API_BASE}/repos/dan-petty/devops-cli/traffic/{path}",
headers={"Authorization": f"token {answer['token']}", "Accept": "application/vnd.github+json"},
)
with urllib.request.urlopen(request, timeout=20) as reply:
print(path, reply.status)
PYExpected: If the mint fails with HTTP 422, the installation does not grant 2. After the rolloutNo ConfigMap or Secret changes. The next metrics round of the Service reads the traffic.
|
69cfef8 to
806261f
Compare
806261f to
e72f705
Compare
|
Review findings and what I did (head
The OpenSpec design, proposal and tasks (group 4) name the two corrections, and the archive is again the last commit.
Owner step before the merge is the same: run the premise probe of the earlier comment, so that a token that asks for |
The installation token asks for administration: read, so the metrics row reads the four traffic endpoints. A refusal logs one warning that names the permission.
The token now asks for administration: read, so a reply with administration: write grants no extra permission. The test grants pages: write, which the token does not ask for.
The consequence said that a feature that needs more permissions asks for a token with its own set, but workflows, repository_hooks and administration went into the shared set. It now states the shared-set rule, the HTTP 422 risk of each addition, the person check of the installation grant, and what Administration read can read. The gidgethub bullet names the full set.
e72f705 to
6d95c77
Compare
Rebase and review fixes (head
|
🤖 I have created a release *beep* *boop* --- ## [0.119.0](v0.118.0...v0.119.0) (2026-11-12) ### Features * **repos:** the claim sets In Progress ([#5111](#5111)) ([06ef1c6](06ef1c6)) * **roadmap:** a fix-plan step repairs a plan PR with open findings ([#5104](#5104)) ([ca5b16d](ca5b16d)) * **roadmap:** extend stage review rounds while open findings drop ([#5090](#5090)) ([bacf713](bacf713)) * **roadmap:** re-anchor a stale citation that matches one line ([#5040](#5040)) ([16356d8](16356d8)) ### Bug Fixes * **ci:** keep failed test IDs in the service image shard summary ([#5106](#5106)) ([88589ef](88589ef)) * **github:** count each page of a paginated GitHub read ([#5070](#5070)) ([908e24a](908e24a)) * **github:** keep the metrics permissions out of the runner Job token ([#5064](#5064)) ([fb549ff](fb549ff)) * **github:** pace mutations through the clock seam ([#5063](#5063)) ([2bd87bc](2bd87bc)) * **k8s:** delete the CoreDNS files that k3s never applies ([#5055](#5055)) ([463f601](463f601)) * **monitoring:** tidy LLM stack windows, units and lines ([#5052](#5052)) ([375d724](375d724)) * **roadmap:** a refused kept plan uses no stage gate return ([#4983](#4983)) ([b8adbca](b8adbca)) * **roadmap:** count a command as removed only when MUST NOT governs it ([#4985](#4985)) ([2e6f407](2e6f407)) * **roadmap:** cut prose after a cited stage command ([#4982](#4982)) ([a172563](a172563)) * **roadmap:** name every module of a group with no named test ([#5089](#5089)) ([27a0e79](27a0e79)) * **roadmap:** stage returns every open review finding to the planner ([#5067](#5067)) ([21b116e](21b116e)) * **roadmap:** the alternatives check reads the tools in use ([#5062](#5062)) ([8903233](8903233)) * **roadmap:** the constants gate reads 6_500 and no new value ([#5080](#5080)) ([8a7b113](8a7b113)) * **roadmap:** the constants gate reads only a stated value ([#5042](#5042)) ([cf4733e](cf4733e)) * **telemetry:** read repository traffic as the GitHub App ([#4932](#4932)) ([7c42823](7c42823)) * **tests:** close the UDP, DNS and git gaps of the network floor ([#5101](#5101)) ([047ee48](047ee48)) * **tests:** repair the bwrap contract suite and gate it ([#5110](#5110)) ([9a0659d](9a0659d)), closes [#4715](#4715) ### Performance Improvements * **ci:** build the Service image once for its test shards ([#5079](#5079)) ([dcf5bd5](dcf5bd5)) * **ci:** run only the required checks on the release PR ([#5057](#5057)) ([8174071](8174071)) * **ci:** stop the cache export of pull request image builds ([#5113](#5113)) ([ba30820](ba30820)) * **roadmap:** consolidate keeps its vectors in the shared tiers ([#5099](#5099)) ([2a8bf1a](2a8bf1a)) ### Code Refactoring * **roadmap:** one Status writer for every job ([#5109](#5109)) ([24cfedc](24cfedc)) --- 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>
The traffic row of the project dashboard has no sample since 2026-10-30. The Service acts as the GitHub App, and its installation token asks for no Administration read, so
get_repository_traffic_metricsreturns no traffic and the four panels stay empty. GitHub keeps traffic for 14 days only, so each day without a read loses data. This change delivers #4757: it gives the token the permission, removes the App skip, and names the missing permission when GitHub refuses a traffic endpoint.The App setup steps of
k8s/README.mdname Administration read, because GitHub refuses every token with HTTP 422 when the installation does not grant it. The descriptions of the four traffic panels say that the roadmap Service anddevops gh metrics --emit-telemetrysend the traffic numbers.ADR 0015 now states the rule that the code follows: each token asks for one shared set, a feature that needs one more permission adds it to that set with an amendment line, and a person confirms the grant on the installation page before such a change merges. It also records what Administration read can read.
Closes #4757
Change:
openspec/changes/archive/2026-11-12-4757-emit-traffic-per-repository-on-a/