Skip to content

fix(roadmap): the close job runs in a repository's first round, fails on unreadable check runs and reports the items a shipped release leaves open #1414

Closed as not planned

Description

@dan-petty

Refreshed plan (2026-10-17, unblocking review)

This section supersedes any text below that conflicts with it.

Decisions

  • Decision D1 (owner, 2026-10-17): "chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562 holds the roadmap Service's deployment only; Service code is built, tested offline and merged at 0 replicas (replicas: 0, its test, and the no-scale/no-restart/no-secret-push rules stay)." Under it, this item is built, tested offline and merged while the Service stays at 0 replicas. Only its live check waits for the Service.
  • The title drops "the Service's". With the Service at 0 replicas, a person runs devops roadmap close --confirm and devops roadmap run --confirm from their own account (AGENTS.md:150), so the body's "In production no one runs the CLI" no longer holds. run --confirm calls the same run_due_jobs and _run_close_adapter, so both gaps reach the CLI: in a data directory with no close stamp it never runs close, and once close is due it swallows unread check runs.
  • The close row's first_run_due=True comes first. Without it, a repository with no close stamp runs close only on a pull_request-closed webhook, so neither "the next round retries" nor the CLI's own "The next run retries" holds for polling.
  • A close round that fails on unread check runs still passes the closings it applied to reprioritize's cross-job trigger, and it records no close success. Otherwise those closings never trigger reprioritize before its daily run, because the next round's change read drops the session's own writes.
  • The shipped-items gauge is labelled by repository and release, and each close round rewrites that repository's series. The Service manages several repositories, and a release whose items are closed later must read 0, not its last count.
  • The silent reprioritize round from the 2026-10-09 comment is folded in. It comes from the same comment and the same file, and the fix is one log line.

Scope, in this order:

  1. The close row in RELEASE_LANE_ROWS gets first_run_due=True. A repository with no close stamp then runs close in its first round, and in every round until close first succeeds.
  2. _run_close_adapter applies the closings it could plan, then fails the job and names each plan.unread line, as devops roadmap close does.
  3. _run_close_adapter logs the open and reopened items of each ClosePlan.shipped entry under its release, and exports their count per repository and release as a gauge.
  4. _run_reprioritize_adapter logs the plan's unshipped or behind notice at INFO when the round starts nothing.

Delivery

Acceptance criteria

  • tests/test_roadmap_run.py: the default table's close row has first_run_due True, and a repository with no close stamp runs close in its first poll round.
  • tests/test_roadmap_run.py: a checks reader returns unread_reason for one pull request. The job applies the other closings and fails naming that pull request, schedule.json gets no close stamp, and the next poll round runs close again.
  • tests/test_roadmap_run.py: in that failing round, a closing applied in the current release still makes reprioritize due through _reprioritize_cross_job.
  • tests/test_roadmap_run.py: a closed Release holds one item that no pull request delivers and one that a person reopened. The job logs both under that release, and the gauge reads 2 for that repository and release.
  • tests/test_roadmap_run.py: with no such Release, the job logs nothing more and the gauge reads 0. Once a later round finds that release with no open item, its gauge reads 0, and another repository's series is unchanged.
  • tests/test_roadmap_run.py: a reprioritize round whose plan has unshipped or behind set and starts nothing logs that notice at INFO.
  • The failure is a DevOpsCLIError subclass. Every GitHub-sourced string in its details and in the new log lines (unread reason, item title) is capped at 256 characters.
  • The gauge's name is a constant beside the CONST_SERVICE_METRIC_* names in src/devops_cli/config/constants.py.
  • Tests are offline, each call phase stays under 1 s, and uv run devops ci passes.
  • changelog.d/1414.md exists, under ### Fixed.
  • Pending a person: once the Service runs again, the gauge shows on its /metrics dashboard, and an unread round shows in the Service log and in devops_cli_service_jobs_total{result="error"}.

Current references (main 3dd7fa6)

  • src/devops_cli/roadmap/run.py:658-664: the close row has no first_run_due, and the field defaults to False (run.py:152).
  • src/devops_cli/roadmap/run.py:740-750: _is_interval_due returns row.first_run_due when there is no stamp (:746-747).
  • src/devops_cli/config/constants.py:2293-2295: close's only batch key is the pull_request-closed webhook.
  • src/devops_cli/roadmap/run.py:483-543: _run_close_adapter ignores plan.unread and plan.shipped.
  • src/devops_cli/roadmap/run.py:546-577: _run_reprioritize_adapter logs nothing when its plan starts nothing.
  • src/devops_cli/roadmap/reprioritize.py:2713-2716: the unshipped and behind notices, in _headline_text (:2701-2717).
  • src/devops_cli/roadmap/run.py:891-908: _execute_due_rows records an outcome and stamps success only when the runner returns.
  • src/devops_cli/roadmap/run.py:403-421: _reprioritize_cross_job reads outcomes["close"].
  • src/devops_cli/roadmap/run.py:807: a round's change read drops the current actor's writes.
  • src/devops_cli/roadmap/close.py:116-125 (ShippedClosure) and :129-146 (ClosePlan, with unread and shipped).
  • src/devops_cli/lang/en/messages.py:1651-1654: close_unread, which promises "The next run retries."
  • src/devops_cli/commands/roadmap.py:497-499: the CLI exits 1 on unread. :557-583: run_cmd calls run_due_jobs with a poll batch only (:577).
  • src/devops_cli/config/constants.py:1058-1065: the Service metric names.
  • src/devops_cli/telemetry/metrics.py:102-115: set_gauge. :160-167: clear_metric, which drops the whole metric, every repository's series with it.
  • src/devops_cli/exceptions/roadmap.py:19: RoadmapRunError.

Dependencies and order


Problem

devops roadmap close exits 1 when a merged pull request's check runs can't be read: plan.unread is non-empty (src/devops_cli/commands/roadmap.py:477-479). Its text also names, under each closed Release that still holds an open issue, the items no merged pull request delivers and the items a person reopened (ClosePlan.shipped, #1362). The Service's close adapter, _run_close_adapter (src/devops_cli/roadmap/run.py:349-408), uses neither. It returns only the numbers it closed.

  • Unread check runs. Such a pull request closes nothing, the round succeeds, and no log line or metric reports it. The next run retries without anyone seeing the failure. Since fix(roadmap): closure closes the items delivered into a release whose milestone has already closed #1362 this also covers a shipped release's pull requests, whose items stay open until a run can read their checks.
  • A shipped release's open items. An item a closed milestone still holds, whether no pull request delivers it or a person reopened it, is named only in the CLI's text. In production no one runs the CLI. So a release that ships with an item left open by mistake stays that way, as v0.2.28's four items did on 2026-10-07 until a person closed them by hand.

Proposed remedy

  • When plan.unread is non-empty, the adapter applies the closings it could plan and then fails the job, naming each unread line, as the CLI does. The round's failure then shows in the Service log and service_jobs_total.
  • The adapter logs each ClosePlan.shipped section's open and reopened items under its release. It exports their count per release as a gauge on /metrics, so a shipped release that still holds an item shows on the dashboard.

Acceptance criteria

  • tests/test_roadmap_run.py: with a checks reader that returns unread_reason for one pull request, the job applies the other closings and fails naming that pull request, and the next round retries.
  • tests/test_roadmap_run.py: with a closed Release that holds one item no pull request delivers and one a person reopened, the job logs both under that release and the gauge reads 2 for it. With no such Release, the job logs nothing more and the gauge reads 0.
  • Tests are offline, each call phase stays under 1 s, and uv run devops ci passes.

Found while delivering #1362 (skeptic and adversarial reviews). Related: #1362, #1360, #1400.

Activity

  1. added
    type/bug
    scope/release
    source/agent
    on Oct 8, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. It caused a real production gap (v0.2.28 items left open until manual closure) but the system still closes what it can, so it is an observability failure rather than a total outage.
    • Value: Medium. Without this fix, shipped releases can silently hold open items and unread check runs go unreported, requiring manual intervention to notice and resolve.
    • Effort: Medium. Requires modifying the adapter to handle unread check runs, adding per-release logging, exporting a new metrics gauge, and writing offline tests for both scenarios.
  3. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Finding: v0.2.29 Service gap assessment (2026-10-09)

    Two small Service gaps that fit this item's scope:

    1. A reprioritize round that starts nothing says nothing. run.py _run_reprioritize_adapter ignores plan.unshipped and plan.behind and logs nothing, so the v0.2.29 ship that read as "closed, not shipped" (release PR without its milestone, see fix(release): a release pull request rehearses the cut and the release job read-only, so a green pull request means the release job passes on merge #1425) left no trace beyond the clone's "tracks main" line. Proposed: log the plan's notice at INFO when the round starts nothing.
    2. close never becomes due by polling in a repository with no close stamp. The close row in DEFAULT_DUE_TABLE has no first_run_due, and _is_interval_due returns row.first_run_due when last_run is None. Every managed repository onboarded since 2026-10-08 has run about 30 rounds with no close key in schedule.json; only a pull_request-closed webhook would ever start it. Proposed: first_run_due=True on the close row, with a test that a repository with no close stamp runs close in its first round.
  4. added
    status/blocked
    on Oct 11, 2026
  5. dan-petty commented on Oct 11, 2026

    @dan-petty
    OwnerAuthor

    Blocked by #1562: the roadmap Service's machine account is suspended, and the Service is held at 0 replicas. This item develops the Service or can only be checked on it, so it waits until the account is reinstated or the jobs act as a GitHub App.


    Generated by Claude Code

  6. changed the title [-]fix(roadmap): the Service's close job fails on unreadable check runs and reports the items a shipped release leaves open[/-] [+]fix(roadmap): the close job runs in a repository's first round, fails on unreadable check runs and reports the items a shipped release leaves open[/+] on Oct 18, 2026
  7. dan-petty commented on Oct 23, 2026

    @dan-petty
    OwnerAuthor

    Not planned: the close job is deleted with devops roadmap close in #1952. GitHub closes issues natively when a pull request merges into main.

  8. removed
    status/blocked
    on Oct 30, 2026
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

    scope/releasesource/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions