feat: Add commit and diff methods to GitLabClient#16
Conversation
…eracting with GitLab commits and diffs. These methods include: - get_commits - get_commit - get_commit_diff - create_commit - compare_refs - cherry_pick_commit - smart_diff - safe_preview_commit I also added a new unit test for the `smart_diff` method to ensure its functionality, including the handling of large diff files.
Code Review for PR #16: Add commit and diff methods to GitLabClientSummaryThis PR adds comprehensive commit and diff functionality to the GitLabClient class, including 8 new methods for interacting with GitLab commits and diffs, plus a unit test for the Strengths ✅
Issues and Suggestions 🔍1. Inconsistent Exception Handling
2. Missing Pagination Info
pagination = {
"page": page,
"per_page": per_page,
"total": getattr(commits, "total", None),
"total_pages": getattr(commits, "total_pages", None),
...
}3. Potential Bug in
|
Follow-up ReviewHi! I've checked the PR again, but it appears no changes have been pushed yet to address the review comments. The code remains the same as the original commit from yesterday. Current Status
Waiting for UpdatesThe following issues from my initial review are still pending resolution:
Please push the updates when ready, and I'll be happy to review the changes! If you need any clarification on the requested changes or would like help implementing any of them, please let me know. |
- Add @retry_on_error() decorators to all new methods for network resilience - Add pagination info to get_commits method - Fix file size check in smart_diff to use byte size instead of line count - Update default max_file_size to 100KB (100000 bytes) - Improve exception handling with specific GitLab exceptions - Add comprehensive docstrings with parameter descriptions - Add action validation for create_commit and safe_preview_commit - Fix test file typo (b_mode value) - Update test to match new byte-based file size logic
This change introduces new methods to the
GitLabClientto provide functionality for handling commits and diffs in GitLab. The primary addition is thesmart_diffmethod, which provides a way to get a diff between two refs while handling large files gracefully. A unit test for this new functionality is also included.