Skip to content

fix(gh): project metrics read every page and fail closed instead of reporting zero #931

Closed as not planned

Description

@dan-petty

Problem

devops gh metrics and the Project Metrics dashboard (#926, merged into release/v0.2.25 as 62d9954) undercount, and they show a failed read as zero. Both problems are in src/devops_cli/github/metrics.py:

  • Only the first page is read. get_label_taxonomy_metrics reads repos/{repo}/issues?state=open&per_page=100 without --paginate. On 2026-10-02 this repository has 199 open issues, so the counts cover at most the first 100. That endpoint also returns pull requests, which are counted as issues. get_milestone_metrics (milestones?state=all&per_page=100) and get_ci_workflow_metrics (actions/runs?per_page=…) also read one page. The milestones read is complete today (46 milestones) but will cut off silently past 100.
  • A failed read looks empty. Each reader catches Exception, logs a warning and returns []. The dashboard and the command then report zero releases, milestones or labels instead of failing. refactor(github): roadmap store that reads and writes items, releases and board fields behind one interface #768 removed this pattern from the release reads.
  • Releases are read outside the roadmap store. get_milestone_metrics reads milestones with its own gh api call, though refactor(github): roadmap store that reads and writes items, releases and board fields behind one interface #768 made RoadmapStore.releases() the one way to read Releases.

Acceptance criteria

  • Every REST listing in metrics.py reads all pages: api --paginate directly before the endpoint, with per_page=100, through run_gh. The issue listing drops entries that carry pull_request.
  • Milestone metrics come from get_roadmap_store(repo).releases().
  • A failed or malformed read raises GitHubOperationError. devops gh metrics exits 1 and names the failed read, and the telemetry emitter records nothing for that run instead of zeros.
  • Offline tests with a stub runner:
    • a two-page issue listing is counted in full, with its pull requests left out;
    • a failed read for each reader exits 1;
    • the milestone metrics read the in-memory roadmap store.

Key questions

Activity

  1. added
    type/bug
    scope/telemetry
    scope/github
    priority/p2-medium
    on Oct 2, 2026
  2. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Merged into #974: both edit the same three metrics readers and emitter, and #974's gauges would show a failed read's zero for an hour. #974 now carries the paginated, fail-closed reads and the store-backed milestones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2-mediumscope/githubscope/telemetrytype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions