You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make backlog_metrics.py's User Billing Read Opt-In, Since a Fine-Grained Token Cannot Reach It #4370
scripts/backlog_metrics.py reads the owner's billing through fetch_billing, which calls GET /users/{username}/settings/billing/usage. Where the owner is a user account and the token is a fine-grained personal access token, that read cannot succeed.
Evidence (measured 2026-11-23)
The call returns HTTP 403 Resource not accessible by personal access token with the header X-Accepted-Github-Permissions: plan=read. /usage/summary answers the same.
GitHub's billing usage docs list "Plan" user permissions (read) for all four user endpoints. The org endpoints take "Administration" organization permissions (read).
The fine-grained token settings page offers no "Plan" permission to grant. Granting Administration (Read-only) left the read at 403, which matches the docs, since Administration covers org billing only.
So a user account's billing needs a classic token. The fleet's metrics consumer holds only a fine-grained read-only token, by design.
Effect
The script still exits 0 and records the failure in billing.error, plus a Billing was unavailable for <month>: ... line in notes. A consumer then reports billing unavailable every week. HomeAutomation-Config's weekly fleet report now drops billing and those notes as it reads the JSON, so it no longer depends on this. It works with either fix below.
Suggested fix
Make the billing read opt-in, for example --billing, defaulting off. Or skip it for a User owner. Where it is skipped, emit billing: null and no billing note, so a skipped read is not reported as a failed one. The Markdown output's billing line follows the same rule.
Released (2026-11-24): PR #4392 merged to develop at 054e8fd; branch and worktree cleaned up, so this claim holds no files. The issue closes on promotion.
Backlog burndown claim (away run 2026-11-24, round 1, group 3): branch burndown/backlog-metrics-attention, issues #4284, #1095 (its duplicate), #4299, #4370.
Predicted files:
scripts/backlog_metrics.py.
tests/test_backlog_metrics.py.
scripts/README.md, the backlog_metrics.py JSON field list.
Any other group needing one of these files waits for this branch to merge.
Activity
ptr727 commentedon Nov 24, 2026
Released (2026-11-24): PR #4392 merged to develop at 054e8fd; branch and worktree cleaned up, so this claim holds no files. The issue closes on promotion.
Backlog burndown claim (away run 2026-11-24, round 1, group 3): branch
burndown/backlog-metrics-attention, issues #4284, #1095 (its duplicate), #4299, #4370.Predicted files:
scripts/backlog_metrics.py.tests/test_backlog_metrics.py.scripts/README.md, thebacklog_metrics.pyJSON field list.Any other group needing one of these files waits for this branch to merge.
Carry Attention Lists, Cut Lists, and Opt-In Billing in backlog_metri…