feat: update_issue + update_pull_request (close/reopen)#2
Conversation
Ports the GitLab server's update_issue / update_merge_request equivalents that
were cut from the MVP. Closes the gap where the foreman could open/comment on
issues but not close them (or close a PR).
- client: add patch() helper (GitHub uses PATCH for updates).
- issues: update_issue(state/state_reason/title/body/labels) -> PATCH /issues/{n}.
- pull_requests: update_pull_request(state/title/body) -> PATCH /pulls/{n} (close, not merge).
- register update_issue_tool, update_pull_request_tool; 15 -> 17 tools; v0.2.0 -> 0.3.0.
- tests for close issue + close PR.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request bumps the project version to 0.3.0 and introduces new tools to update GitHub issues and pull requests, including support for closing or reopening them. It adds a patch method to the underlying HTTP client, registers the new tools in the server, and includes corresponding unit tests. The review feedback suggests adding validation to ensure that the title parameter is not empty or whitespace-only when provided, and stripping leading/trailing whitespace for consistency in both the issue and pull request update tools.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if title is not None: | ||
| json_data["title"] = title |
There was a problem hiding this comment.
When updating an issue, we should validate that the title is not empty or just whitespace if it is provided. This prevents sending invalid requests to the GitHub API, which would result in a 422 Unprocessable Entity error. Additionally, we should strip leading and trailing whitespace from the title for consistency with create_issue.
| if title is not None: | |
| json_data["title"] = title | |
| if title is not None: | |
| if not title.strip(): | |
| raise ValidationError("title must not be empty") | |
| json_data["title"] = title.strip() |
| if title is not None: | ||
| json_data["title"] = title |
There was a problem hiding this comment.
When updating a pull request, we should validate that the title is not empty or just whitespace if it is provided. This prevents sending invalid requests to the GitHub API, which would result in a 422 Unprocessable Entity error. Additionally, we should strip leading and trailing whitespace from the title for consistency.
| if title is not None: | |
| json_data["title"] = title | |
| if title is not None: | |
| if not title.strip(): | |
| raise ValidationError("title must not be empty") | |
| json_data["title"] = title.strip() |
Adds the GitLab-equivalent update tools cut from the MVP:
update_issue(close/reopen) andupdate_pull_request(close, not merge). Closes the gap where the foreman could open/comment but not close. 15→17 tools, v0.3.0. ruff+mypy+pytest(62)+gourmand(0) green.🤖 Generated with Claude Code