Skip to content

Reimplement issue dependencies on go-github v89 REST API#2839

Draft
tommaso-moro wants to merge 1 commit into
tommaso-moro-bump-go-github-v89from
tommaso-moro-issue-dependencies-go-github
Draft

Reimplement issue dependencies on go-github v89 REST API#2839
tommaso-moro wants to merge 1 commit into
tommaso-moro-bump-go-github-v89from
tommaso-moro-issue-dependencies-go-github

Conversation

@tommaso-moro

@tommaso-moro tommaso-moro commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Switches the issue_dependency_read / issue_dependency_write tools from the GraphQL (githubv4) implementation to the first-class REST methods added in go-github v89.

📚 Stacked on #2840 (the go-github v87 → v89 bump). Review/merge that first; this PR targets its branch and the diff here is just the feature change.

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 / RemoveBlockedByInput and 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

  • 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. Tool names, methods, the self-dependency guard, and cross-repo support are all preserved.
  • Rewrite the issue-dependency tests on the REST mock helpers (drop githubv4mock for this file).
  • Regenerate the read toolsnap (cursor → page pagination) and the feature-flag docs.

MCP impact

  • Tool schema or behavior changed
    • issue_dependency_read pagination changes from cursor-based (after) to standard REST page-based (page / perPage), matching other list tools. issue_dependency_write behavior is unchanged. Both remain gated behind the issue_dependencies feature 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):

Security / limits

  • Auth / permissions considered
    • Same repo scope and behavior as before; no change to data exposure. Dependency tools stay behind the issue_dependencies feature flag.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Updated (README / docs / examples)

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>
@tommaso-moro tommaso-moro force-pushed the tommaso-moro-issue-dependencies-go-github branch from 59d76d6 to 9247ed7 Compare July 8, 2026 10:17
@tommaso-moro tommaso-moro changed the base branch from main to tommaso-moro-bump-go-github-v89 July 8, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant