Skip to content

Commit 6787f08

Browse files
Reimplement issue dependencies on go-github v89 REST API (#2839)
* Reimplement issue dependencies on go-github v89 REST API Issue dependencies (blocked_by / blocking) were implemented on GraphQL via githubv4. Because the pinned githubv4 library predates the dependency mutations, the code hand-declared AddBlockedByInput / RemoveBlockedByInput and resolved issue numbers to node IDs with a custom aliased query. go-github v89 adds first-class REST methods (ListBlockedBy, ListBlocking, AddBlockedBy, RemoveBlockedBy), so switch issue_dependency_read and issue_dependency_write to those. This removes the workaround, aligns the tools with the rest of the REST-based issue tooling, and simplifies tests. - Rewrite issue_dependencies.go on REST: page-based pagination for reads, and a single Issues.Get to resolve the blocking issue's database ID for writes. Preserve the tool surface, self-dependency guard and cross-repo support. - Rewrite the issue dependency tests on the REST mock helpers. - Regenerate the read toolsnap (cursor -> page pagination) and docs. Refs #950 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Normalize issue dependency ref state to match other tools The REST issue-dependency endpoints return lower-case issue states (open/closed), whereas the previous GraphQL implementation and the sibling get_parent tool populate MinimalIssueRef.State from the GraphQL IssueState enum (OPEN/CLOSED). Upper-case the state in issueToDependencyRef so the field stays consistent across every tool that emits a MinimalIssueRef, and guard against a nil issue while here. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 778f5bb commit 6787f08

5 files changed

Lines changed: 292 additions & 395 deletions

File tree

docs/feature-flags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,14 @@ runtime behavior (such as output formatting) won't appear here.
310310

311311
- **issue_dependency_read** - Read issue dependencies
312312
- **Required OAuth Scopes**: `repo`
313-
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
314313
- `issue_number`: The number of the issue (number, required)
315314
- `method`: The read operation to perform on a single issue's dependencies.
316315
Options are:
317316
1. get_blocked_by - List the issues that block this issue (this issue is blocked by them).
318317
2. get_blocking - List the issues that this issue blocks.
319318
(string, required)
320319
- `owner`: The owner of the repository (string, required)
320+
- `page`: Page number for pagination (min 1) (number, optional)
321321
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
322322
- `repo`: The name of the repository (string, required)
323323

docs/insiders-features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ The list below is generated from the Go source. It covers tool **inventory and s
105105

106106
- **issue_dependency_read** - Read issue dependencies
107107
- **Required OAuth Scopes**: `repo`
108-
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
109108
- `issue_number`: The number of the issue (number, required)
110109
- `method`: The read operation to perform on a single issue's dependencies.
111110
Options are:
112111
1. get_blocked_by - List the issues that block this issue (this issue is blocked by them).
113112
2. get_blocking - List the issues that this issue blocks.
114113
(string, required)
115114
- `owner`: The owner of the repository (string, required)
115+
- `page`: Page number for pagination (min 1) (number, optional)
116116
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
117117
- `repo`: The name of the repository (string, required)
118118

pkg/github/__toolsnaps__/issue_dependency_read_ff_issue_dependencies.snap

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
"description": "Read an issue's dependency relationships in a GitHub repository: the issues that block it (blocked_by) or the issues it blocks (blocking).",
88
"inputSchema": {
99
"properties": {
10-
"after": {
11-
"description": "Cursor for pagination. Use the cursor from the previous response.",
12-
"type": "string"
13-
},
1410
"issue_number": {
1511
"description": "The number of the issue",
1612
"type": "number"
@@ -27,6 +23,11 @@
2723
"description": "The owner of the repository",
2824
"type": "string"
2925
},
26+
"page": {
27+
"description": "Page number for pagination (min 1)",
28+
"minimum": 1,
29+
"type": "number"
30+
},
3031
"perPage": {
3132
"description": "Results per page for pagination (min 1, max 100)",
3233
"maximum": 100,

0 commit comments

Comments
 (0)