Skip to content

Move commit querying from Octokit to GraphQL#79

Merged
Malcolmnixon merged 4 commits intomainfrom
copilot/move-commit-querying-to-graphql
Feb 17, 2026
Merged

Move commit querying from Octokit to GraphQL#79
Malcolmnixon merged 4 commits intomainfrom
copilot/move-commit-querying-to-graphql

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Migration Plan: Move Commit Querying to GraphQL

  • Add GraphQL record types for commit queries in GitHubGraphQLTypes.cs
  • Create GetCommitsAsync method in GitHubGraphQLClient with pagination support
  • Update GitHubRepoConnector to use GraphQL client instead of Octokit
  • Add unit tests for the new GraphQL commit querying method
  • Verify existing tests still pass
  • Run code review and address feedback
  • Run security checks with CodeQL
  • Fix spell check errors

Summary

Successfully migrated commit querying from Octokit to GitHub's GraphQL API. This is another step toward retiring Octokit dependency.

Key Changes:

  • Added 6 new GraphQL record types to support commit history queries
  • Implemented GetCommitsAsync method with cursor-based pagination
  • Created internal Commit record to replace Octokit's GitHubCommit
  • Added automatic conversion of branch names to fully qualified refs
  • Added 8 comprehensive unit tests covering all edge cases
  • All 22 existing GitHubRepoConnector tests pass
  • No security vulnerabilities detected by CodeQL
  • All linting checks pass
Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: Move Commit Querying to GraphQL</issue_title>
<issue_description>### Problem Statement

The GitHubRepoConnector should switch getting repo branch commits from Octokit to the GitHubGraphQLClient.

Proposed Solution

Moving towards retiring Octokit, the GitHubRepoConnector should replace its GetAllCommitsAsync with an equivalent new method in GitHubGraphQLClient that queries for commits on the repo using GraphQL.

Just like the GitHubGraphQLClient FindIssueIdsLinkedToPullRequestAsync method, this new method should handle paging.

The new GraphQL records should be added to the GitHubGraphQLTypes.cs file.

Alternatives Considered

No response

Usage Examples

Benefits

This is another step along retiring Octokit.

Priority

Medium - Would improve my workflow

Willingness to Contribute

Yes, I can submit a pull request

Additional Context

No response

Checklist

  • I have searched existing issues to ensure this is not a duplicate
  • I have provided a clear description of the feature
  • I have explained why this feature would be useful</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 17, 2026 03:24
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Move commit querying to GraphQL for GitHubRepoConnector Move commit querying from Octokit to GraphQL Feb 17, 2026
Copilot AI requested a review from Malcolmnixon February 17, 2026 03:28
@Malcolmnixon
Copy link
Contributor

@copilot Somebody forgot to run the lint checks:

test/DemaConsulting.BuildMark.Tests/RepoConnectors/GitHub/GitHubGraphQLClientTests.cs:594:50 Unknown word (singlecommit)
test/DemaConsulting.BuildMark.Tests/RepoConnectors/GitHub/GitHubGraphQLClientTests.cs:616:26 Unknown word (singlecommit)

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 17, 2026

@copilot Somebody forgot to run the lint checks:

test/DemaConsulting.BuildMark.Tests/RepoConnectors/GitHub/GitHubGraphQLClientTests.cs:594:50 Unknown word (singlecommit)
...

Fixed in commit 7bccfc5. Changed "singlecommit123" to "abc123def456" to avoid the spell check error.

@Malcolmnixon Malcolmnixon marked this pull request as ready for review February 17, 2026 03:49
@Malcolmnixon Malcolmnixon merged commit 2e1f0fb into main Feb 17, 2026
11 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/move-commit-querying-to-graphql branch February 17, 2026 03:49
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.

[Feature]: Move Commit Querying to GraphQL

2 participants