Implement SearchCommits API functionality for issue #145 - #284
Open
konard wants to merge 3 commits into
Open
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #145
This commit addresses issue #145 by implementing the SearchCommits functionality that was requested to be used when it becomes available in the Octokit library. ## Changes Made: ### 1. Upgrade Octokit.NET - Updated from version 7.0.1 to 14.0.0 (latest) - Fixed breaking changes (ID types changed from int to long) ### 2. SearchCommits Implementation - Added SearchCommits method to GitHubStorage class - Implemented direct HTTP API calls to GitHub's /search/commits endpoint - Created comprehensive data models matching GitHub API response structure - Added proper authentication support for Bearer and Basic tokens ### 3. Data Models Added: - SearchCommitsResult: Main result container - CommitSearchResult: Individual commit result - CommitSearchCommit, CommitSearchAuthor, CommitSearchTree: Supporting structures - CommitSearchRepository, CommitSearchOwner: Repository information ### 4. Example and Documentation - Created working example in examples/search-commits-example.cs - Added comprehensive documentation and usage scenarios - Demonstrates various search patterns (by repo, author, message, date range) ## Background: - Issue #145 references Octokit.NET issue #2425 which was closed as stale - SearchCommits API is available in GitHub REST API but not yet in Octokit.NET - This implementation provides immediate functionality while waiting for official support ## Usage: ```csharp var githubStorage = new GitHubStorage(username, token, appName); var results = await githubStorage.SearchCommits("repo:owner/repo author:username"); ``` The implementation bridges the gap until Octokit.NET officially adds SearchCommits support. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
konard
marked this pull request as ready for review
September 12, 2025 20:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Overview
This pull request implements the SearchCommits API functionality requested in issue #145. Since the Octokit.NET library does not yet support SearchCommits (as referenced in the closed Octokit.NET issue #2425), this implementation provides the functionality through direct GitHub API calls.
🔍 Issue Analysis
SearchCommitsapi when it will be added to octokit library #145 requested to useSearchCommitsAPI when available in Octokit library/search/commitsendpoint is available in GitHub REST API🚀 Implementation Details
1. Octokit.NET Upgrade
inttolong2. SearchCommits Method
Added to
GitHubStorageclass:Features:
/search/commitsendpoint3. Data Models
Created complete data model hierarchy:
SearchCommitsResult- Main container with TotalCount and ItemsCommitSearchResult- Individual commit information4. Usage Examples
📋 Files Changed
✅ Testing
🔮 Future Considerations
This implementation provides immediate functionality while waiting for official Octokit.NET support. When SearchCommits is eventually added to Octokit.NET, the implementation can be easily updated to use the official API while maintaining the same method signature and return types.
🎉 Solution Summary
✅ Issue #145 is now resolved
This implementation bridges the gap until Octokit.NET officially adds SearchCommits support.
Resolves #145