Skip to content

feat: update_issue + update_pull_request (close/reopen)#2

Merged
fatherlinux merged 1 commit into
mainfrom
feat/update-issue-and-pr
Jun 14, 2026
Merged

feat: update_issue + update_pull_request (close/reopen)#2
fatherlinux merged 1 commit into
mainfrom
feat/update-issue-and-pr

Conversation

@fatherlinux

Copy link
Copy Markdown
Member

Adds the GitLab-equivalent update tools cut from the MVP: update_issue (close/reopen) and update_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

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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +176 to +177
if title is not None:
json_data["title"] = title

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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()

Comment on lines +270 to +271
if title is not None:
json_data["title"] = title

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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()

@fatherlinux fatherlinux merged commit 050e346 into main Jun 14, 2026
13 checks passed
@fatherlinux fatherlinux deleted the feat/update-issue-and-pr branch June 14, 2026 11:02
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.

1 participant