Reimplement issue dependencies on go-github v89 REST API#2839
Draft
tommaso-moro wants to merge 1 commit into
Draft
Reimplement issue dependencies on go-github v89 REST API#2839tommaso-moro wants to merge 1 commit into
tommaso-moro wants to merge 1 commit into
Conversation
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>
59d76d6 to
9247ed7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switches the
issue_dependency_read/issue_dependency_writetools from the GraphQL (githubv4) implementation to the first-class REST methods added in go-github v89.Why
Issue dependencies (added in #2751) were built on GraphQL via githubv4. Because the pinned githubv4 library predates the dependency mutations, the code had to hand-declare
AddBlockedByInput/RemoveBlockedByInputand resolve issue numbers to node IDs with a custom aliased query. go-github v89 now exposes maintained, typed REST methods (ListBlockedBy,ListBlocking,AddBlockedBy,RemoveBlockedBy), so the tools can drop the workaround and align with the rest of the REST-based issue tooling.Refs #950 (original feature request; the capability itself already shipped in #2751 — this PR is a cleanup onto the public REST API).
What changed
issue_dependencies.goon REST: page-based pagination for reads, and a singleIssues.Getto resolve the blocking issue's database ID for writes. Tool names, methods, the self-dependency guard, and cross-repo support are all preserved.githubv4mockfor this file).MCP impact
issue_dependency_readpagination changes from cursor-based (after) to standard REST page-based (page/perPage), matching other list tools.issue_dependency_writebehavior is unchanged. Both remain gated behind theissue_dependenciesfeature flag.Prompts tested (tool changes only)
Covered by unit tests against the REST mock (both tools are feature-flagged; not exercised via live e2e here):
issue_dependency_read/get_blocked_byissue_dependency_read/get_blockingissue_dependency_write/ add + blocked_byissue_dependency_write/ remove + blockingSecurity / limits
reposcope and behavior as before; no change to data exposure. Dependency tools stay behind theissue_dependenciesfeature flag.Tool renaming
Lint & tests
./script/lint./script/testDocs