feat(gitea): Add CRUD operations for Issues and Pull Requests (#3) #4

Merged
xcaliber merged 6 commits from feature/3-issue-pr-crud-operations into main 2026-01-15 13:45:16 +00:00
Owner

Review Summary

PASS - All CRUD operations implemented correctly

Issues Fixed:

  • merge_pull_request output variable bug (early return)
  • Duplicate docstring in _get_branch
  • Namespace refactor for VeniceInfo (from PR comment feedback)

Changes in this PR:

  • 9 Issue CRUD functions (get, update, close, reopen, delete, comments)
  • 7 PR CRUD functions (get, update, merge, comments)
  • Version bumped to 1.4.0

Ready to merge. The code follows existing patterns with proper error handling and confirmation dialogs for destructive operations.

**Review Summary** ✅ PASS - All CRUD operations implemented correctly **Issues Fixed:** - `merge_pull_request` output variable bug (early return) - Duplicate docstring in `_get_branch` - Namespace refactor for VeniceInfo (from PR comment feedback) **Changes in this PR:** - 9 Issue CRUD functions (get, update, close, reopen, delete, comments) - 7 PR CRUD functions (get, update, merge, comments) - Version bumped to 1.4.0 Ready to merge. The code follows existing patterns with proper error handling and confirmation dialogs for destructive operations.
xcaliber added 1 commit 2026-01-15 13:02:01 +00:00
Implements missing functions from issue #3:
- Issues: get_issue, update_issue, close_issue, reopen_issue, delete_issue
- Issue Comments: list_issue_comments, create_issue_comment, update_issue_comment, delete_issue_comment
- Pull Requests: get_pull_request, update_pull_request, merge_pull_request
- PR Comments: list_pull_request_comments, create_pull_request_comment, update_pull_request_comment, delete_pull_request_comment

Refs: #3
xcaliber reviewed 2026-01-15 13:08:54 +00:00
xcaliber left a comment
Author
Owner

Code Review: PR #4 - FAIL

Critical Issue Found

Bug in merge_pull_request function (lines ~2674-2706):

if merged:
    return f"**PR #{pr_number} Merged Successfully**\n\n"
    output += f"**Strategy:** {merge_strategy.upper()}\n"    # ❌ UNREACHABLE - return above
    if commit_sha:
        output += f"**Merge Commit:** `{commit_sha}`\n"     # ❌ UNREACHABLE
    output += f"\n✅ The pull request has been merged..."    # ❌ UNREACHABLE
else:
    return f"**PR #{pr_number} Merge Result:**\n\n{result}\n"

Problems:

  1. output variable is never defined before use
  2. Three lines of useful output are unreachable due to premature return
  3. Function will return only "**PR #{pr_number} Merged Successfully**" with no merge details

Minor Issues

  1. Duplicate docstring in _get_branch:
def _get_branch(self, branch: Optional[str], __user__: dict = None) -> str:
    """Get effective branch with priority resolution"""
    """Get effective branch with priority."""  # ← Duplicate
  1. Missing newline in merge_pull_request success return:
return f"**PR #{pr_number} Merged Successfully**\n\n"  # Missing output variable definition

Summary

Category Status
Issue CRUD (get, update, close, reopen, delete) Complete
Issue Comment CRUD Complete
PR CRUD (get, update, merge) ⚠️ merge has bug
PR Comment CRUD Complete
Code Organization Clean patterns
Error Handling Consistent
Event Emitters Present

Must fix the merge_pull_request bug before merge.

## Code Review: PR #4 - FAIL ❌ ### Critical Issue Found **Bug in `merge_pull_request` function (lines ~2674-2706):** ```python if merged: return f"**PR #{pr_number} Merged Successfully**\n\n" output += f"**Strategy:** {merge_strategy.upper()}\n" # ❌ UNREACHABLE - return above if commit_sha: output += f"**Merge Commit:** `{commit_sha}`\n" # ❌ UNREACHABLE output += f"\n✅ The pull request has been merged..." # ❌ UNREACHABLE else: return f"**PR #{pr_number} Merge Result:**\n\n{result}\n" ``` Problems: 1. `output` variable is never defined before use 2. Three lines of useful output are unreachable due to premature `return` 3. Function will return only `"**PR #{pr_number} Merged Successfully**"` with no merge details ### Minor Issues 1. **Duplicate docstring** in `_get_branch`: ```python def _get_branch(self, branch: Optional[str], __user__: dict = None) -> str: """Get effective branch with priority resolution""" """Get effective branch with priority.""" # ← Duplicate ``` 2. **Missing newline** in `merge_pull_request` success return: ```python return f"**PR #{pr_number} Merged Successfully**\n\n" # Missing output variable definition ``` ### Summary | Category | Status | |----------|--------| | Issue CRUD (get, update, close, reopen, delete) | ✅ Complete | | Issue Comment CRUD | ✅ Complete | | PR CRUD (get, update, merge) | ⚠️ merge has bug | | PR Comment CRUD | ✅ Complete | | Code Organization | ✅ Clean patterns | | Error Handling | ✅ Consistent | | Event Emitters | ✅ Present | **Must fix the `merge_pull_request` bug before merge.**
xcaliber added 1 commit 2026-01-15 13:11:09 +00:00
xcaliber added 1 commit 2026-01-15 13:11:19 +00:00
xcaliber reviewed 2026-01-15 13:11:25 +00:00
xcaliber left a comment
Author
Owner

All issues resolved:

  1. Fixed duplicate docstring in _get_branch - removed the second """Get effective branch with priority."""

  2. Fixed merge_pull_request bug:

    • Removed premature return statement that made output lines unreachable
    • Properly defined output variable before building the string
    • Now returns the full formatted output with strategy and commit SHA

Ready for re-review.

✅ All issues resolved: 1. **Fixed duplicate docstring** in `_get_branch` - removed the second `"""Get effective branch with priority."""` 2. **Fixed `merge_pull_request` bug:** - Removed premature `return` statement that made output lines unreachable - Properly defined `output` variable before building the string - Now returns the full formatted output with strategy and commit SHA Ready for re-review.
xcaliber added 1 commit 2026-01-15 13:19:26 +00:00
Implements all missing functions from issue #3:
- Issues: get_issue, update_issue, close_issue, reopen_issue, delete_issue
- Issue Comments: list_issue_comments, create_issue_comment, update_issue_comment, delete_issue_comment
- Pull Requests: get_pull_request, update_pull_request, merge_pull_request
- PR Comments: list_pull_request_comments, create_pull_request_comment, update_pull_request_comment, delete_pull_request_comment

Also fixes:
- Duplicate docstring in _get_branch
- merge_pull_request output variable bug (unreachable code)

Refs: #3
xcaliber added 1 commit 2026-01-15 13:38:29 +00:00
xcaliber added 1 commit 2026-01-15 13:44:46 +00:00
xcaliber merged commit dbfeca8271 into main 2026-01-15 13:45:16 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui-automation/tools#4
No description provided.