Skip to content
Open
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
90 changes: 90 additions & 0 deletions pkg/github/__toolsnaps__/create_project_issue.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"annotations": {
"destructiveHint": false,
"openWorldHint": true,
"title": "Create project issue"
},
"description": "Create a GitHub issue, add it to a GitHub Project, and set initial project Status and Priority fields.",
"inputSchema": {
"properties": {
"assignees": {
"description": "GitHub usernames to assign to this issue",
"items": {
"type": "string"
},
"type": "array"
},
"body": {
"description": "Issue body content",
"type": "string"
},
"labels": {
"description": "Labels to apply to the issue",
"items": {
"type": "string"
},
"type": "array"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"priority_field_id": {
"description": "Project Priority field ID.",
"type": "number"
},
"priority_value": {
"description": "Initial Priority field value or option ID.",
"type": "string"
},
"project_number": {
"description": "The project's number.",
"type": "number"
},
"project_owner": {
"description": "Project owner login. Defaults to the repository owner when omitted.",
"type": "string"
},
"project_owner_type": {
"description": "Project owner type.",
"enum": [
"user",
"org"
],
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
},
"status_field_id": {
"description": "Project Status field ID.",
"type": "number"
},
"status_value": {
"description": "Initial Status field value or option ID. For github-workflow this should be Backlog's option ID.",
"type": "string"
},
"title": {
"description": "Issue title",
"type": "string"
},
"type": {
"description": "Issue type name, when the repository supports issue types",
"type": "string"
}
},
"required": [
"owner",
"repo",
"title",
"project_number",
"status_field_id",
"status_value",
"priority_field_id",
"priority_value"
],
"type": "object"
},
"name": "create_project_issue"
}
43 changes: 43 additions & 0 deletions pkg/github/__toolsnaps__/issue_dependency_write.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"annotations": {
"title": "Change issue dependency"
},
"description": "Add or remove issue dependencies in a GitHub repository.",
"inputSchema": {
"properties": {
"issue_id": {
"description": "The ID of the related issue to add or remove as a blocking dependency",
"type": "number"
},
"issue_number": {
"description": "The issue number to modify",
"type": "number"
},
"method": {
"description": "The action to perform on an issue dependency.\nOptions are:\n- 'add_blocked_by' - add a blocking dependency to the issue.\n- 'remove_blocked_by' - remove a blocking dependency from the issue.\n",
"enum": [
"add_blocked_by",
"remove_blocked_by"
],
"type": "string"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
}
},
"required": [
"method",
"owner",
"repo",
"issue_number",
"issue_id"
],
"type": "object"
},
"name": "issue_dependency_write"
}
46 changes: 46 additions & 0 deletions pkg/github/__toolsnaps__/issue_label_write.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"annotations": {
"title": "Change issue labels"
},
"description": "Add or remove labels on an issue without replacing unrelated labels.",
"inputSchema": {
"properties": {
"issue_number": {
"description": "Issue number to update",
"type": "number"
},
"labels": {
"description": "Labels to add or remove",
"items": {
"type": "string"
},
"type": "array"
},
"method": {
"description": "The label operation to perform.",
"enum": [
"add",
"remove"
],
"type": "string"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
}
},
"required": [
"method",
"owner",
"repo",
"issue_number",
"labels"
],
"type": "object"
},
"name": "issue_label_write"
}
6 changes: 4 additions & 2 deletions pkg/github/__toolsnaps__/issue_read.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
"type": "number"
},
"method": {
"description": "The read operation to perform on a single issue.\nOptions are:\n1. get - Get details of a specific issue.\n2. get_comments - Get issue comments.\n3. get_sub_issues - Get sub-issues of the issue.\n4. get_labels - Get labels assigned to the issue.\n",
"description": "The read operation to perform on a single issue.\nOptions are:\n1. get - Get details of a specific issue.\n2. get_comments - Get issue comments.\n3. get_sub_issues - Get sub-issues of the issue.\n4. get_labels - Get labels assigned to the issue.\n5. get_dependencies_blocked_by - Get dependencies that block the issue.\n6. get_dependencies_blocking - Get dependencies the issue is blocking.\n",
"enum": [
"get",
"get_comments",
"get_sub_issues",
"get_labels"
"get_labels",
"get_dependencies_blocked_by",
"get_dependencies_blocking"
],
"type": "string"
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/github/__toolsnaps__/label_write.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"annotations": {
"title": "Write operations on repository labels."
},
"description": "Perform write operations on repository labels. To set labels on issues, use the 'update_issue' tool.",
"description": "Perform write operations on repository labels. To add or remove labels on issues, use the 'issue_label_write' tool.",
"inputSchema": {
"properties": {
"color": {
Expand Down Expand Up @@ -48,4 +48,4 @@
"type": "object"
},
"name": "label_write"
}
}
13 changes: 10 additions & 3 deletions pkg/github/__toolsnaps__/projects_write.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "number"
},
"item_id": {
"description": "The project item ID. Required for 'update_project_item' and 'delete_project_item' methods.",
"description": "The numeric project item ID. Required for 'delete_project_item'. For 'update_project_item', provide this or identify the content with item_owner, item_repo, item_type, and issue_number or pull_request_number.",
"type": "number"
},
"item_owner": {
Expand Down Expand Up @@ -84,8 +84,15 @@
"type": "string"
},
"updated_field": {
"description": "Object consisting of the ID of the project field to update and the new value for the field. To clear the field, set value to null. Example: {\"id\": 123456, \"value\": \"New Value\"}. Required for 'update_project_item' method.",
"description": "Object consisting of the ID of the project field to update and the new value for the field. To clear the field, set value to null. Example: {\"id\": 123456, \"value\": \"New Value\"}. For 'update_project_item', provide updated_field or updated_fields.",
"type": "object"
},
"updated_fields": {
"description": "List of project field updates, each with the field ID and new value. Example: [{\"id\": 123456, \"value\": \"In Progress\"}, {\"id\": 234567, \"value\": \"P1\"}].",
"items": {
"type": "object"
},
"type": "array"
}
},
"required": [
Expand All @@ -96,4 +103,4 @@
"type": "object"
},
"name": "projects_write"
}
}
25 changes: 16 additions & 9 deletions pkg/github/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,22 @@ const (
GetReposCommitsCheckRunsByOwnerByRepoByRef = "GET /repos/{owner}/{repo}/commits/{ref}/check-runs"

// Issues endpoints
GetReposIssuesByOwnerByRepoByIssueNumber = "GET /repos/{owner}/{repo}/issues/{issue_number}"
GetReposIssuesCommentsByOwnerByRepoByIssueNumber = "GET /repos/{owner}/{repo}/issues/{issue_number}/comments"
PostReposIssuesByOwnerByRepo = "POST /repos/{owner}/{repo}/issues"
PostReposIssuesCommentsByOwnerByRepoByIssueNumber = "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
PatchReposIssuesByOwnerByRepoByIssueNumber = "PATCH /repos/{owner}/{repo}/issues/{issue_number}"
GetReposIssuesSubIssuesByOwnerByRepoByIssueNumber = "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"
PostReposIssuesSubIssuesByOwnerByRepoByIssueNumber = "POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"
DeleteReposIssuesSubIssueByOwnerByRepoByIssueNumber = "DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"
PatchReposIssuesSubIssuesPriorityByOwnerByRepoByIssueNumber = "PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"
GetReposIssuesByOwnerByRepoByIssueNumber = "GET /repos/{owner}/{repo}/issues/{issue_number}"
GetReposIssuesCommentsByOwnerByRepoByIssueNumber = "GET /repos/{owner}/{repo}/issues/{issue_number}/comments"
PostReposIssuesByOwnerByRepo = "POST /repos/{owner}/{repo}/issues"
PostReposIssuesCommentsByOwnerByRepoByIssueNumber = "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
PatchReposIssuesByOwnerByRepoByIssueNumber = "PATCH /repos/{owner}/{repo}/issues/{issue_number}"
GetReposIssuesLabelsByOwnerByRepoByIssueNumber = "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
PostReposIssuesLabelsByOwnerByRepoByIssueNumber = "POST /repos/{owner}/{repo}/issues/{issue_number}/labels"
DeleteReposIssuesLabelsByOwnerByRepoByIssueNumberByName = "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
GetReposIssuesDependenciesBlockedByByOwnerByRepoByIssueNumber = "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"
PostReposIssuesDependenciesBlockedByByOwnerByRepoByIssueNumber = "POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"
DeleteReposIssuesDependenciesBlockedByByOwnerByRepoByIssueNumberByIssueID = "DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"
GetReposIssuesDependenciesBlockingByOwnerByRepoByIssueNumber = "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"
GetReposIssuesSubIssuesByOwnerByRepoByIssueNumber = "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"
PostReposIssuesSubIssuesByOwnerByRepoByIssueNumber = "POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"
DeleteReposIssuesSubIssueByOwnerByRepoByIssueNumber = "DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"
PatchReposIssuesSubIssuesPriorityByOwnerByRepoByIssueNumber = "PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"

// Pull request endpoints
GetReposPullsByOwnerByRepo = "GET /repos/{owner}/{repo}/pulls"
Expand Down
Loading