Skip to content

feat(gh): devops gh issues close records the close reason and a comment - #2575

Merged
dan-petty merged 3 commits into
mainfrom
feat/1658-issues-close-reason
Oct 29, 2026
Merged

dan-petty merged 3 commits into
mainfrom
feat/1658-issues-close-reason

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops gh issues close <number> --reason completed|not-planned closes an issue with GitHub's state_reason. Before, devops gh issues edit --state closed sent no reason, so GitHub recorded every close as completed, and no devops gh command posted an issue comment. So a superseded issue that AGENTS.md rule 2 tells an agent to close as rejected needed two raw devops gh api calls.

  • With --comment-file (- reads standard input), the command posts the comment first, then closes the issue. A failed close leaves the comment, and its error says that the comment is on the issue and that the issue is still open, so a second run without --comment-file closes it with no second comment. The comment never comes from the command line, and an empty one is refused.
  • The command reads the issue first. It refuses a pull request, a number that names no issue, and an issue that is already closed, with no write. GitHub's "Update an issue" documentation says state_reason is "Ignored unless state is changed", so a closed issue is reopened first with devops gh issues edit <number> --state open.
  • A reason other than completed or not-planned exits 2 with Click's message, which names the allowed values, before any request. A close as a duplicate is left out: GitHub links the original only through duplicate_issue_id, and a person closes duplicates (fix(roadmap): intake files and places a candidate that the model judges a duplicate, and names the possible original, instead of dropping or closing it #2223).
  • --dry-run sends no request and lists the read of the issue, the comment and the PATCH of the close with its body.
  • RoadmapStore.close(number, reason, comment=None) is the one place that reads, comments and closes, in both adapters. The GitHub store sends the close as one PATCH of the issue with {"state": "closed", "state_reason": ...} on standard input through issue_edit_args and run_gh, so the rate limiter paces it. StoreRequests.close plans the same requests from the same builders.
  • The command is an MCP tool beside gh issues edit, and the help of devops roadmap intake names it where it says to close an issue as not planned.

Closes #1658

Change: openspec/changes/archive/2026-10-29-1658-issues-close-reason/

@dan-petty

Copy link
Copy Markdown
Owner Author

Test evidence:

No real issue was closed to test the command.

Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD).

`devops gh issues close <number> --reason completed|not-planned`
closes an issue with GitHub's `state_reason`. With `--comment-file`
(`-` for standard input) it posts the comment first, then closes the
issue, so a failed close leaves the evidence and says so. It refuses a
pull request, a missing issue and an issue that is already closed,
because GitHub ignores a reason unless the state changes. `--dry-run`
sends no request and lists the read, the comment and the close.

`RoadmapStore.close` is the one place that reads, comments and closes,
in both adapters. The GitHub store sends the close as one `PATCH` of
the issue through `issue_edit_args` and `run_gh`, so the rate limiter
paces it, and `StoreRequests.close` plans the same requests. The
command is an MCP tool beside `gh issues edit`, and the help of
`devops roadmap intake` names it.
@dan-petty
dan-petty force-pushed the feat/1658-issues-close-reason branch from ee7e3fe to c28fd0f Compare October 29, 2026 00:52
@dan-petty
dan-petty marked this pull request as ready for review October 29, 2026 00:58
@dan-petty
dan-petty merged commit 97ed0ea into main Oct 29, 2026
17 checks passed
@dan-petty
dan-petty deleted the feat/1658-issues-close-reason branch October 29, 2026 00:58
dan-petty pushed a commit that referenced this pull request Oct 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.13.0](v0.12.0...v0.13.0)
(2026-10-29)


### Features

* **gh:** devops gh issues close records the close reason and a comment
([#2575](#2575))
([97ed0ea](97ed0ea)),
closes [#1658](#1658)
* **monitoring:** the ai spend dashboard counts gateway traffic from the
gateway's own series, shows failed attempts and names each caller
([#2584](#2584))
([33491ca](33491ca))
* **roadmap:** refine writes each criterion as an OpenSpec requirement
([#2591](#2591))
([d9a869f](d9a869f))
* **sandbox:** sandbox commands take a seccomp profile file
([#2588](#2588))
([46958d4](46958d4))


### Bug Fixes

* **monitoring:** RoadmapServiceGitHubWritesHigh counts a request with
no method label as a write, so it fired on 341 reads
([#2583](#2583))
([6dc3aa7](6dc3aa7)),
closes [#2574](#2574)


### Performance Improvements

* **ci:** the gate writes no coverage XML, and the clean-up keeps the
combined data
([#2582](#2582))
([ae9ebb2](ae9ebb2)),
closes [#1743](#1743)
* **roadmap:** intake's embeddings are cached in a password-protected
Valkey in the cluster
([#2578](#2578))
([bfe8a0c](bfe8a0c))


### Code Refactoring

* **devcontainer:** remove the DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP test
switch from product code
([#2580](#2580))
([7e7272e](7e7272e))
* **lint:** lazy exports import names under TYPE_CHECKING
([#2590](#2590))
([c96dbfe](c96dbfe)),
closes [#2010](#2010)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant