Skip to content

feat(gh): devops gh issues close records the close reason and a comment, so a superseded item closes as not planned through rate-managed tooling #1658

Description

@dan-petty

Friction

Evidence

Checked at main 3dd7fa6.

  • _build_issue_patch_payload (src/devops_cli/github/issues.py:452-481) sends only title, body, state, milestone and labels.
  • devops gh issues has list, create, triage, status and edit (src/devops_cli/commands/gh.py:958-1088), and no close or comment.
  • The roadmap store already closes with a reason: close_issue_args (src/devops_cli/roadmap/github_store.py:1258-1268) sends state_reason. CloseReason.NOT_PLANNED is at src/devops_cli/roadmap/store.py:88. feat(release): release-please makes every release from main #1952 deleted close_issue_args and roadmap/migrate.py. On main, the store closes only a duplicate, with a comment (close_as_duplicate, src/devops_cli/roadmap/github_store.py:996).

Remedy

  • devops gh issues close <number> --reason completed|not-planned [--comment-file <path>]:
    • posts the comment first, then closes with state_reason, both through run_gh and the rate limiter;
    • reuses close_issue_args rather than a second request builder;
    • reads the comment from a file (or - for stdin), never from argv;
    • --dry-run sends nothing and prints both requests.
  • An unknown reason exits 2, naming the allowed values.
  • Labels stay as they are; --remove-label on edit already removes status/blocked.
  • Priority under the owner's blocker rule (2026-10-17): no rule-driven raise. It blocks no filed item, so intake assigns it.

Acceptance criteria

  • Tests first, offline, with gh faked at the process edge:
    • a not-planned close sends the comment POST, then a PATCH with state=closed and state_reason=not_planned;
    • a completed close sends state_reason=completed;
    • --dry-run sends nothing;
    • an unknown reason exits 2 and sends nothing.
  • devops docs generate --sync-readme output is committed, and devops docs check passes.
  • uv run devops ci passes.

Related

Proposed design

Problem statement

The devops gh issues edit --state closed command closes an issue as completed. Its payload carries no state_reason. No devops gh command posts an issue comment. AGENTS.md forbids bare gh, so every not-planned close requires a person in the GitHub web UI. This has caused errors: issues #1017 and #996 were closed as completed when they should be not planned. A new devops gh issues close command closes an issue with a state_reason and an optional comment, both through run_gh.

Acceptance criteria

  • Criterion 1: A not-planned close sends a comment POST, then a PATCH with state=closed and state_reason=not_planned.
    Verification: Run the offline test with gh faked at the process edge. Assert the first call is a POST to the issue comments endpoint. Assert the second call is a PATCH whose body contains state: closed and state_reason: not_planned.
  • Criterion 2: A completed close sends a PATCH with state_reason=completed.
    Verification: Run the offline test. Assert the PATCH body contains state: closed and state_reason: completed.
  • Criterion 3: --dry-run sends no request and prints both the comment POST and the close PATCH.
    Verification: Run the offline test with --dry-run. Assert no HTTP calls were made. Assert the output contains both request descriptions.
  • Criterion 4: An unknown reason exits 2, names the allowed values, and sends no request.
    Verification: Run the offline test with --reason invalid. Assert the exit code is 2. Assert the output names completed and not-planned. Assert no HTTP calls were made.
  • Criterion 5: devops docs generate --sync-readme output is committed and devops docs check passes.
    Verification: Run uv run devops docs check. Confirm it exits 0.
  • Criterion 6: uv run devops ci passes.
    Verification: Run uv run devops ci. Confirm it exits 0.

Key questions

  • Does close_issue_args exist on main for the new command to reuse?: No. feat(release): release-please makes every release from main #1952 deleted close_issue_args and roadmap/migrate.py. On main, the store closes only a duplicate via close_as_duplicate. The new command builds its own request. [sources: src/devops_cli/roadmap/github_store.py]
  • What is the order of API calls when closing with a comment?: Post the comment first, then close with state_reason. Both go through run_gh and the rate limiter. (proposed)
  • How is the comment text supplied?: From a file path or - for stdin. Never from argv. (proposed)
  • What happens when an unknown reason is given?: The command exits 2 and names the allowed values. It sends no request. (proposed)
  • What does --dry-run do?: It sends no request. It prints both the comment POST and the close PATCH. (proposed)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    on Oct 18, 2026
  2. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    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.

    • Type: type/feature. The candidate proposes a new command-line feature to close issues with a reason and comment.
    • Priority: P2-Medium. It addresses a process issue in how superseded items are closed, but does not block other work or introduce immediate risks.
    • Value: Medium. Improves consistency and clarity of issue management for roadmap items, especially those superseded by newer ones.
    • Effort: Medium. Requires implementing a new command with comment posting and state reason handling, plus tests and documentation updates.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at 4da1e34 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    value/medium
    effort/medium
    on Oct 28, 2026
  5. added a commit that references this issue on Oct 29, 2026
  6. removed
    status/ready
    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

    effort/mediumpriority/p2-mediumsource/agenttype/featurevalue/medium

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions