Skip to content

perf(roadmap): read blocker state from the open listing #6553

Description

@dan-petty

Problem Description

Refine reads the state of each recorded blocker with one GitHub request. _is_open (src/devops_cli/roadmap/refine/refine.py, near line 1719) calls store.item(number), and GitHubRoadmapStore.item reads the issue with one gh api subprocess with no cache (issue -> _read_or_none, use_cache=False, src/devops_cli/roadmap/stores/github_store.py near lines 823-833 and 1498). _open_blockers (each blocked wait) and _open_dependencies (each proposal) call it once for each number. open_issue_dependencies (src/devops_cli/roadmap/dependencies.py) does the same for stage and implement.

But each round already holds the open listing (store.open_items()), which tells which Items are open. An Item that is not in the open listing is closed, or it is no Item, and both give no blocker.

Measured on 2026-11-20 by a review of PR #6548 (read only, 803 open items): the 202 blocked items make 331 recorded-blocker reads in each refine round. After #6450 (PR #6548), a blocked item that named a tracker records the open sub-issues of that tracker, so the reads go to 391 (#4733 from 5 to 41, #5525 from 1 to 16).

Reproduction Steps

  1. Count the calls of store.item in one devops roadmap refine round without --confirm (or in devops roadmap explain of a blocked item).
  2. Each number in refine.blocked_by of each blocked item gives one gh api repos/<repo>/issues/<n> read.

Expected vs Actual Behavior

  • Expected: a round reads the state of a blocker from the open listing that it already holds, and makes no request for each blocker.
  • Actual: one uncached gh api read for each recorded blocker in each round.

Environment Diagnostics

devops-cli at main aa7cae7 (2026-11-20).

Dependencies

None.

Acceptance Criteria

  • A test: a refine round over blocked items with recorded blockers makes no store.item read for a blocker; the open listing decides.
  • The same for the dependency reasons of stage and implement.
  • A blocker that is open but no Item keeps its current result (no blocker).

See #6450, #6516.

Alternatives check of 2026-11-20: not-applicable.
Class: perf, no search.
Tool: none found.

Proposed design

Problem statement

Refine reads the state of each recorded blocker with one uncached gh api request through store.item. A round already holds the open listing from store.open_items(). On 2026-11-20 a review of PR #6548 measured 331 blocker reads in each refine round over 202 blocked items. After #6450 that count rises to 391. The round can decide blocker state from the listing that it holds and make no request for a blocker. Stage and implement read dependency state the same way through open_issue_dependencies.

Acceptance criteria

Requirement: Refine reads blocker state from the open listing

A refine round SHALL decide whether each recorded blocker is open from the open listing that the round holds, and MUST make no store.item read for a blocker number.

Scenario: Blocked items with recorded blockers

  • WHEN a refine round runs over blocked items whose refine.blocked_by records blocker numbers, against a store that counts each item call
  • THEN the round records the blockers that the open listing holds and the store counts no item call for a blocker number

Requirement: Stage and implement read dependency state from the open listing

open_issue_dependencies SHALL take the open item numbers of the listing and MUST make no store.item read for a dependency number.

Scenario: Stage or implement over an item with recorded dependencies

  • WHEN a stage or implement round calls open_issue_dependencies with the open numbers and a store that counts each item call
  • THEN the call returns the open dependencies from those numbers and the store counts no item call for a dependency number

Requirement: An open blocker that is no Item stays no blocker

A recorded blocker number that the open listing does not hold MUST give no blocker, even when its issue is open.

Scenario: Open issue with no priority label

  • WHEN the open listing holds no item for a recorded blocker number and the store would return an open item for that number
  • THEN the round reports no open blocker for that number and the store counts no item call for it

Existing Tool Considered

The alternatives check of 2026-11-20 records not-applicable with tool none found, class perf, no search. The alternatives block in the issue body holds the result. No open tool or library covers this need, because the need is fewer gh api reads in the project's own refine round. The change reuses GitHubRoadmapStore.open_items(), which each round already holds. It adds no dependency and no new code to keep. Written cost: one small refactor of _is_open, _open_blockers, _open_dependencies and open_issue_dependencies, in one pull request.

Key questions

  • Does each refine round already hold the open listing?: Yes. The round calls store.open_items() to select the items, so it holds the item numbers of the open listing before it reads a blocker. [sources: src/devops_cli/roadmap/refine/refine.py, src/devops_cli/roadmap/stores/store.py, src/devops_cli/roadmap/stores/github_store.py]
  • How does a refine round decide whether a recorded blocker is open?: The round builds one set of the item numbers in store.open_items() and tests number in open_numbers. _is_open goes, and _open_blockers and _open_dependencies take the set. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:2865, src/devops_cli/roadmap/refine/refine.py:1760, src/devops_cli/roadmap/stores/github_store.py:1420]
    • Chosen: One set of open numbers per round. The round already holds the listing, so the set costs no request, and a number that is not in it is closed or is no Item.
    • Rejected: Cache the store.item result for the round. It keeps one gh api read for each blocker on its first look, and the issue asks for none.
    • Rejected: Keep the store.item read for each blocker. It makes the 331 to 391 uncached reads that the issue measures.
  • How do stage and implement give open_issue_dependencies the open numbers?: open_issue_dependencies takes a required open_numbers argument. Each caller passes the numbers of the listing that it holds, and no caller falls back to store.item. (best practice) [sources: src/devops_cli/roadmap/dependencies.py, src/devops_cli/roadmap/refine/refine.py:1760]
    • Chosen: Required open_numbers argument. A required argument makes each caller pass the listing, so no path keeps the read for each number.
    • Rejected: Optional argument with a store.item fallback. The fallback keeps the reads that the issue removes, and a caller that forgets the argument keeps them with no error.
    • Rejected: Read the listing inside open_issue_dependencies. It adds a listing read for each call, and each caller already holds the listing.
  • What does a blocker number that the open listing does not hold give?: No blocker. A number that the listing does not hold is closed or is no Item, and the round reports no blocker for it. The change keeps the current result of an open issue with no priority label. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:2865, CONTEXT.md]
    • Chosen: No blocker. The current store.item result is no blocker for an open issue with no priority label, so the change keeps the result that the body asks to keep.
    • Rejected: Read the issue to tell a closed issue from no Item. It makes the request that the issue removes, and both cases give no blocker.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/infra
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 20, 2026
  2. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor
    • Related: fix(roadmap): an open tracker holds back no item #6450, which asks for a different change. Both work on blocker state in refine, but #6450 changes what counts as a blocker (trackers) while the candidate changes how state is read (open listing vs. per-item calls).
  3. added
    priority/p2-medium
    on Nov 20, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 22, 2026
  5. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  6. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 25, 2026
  7. removed
    status/in-review
    on Nov 25, 2026
  8. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor
  9. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 04:21 UTC

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

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/infravalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions