Skip to content

Replace Octokit with GraphQL for issue queries#87

Merged
Malcolmnixon merged 3 commits intomainfrom
copilot/use-graphql-query-for-issues
Feb 17, 2026
Merged

Replace Octokit with GraphQL for issue queries#87
Malcolmnixon merged 3 commits intomainfrom
copilot/use-graphql-query-for-issues

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Pull Request

Description

Completes GraphQL migration by replacing Octokit REST API calls for issue queries. This removes the last Octokit dependency from the project.

Changes:

  • GraphQL Types (GitHubGraphQLTypes.cs): Added GetAllIssuesResponse, IssueNodeData, IssueLabel record types with pagination support
  • GraphQL Client (GitHubGraphQLClient.cs): New GetAllIssuesAsync method queries all issue states with automatic pagination
  • Connector Refactor (GitHubRepoConnector.cs): Replaced Octokit types with internal IssueInfo and IssueLabelInfo records, updated FetchGitHubDataAsync to use GraphQL exclusively
  • Dependency Cleanup: Removed Octokit v14.0.0 package reference
  • Tests: Added GitHubGraphQLClientGetAllIssuesTests with 7 test cases covering pagination, error handling, and edge cases

Example:

// Old: Octokit REST API
var issues = await client.Issue.GetAllForRepository(owner, repo, 
    new RepositoryIssueRequest { State = ItemStateFilter.All });

// New: GraphQL with internal types
var issues = await GetAllIssuesAsync(graphqlClient, owner, repo);

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Code quality improvement

Related Issues

Issue linking handled by GitHub automation.

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All tests pass: dotnet test --configuration Release
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • Spell checker passes: cspell "**/*.{md,cs}"
  • Markdown linter passes: markdownlint "**/*.md"
  • YAML linter passes: yamllint '**/*.{yml,yaml}'

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

All 170 tests passing across .NET 8/9/10. CodeQL security scan reports 0 alerts.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Release/net10.0/DemaConsulting.BuildMark.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Release/net10.0/DemaConsulting.BuildMark.Tests.deps.json /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Release/net10.0/testhost.dll --port 41189 --endpoint 127.0.0.1:041189 --role client --parentprocessid 5220 --telemetryoptedin false (http block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Release/net8.0/DemaConsulting.BuildMark.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Release/net8.0/DemaConsulting.BuildMark.Tests.deps.json /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Release/net8.0/testhost.dll --port 38471 --endpoint 127.0.0.1:038471 --role client --parentprocessid 5226 --telemetryoptedin false (http block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Release/net9.0/DemaConsulting.BuildMark.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Release/net9.0/DemaConsulting.BuildMark.Tests.deps.json /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Release/net9.0/testhost.dll --port 36917 --endpoint 127.0.0.1:036917 --role client --parentprocessid 5232 --telemetryoptedin false (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: Use GraphQL to query repository issues</issue_title>
<issue_description>### Problem Statement

The Octokit API to query repository issues should be replaced with GraphQL.

Proposed Solution

The GitHubRepoConnector calls client.Issue.GetAllForRepository(owner, repo, new RepositoryIssueRequest { State = ItemStateFilter.All }) to get all issues (in any state).

This should be replaced with a call to a new GitHubGraphQLClient.GetAllIssues method. The method should also hard-code querying for issues in all states and handle all paging. The new record types should be created in GitHubGraphQLTypes.cs

The tests should be written in a GitHubGraphQLClientGetAllIssuesTests.cs class.

This should also be the last use of Octokit in the project, and so it should be removed and any final cleanup performed.

Alternatives Considered

No response

Usage Examples

Benefits

Removal of last Octokit methods and types.

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 14:56
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] Replace Octokit API with GraphQL for querying issues Replace Octokit with GraphQL for issue queries Feb 17, 2026
Copilot AI requested a review from Malcolmnixon February 17, 2026 15:06
@Malcolmnixon Malcolmnixon marked this pull request as ready for review February 17, 2026 15:25
@Malcolmnixon Malcolmnixon merged commit 1820ade into main Feb 17, 2026
11 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/use-graphql-query-for-issues branch February 17, 2026 15:26
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]: Use GraphQL to query repository issues

2 participants