Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ The following sets of tools are available:
- `repo`: Repository name (string, required)

- **assign_copilot_to_issue** - Assign Copilot to issue
- `issueNumber`: Issue number (number, required)
- `issue_number`: Issue number (number, required)
- `owner`: Repository owner (string, required)
- `repo`: Repository name (string, required)

Expand Down
14 changes: 7 additions & 7 deletions pkg/github/__toolsnaps__/assign_copilot_to_issue.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
"description": "Assign Copilot to a specific issue in a GitHub repository.\n\nThis tool can help with the following outcomes:\n- a Pull Request created with source code changes to resolve the issue\n\n\nMore information can be found at:\n- https://docs.github.com/en/copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-tasks/about-assigning-tasks-to-copilot\n",
"inputSchema": {
"type": "object",
"required": [
"owner",
"repo",
"issueNumber"
],
"properties": {
"issueNumber": {
"issue_number": {
"type": "number",
"description": "Issue number"
},
Expand All @@ -24,7 +19,12 @@
"type": "string",
"description": "Repository name"
}
}
},
"required": [
"owner",
"repo",
"issue_number"
]
},
"name": "assign_copilot_to_issue",
"icons": [
Expand Down
10 changes: 5 additions & 5 deletions pkg/github/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -1626,19 +1626,19 @@ func AssignCopilotToIssue(t translations.TranslationHelperFunc) inventory.Server
Type: "string",
Description: "Repository name",
},
"issueNumber": {
"issue_number": {
Type: "number",
Description: "Issue number",
},
},
Required: []string{"owner", "repo", "issueNumber"},
Required: []string{"owner", "repo", "issue_number"},
},
},
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
var params struct {
Owner string
Repo string
IssueNumber int32
Owner string `mapstructure:"owner"`
Repo string `mapstructure:"repo"`
IssueNumber int32 `mapstructure:"issue_number"`
}
if err := mapstructure.Decode(args, &params); err != nil {
return utils.NewToolResultError(err.Error()), nil, nil
Expand Down
28 changes: 14 additions & 14 deletions pkg/github/issues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2175,8 +2175,8 @@ func TestAssignCopilotToIssue(t *testing.T) {
assert.NotEmpty(t, tool.Description)
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "owner")
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "repo")
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "issueNumber")
assert.ElementsMatch(t, tool.InputSchema.(*jsonschema.Schema).Required, []string{"owner", "repo", "issueNumber"})
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "issue_number")
assert.ElementsMatch(t, tool.InputSchema.(*jsonschema.Schema).Required, []string{"owner", "repo", "issue_number"})

var pageOfFakeBots = func(n int) []struct{} {
// We don't _really_ need real bots here, just objects that count as entries for the page
Expand All @@ -2197,9 +2197,9 @@ func TestAssignCopilotToIssue(t *testing.T) {
{
name: "successful assignment when there are no existing assignees",
requestArgs: map[string]any{
"owner": "owner",
"repo": "repo",
"issueNumber": float64(123),
"owner": "owner",
"repo": "repo",
"issue_number": float64(123),
},
mockedClient: githubv4mock.NewMockedHTTPClient(
githubv4mock.NewQueryMatcher(
Expand Down Expand Up @@ -2286,9 +2286,9 @@ func TestAssignCopilotToIssue(t *testing.T) {
{
name: "successful assignment when there are existing assignees",
requestArgs: map[string]any{
"owner": "owner",
"repo": "repo",
"issueNumber": float64(123),
"owner": "owner",
"repo": "repo",
"issue_number": float64(123),
},
mockedClient: githubv4mock.NewMockedHTTPClient(
githubv4mock.NewQueryMatcher(
Expand Down Expand Up @@ -2386,9 +2386,9 @@ func TestAssignCopilotToIssue(t *testing.T) {
{
name: "copilot bot not on first page of suggested actors",
requestArgs: map[string]any{
"owner": "owner",
"repo": "repo",
"issueNumber": float64(123),
"owner": "owner",
"repo": "repo",
"issue_number": float64(123),
},
mockedClient: githubv4mock.NewMockedHTTPClient(
// First page of suggested actors
Expand Down Expand Up @@ -2512,9 +2512,9 @@ func TestAssignCopilotToIssue(t *testing.T) {
{
name: "copilot not a suggested actor",
requestArgs: map[string]any{
"owner": "owner",
"repo": "repo",
"issueNumber": float64(123),
"owner": "owner",
"repo": "repo",
"issue_number": float64(123),
},
mockedClient: githubv4mock.NewMockedHTTPClient(
githubv4mock.NewQueryMatcher(
Expand Down