Skip to content

Carry Failing and Stale Pull Requests and Failing Branches in backlog_metrics.py JSON #4284

Done

Description

@ptr727

Problem

scripts/backlog_metrics.py --format json counts the window, and names nothing that needs the maintainer now. It carries no open pull request, no check state, and no branch run state. So a consumer rendering a weekly report cannot say that an open pull request is failing its checks, or that a branch's latest run failed.

HomeAutomation-Config's weekly fleet report needs exactly that. Its maintainer asked to be alerted to things that need attention, such as an open Dependabot pull request whose compile jobs fail. Until the hub carries it, that repository reads the lists itself with the same read-only token, in scripts/fleet_attention.py, so its report ships now.

Proposal

Add an attention object to the --format json document (or a schema 2), per repository or fleet-wide. It should carry these lists:

  • Failing pull requests: open, non-draft pull requests whose head commit has a check run concluded FAILURE, TIMED_OUT, ACTION_REQUIRED or STARTUP_FAILURE, or a status context in FAILURE or ERROR. CANCELLED is left out. Each entry has the number, title, html_url, author, base branch, and the failing check names.
  • Failing branches: for the default branch, and develop where it exists, each workflow whose latest completed run concluded failure, timed_out or startup_failure, with that run's html_url.
  • Stale pull requests: open, non-draft pull requests with no update for N days (7 by default) and no failing check.

The open decision issues are already in items.issues_open, so they need nothing new.

Reference

HomeAutomation-Config's scripts/fleet_attention.py and its tests are a working reference for the query shape: one GraphQL call per repository, plus gh run list per branch. Once the hub carries this, that script is removed and the templates read the hub's lists.

Done when

  • backlog_metrics.py --format json carries the three lists, documented in scripts/README.md.
  • HomeAutomation-Config's fleet report reads them from the hub, and its own read is removed.

Activity

  1. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    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.

  2. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    Cross-link from the backlog burndown away run (2026-11-24, round 1): #1095 duplicates this issue. Its maintainer-rescoped work (2026-11-02) is failing workflows and open pull request health in scripts/backlog_metrics.py, which is what this issue's attention lists carry. Both are worked in one group, on branch burndown/backlog-metrics-attention. Neither is closed here, since the fix closes both.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions