Skip to content

Commit 8aa3379

Browse files
authored
Migrate list_issues tool from REST to GraphQL API (#833)
* initial changes * Further advances on list_issues tool to use GRPC * Updating pagination for Graphql ListIssues * Sorting data structures & returning mapped Issue * Adding dynamic label queries * Adding dynamic state queries for list_issues * Add optional since filter, to get issues based on last update to issue * Move ListIssues test to graphql format & removal of temp file * Update documentation and fix linter issues * Removal of redundant code, and increase limit on label return * Fixing context for status to allow for better interactions * Update tool snaps with tool description * Update docs for final changes to context
1 parent d65d1d5 commit 8aa3379

File tree

5 files changed

+511
-180
lines changed

5 files changed

+511
-180
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,15 +539,15 @@ The following sets of tools are available (all are on by default):
539539
- `repo`: Repository name (string, required)
540540

541541
- **list_issues** - List issues
542-
- `direction`: Sort direction (string, optional)
542+
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
543+
- `direction`: Order direction. If provided, the 'orderBy' also needs to be provided. (string, optional)
543544
- `labels`: Filter by labels (string[], optional)
545+
- `orderBy`: Order issues by field. If provided, the 'direction' also needs to be provided. (string, optional)
544546
- `owner`: Repository owner (string, required)
545-
- `page`: Page number for pagination (min 1) (number, optional)
546547
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
547548
- `repo`: Repository name (string, required)
548549
- `since`: Filter by date (ISO 8601 timestamp) (string, optional)
549-
- `sort`: Sort order (string, optional)
550-
- `state`: Filter by state (string, optional)
550+
- `state`: Filter by state, by default both open and closed issues are returned when not provided (string, optional)
551551

552552
- **list_sub_issues** - List sub-issues
553553
- `issue_number`: Issue number (number, required)

pkg/github/__toolsnaps__/list_issues.snap

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
"title": "List issues",
44
"readOnlyHint": true
55
},
6-
"description": "List issues in a GitHub repository.",
6+
"description": "List issues in a GitHub repository. For pagination, use the 'endCursor' from the previous response's 'pageInfo' in the 'after' parameter.",
77
"inputSchema": {
88
"properties": {
9+
"after": {
10+
"description": "Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs.",
11+
"type": "string"
12+
},
913
"direction": {
10-
"description": "Sort direction",
14+
"description": "Order direction. If provided, the 'orderBy' also needs to be provided.",
1115
"enum": [
12-
"asc",
13-
"desc"
16+
"ASC",
17+
"DESC"
1418
],
1519
"type": "string"
1620
},
@@ -21,15 +25,18 @@
2125
},
2226
"type": "array"
2327
},
28+
"orderBy": {
29+
"description": "Order issues by field. If provided, the 'direction' also needs to be provided.",
30+
"enum": [
31+
"CREATED_AT",
32+
"UPDATED_AT"
33+
],
34+
"type": "string"
35+
},
2436
"owner": {
2537
"description": "Repository owner",
2638
"type": "string"
2739
},
28-
"page": {
29-
"description": "Page number for pagination (min 1)",
30-
"minimum": 1,
31-
"type": "number"
32-
},
3340
"perPage": {
3441
"description": "Results per page for pagination (min 1, max 100)",
3542
"maximum": 100,
@@ -44,21 +51,11 @@
4451
"description": "Filter by date (ISO 8601 timestamp)",
4552
"type": "string"
4653
},
47-
"sort": {
48-
"description": "Sort order",
49-
"enum": [
50-
"created",
51-
"updated",
52-
"comments"
53-
],
54-
"type": "string"
55-
},
5654
"state": {
57-
"description": "Filter by state",
55+
"description": "Filter by state, by default both open and closed issues are returned when not provided",
5856
"enum": [
59-
"open",
60-
"closed",
61-
"all"
57+
"OPEN",
58+
"CLOSED"
6259
],
6360
"type": "string"
6461
}

0 commit comments

Comments
 (0)