Reimplement issue dependencies on go-github v89 REST API#2839
Draft
tommaso-moro wants to merge 4 commits into
Draft
Reimplement issue dependencies on go-github v89 REST API#2839tommaso-moro wants to merge 4 commits into
tommaso-moro wants to merge 4 commits into
Conversation
Bumps google/go-github from v87 to v89 across the module and fixes the resulting breaking changes. No tool or behavior changes. - Rewrite all import paths go-github/v87 -> go-github/v89. - gists.go: Gists.Create now takes CreateGistRequest by value and Gists.Edit is renamed to Gists.Update taking UpdateGistRequest. - repositories_test.go: adapt to RepositoryRelease fields that became value types in v89 (ID, TagName, Draft). - Regenerate third-party license files for the new module path. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
59d76d6 to
9247ed7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the issue_dependency_read / issue_dependency_write feature-flagged tools from a GitHub GraphQL (githubv4) implementation to the first-class REST issue-dependency endpoints introduced in go-github/v89, aligning these tools with the rest of the REST-based issue tooling.
Changes:
- Reimplemented issue dependency reads/writes in
pkg/github/issue_dependencies.gousing REST (ListBlockedBy,ListBlocking,AddBlockedBy,RemoveBlockedBy) and page-based pagination (page/perPage). - Rewrote unit tests to use the REST mock backend helpers (dropping
githubv4mockfor this tool). - Updated the tool snapshot and regenerated feature-flag/insiders docs to reflect pagination parameter changes.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/issue_dependencies.go | Switches dependency tooling from GraphQL to REST and updates pagination shape. |
| pkg/github/issue_dependencies_test.go | Updates tests to mock REST endpoints and validate new pagination/output behavior. |
| pkg/github/toolsnaps/issue_dependency_read_ff_issue_dependencies.snap | Updates tool schema snapshot (cursor → page pagination). |
| docs/insiders-features.md | Regenerates docs to reflect page param and remove after. |
| docs/feature-flags.md | Regenerates docs to reflect page param and remove after. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 4
- Review effort level: Low
update_gist always sent Description as a pointer to the OptionalParam
zero value (""), so omitting description would overwrite an existing gist
description with an empty string. Only set UpdateGistRequest.Description
when the caller actually provided the argument; an explicit empty string
still clears it. Adds a test asserting the description key is absent from
the PATCH body when omitted and present when set.
This addresses a pre-existing behavior surfaced while migrating to the
v89 gist request types.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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>
9247ed7 to
5e5e7ec
Compare
6 tasks
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>
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/testI tested the tools manually too, example screenshot:

Docs