Skip to content

Support assigning copilot to issues #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025

Conversation

williammartin
Copy link
Collaborator

Description

Closes: #398

This adds a new tool assign_copilot_to_issue, which...assigns copilot to an issue.

➜  github-mcp-server git:(398-add-a-tool-to-assign-copilot-to-issues) GOMAXPROCS=1 GITHUB_MCP_SERVER_E2E_HOST=https://github.com GITHUB_MCP_SERVER_E2E_TOKEN=$(gh auth token) go test -v -count=1 --run TestAssignCopilotToIssue --tags e2e ./e2e

=== RUN   TestAssignCopilotToIssue
=== PAUSE TestAssignCopilotToIssue
=== CONT  TestAssignCopilotToIssue
    e2e_test.go:79: Building Docker image for e2e tests...
    e2e_test.go:162: Starting Stdio MCP client...
    e2e_test.go:959: Getting current user...
    e2e_test.go:988: Creating repository williammartin/github-mcp-server-e2e-TestAssignCopilotToIssue-1747756871756...
    e2e_test.go:1011: Creating issue in williammartin/github-mcp-server-e2e-TestAssignCopilotToIssue-1747756871756...
    e2e_test.go:1025: Assigning copilot to issue in williammartin/github-mcp-server-e2e-TestAssignCopilotToIssue-1747756871756...
    e2e_test.go:997: Deleting repository williammartin/github-mcp-server-e2e-TestAssignCopilotToIssue-1747756871756...
--- PASS: TestAssignCopilotToIssue (5.23s)
PASS
ok      github.com/github/github-mcp-server/e2e 5.472s

Since the coding agent is in public preview, it can require configuring manually. Thus, the e2e test will skip if it gets an error that copilot could not be found as a reviewer.

➜  github-mcp-server git:(398-add-a-tool-to-assign-copilot-to-issues) GOMAXPROCS=1 GITHUB_MCP_SERVER_E2E_HOST=https://github.com GITHUB_MCP_SERVER_E2E_TOKEN=$(gh auth token) go test -v -count=1 --run TestAssignCopilotToIssue --tags e2e ./e2e

=== RUN   TestAssignCopilotToIssue
=== PAUSE TestAssignCopilotToIssue
=== CONT  TestAssignCopilotToIssue
    e2e_test.go:79: Building Docker image for e2e tests...
    e2e_test.go:162: Starting Stdio MCP client...
    e2e_test.go:959: Getting current user...
    e2e_test.go:988: Creating repository williammartin/github-mcp-server-e2e-TestAssignCopilotToIssue-1747756857173...
    e2e_test.go:1011: Creating issue in williammartin/github-mcp-server-e2e-TestAssignCopilotToIssue-1747756857173...
    e2e_test.go:1025: Assigning copilot to issue in williammartin/github-mcp-server-e2e-TestAssignCopilotToIssue-1747756857173...
    e2e_test.go:1034: skipping because copilot wasn't available as an assignee on this issue, it's likely that the owner doesn't have copilot enabled in their setttings <---------
    e2e_test.go:997: Deleting repository williammartin/github-mcp-server-e2e-TestAssignCopilotToIssue-1747756857173...
--- SKIP: TestAssignCopilotToIssue (5.93s)
PASS
ok      github.com/github/github-mcp-server/e2e 6.156s

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 16:05
@williammartin williammartin requested a review from a team as a code owner May 20, 2025 16:05
@williammartin williammartin force-pushed the 398-add-a-tool-to-assign-copilot-to-issues branch from b9f493e to b4da208 Compare May 20, 2025 16:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for assigning the Copilot bot to GitHub issues via a new tool and covers it with an end-to-end test.

  • Registers a new assign_copilot_to_issue tool in the server’s toolset
  • Implements the GraphQL logic to find and assign the Copilot bot
  • Extends E2E tests with TestAssignCopilotToIssue and related assertion fixes

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

File Description
pkg/github/tools.go Adds AssignCopilotToIssue to the initialized toolset
pkg/github/issues.go Implements the GraphQL-based assignment logic
internal/githubv4mock/*.go Adds typed-nil equality support in mock equality helpers and tests
e2e/e2e_test.go Introduces the end-to-end test for assigning Copilot to issues
Comments suppressed due to low confidence (2)

pkg/github/issues.go:11

  • The handler in AssignCopilotToIssue uses context.Context and fmt but neither package is imported; add import "context" and import "fmt" to avoid compile errors.
import (

e2e/e2e_test.go:990

  • The assertion message refers to 'get_me' but this call is for create_repository; update the message to reflect the correct tool name.
require.NoError(t, err, "expected to call 'get_me' tool successfully")

@williammartin williammartin force-pushed the 398-add-a-tool-to-assign-copilot-to-issues branch from b4da208 to 4ea2a1a Compare May 20, 2025 16:10
SamMorrowDrums
SamMorrowDrums previously approved these changes May 21, 2025
Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love @mntlty's suggestion of the docs link. Some agents might even follow it and tell the user what to do themselves. Or just do it themselves and become the event that caused the singularity.

Other than the two suggestions I think this is awesome.

@williammartin williammartin force-pushed the 398-add-a-tool-to-assign-copilot-to-issues branch from 4ea2a1a to da11920 Compare May 21, 2025 08:51
@williammartin
Copy link
Collaborator Author

williammartin commented May 21, 2025

I did a little work to provide a bit of structured data, and it seemed to work quite nicely with the focus on outcomes.

image

SamMorrowDrums
SamMorrowDrums previously approved these changes May 21, 2025
Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it a lot, one comment about the placement of the links, and whether that work as I hope or if it fails to help the user fix the issue because it doesn't suggest the link. LMK :-D

Co-authored-by: Martina Jireckova <martinajir@github.com>
@williammartin williammartin force-pushed the 398-add-a-tool-to-assign-copilot-to-issues branch from da11920 to 361bab9 Compare May 21, 2025 10:46
@SamMorrowDrums SamMorrowDrums merged commit b9a06d0 into main May 23, 2025
16 checks passed
@SamMorrowDrums SamMorrowDrums deleted the 398-add-a-tool-to-assign-copilot-to-issues branch May 23, 2025 05:04
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.

Add a tool to assign copilot to issues
3 participants