Skip to content

feat: Add Issue Dependencies API support#4130

Open
tommaso-moro wants to merge 25 commits intogoogle:masterfrom
tommaso-moro:tommy/issue-dependencies-support
Open

feat: Add Issue Dependencies API support#4130
tommaso-moro wants to merge 25 commits intogoogle:masterfrom
tommaso-moro:tommy/issue-dependencies-support

Conversation

@tommaso-moro
Copy link
Copy Markdown

@tommaso-moro tommaso-moro commented Apr 2, 2026

closes: #4129

Add Issue Dependencies API support

Add support for the Issue Dependencies REST API.

Changes

New file github/issues_dependencies.go adds four methods to IssuesService:

Method Endpoint Description
ListBlockedBy GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by List dependencies blocking an issue
AddBlockedBy POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by Add a blocking dependency
RemoveBlockedBy DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id} Remove a blocking dependency
ListBlocking GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking List issues this issue is blocking

Also adds IssueDependencyRequest type used by AddBlockedBy.

Testing

Full test coverage in github/issues_dependencies_test.go (12 tests) using standard helpers: testBadOptions, testNewRequestAndDoFailure, testURLParseError, testJSONMarshal.

Auto-generated files updated via go generate: accessors, accessor tests, iterators, and iterator tests.

All scripts pass: script/fmt.sh, script/test.sh, script/lint.sh.

Add four new methods to IssuesService for the Issue
Dependencies REST API (apiVersion 2026-03-10):

- ListBlockedBy: list dependencies blocking an issue
- AddBlockedBy: add a blocking dependency to an issue
- RemoveBlockedBy: remove a blocking dependency
- ListBlocking: list issues that an issue is blocking

Includes IssueDependencyRequest type, full test coverage
with testBadOptions, testNewRequestAndDoFailure,
testURLParseError, and testJSONMarshal helpers.
Run go generate to add:
- GetIssueID accessor for IssueDependencyRequest
- ListBlockedBy and ListBlocking iterators with tests
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 2, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.73%. Comparing base (f12c950) to head (dfd8467).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4130      +/-   ##
==========================================
+ Coverage   93.70%   93.73%   +0.02%     
==========================================
  Files         210      211       +1     
  Lines       19745    19825      +80     
==========================================
+ Hits        18502    18582      +80     
  Misses       1047     1047              
  Partials      196      196              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tommaso-moro tommaso-moro marked this pull request as ready for review April 2, 2026 14:46
Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @tommaso-moro!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Apr 2, 2026
Comment thread github/issues_dependencies.go Outdated
Comment thread github/issues_dependencies.go Outdated
Comment thread github/issues_dependencies.go Outdated
@tommaso-moro
Copy link
Copy Markdown
Author

@Not-Dhananjay-Mishra thank you for the review! I have addressed the points you raised and updated this branch.

Comment thread github/issues.go Outdated
Comment thread github/issues_dependencies.go Outdated
Comment thread github/issues_dependencies.go Outdated
Comment thread github/issues_dependencies.go Outdated
Comment thread github/issues_dependencies.go Outdated
Comment thread github/issues_dependencies.go Outdated
Comment thread github/issues_dependencies_test.go Outdated
@tommaso-moro tommaso-moro requested a review from alexandear April 9, 2026 10:22
Comment thread github/issues.go Outdated
Comment thread github/issues.go Outdated
Comment thread github/issues.go Outdated
Comment thread github/issues.go Outdated
Comment thread github/issues.go Outdated
Comment thread github/issues_dependencies.go Outdated
@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Apr 23, 2026

@tommaso-moro - please fix the broken tests before we proceed.

// Stringify always prints non-pointer value fields (ints, strings, etc.) but
// skips nil pointers/slices/maps, so only structs containing non-pointer
// value fields need an entry here.
namedStructZeroStr = map[string]string{
Copy link
Copy Markdown
Author

@tommaso-moro tommaso-moro Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This map must be kept in sync with the struct definitions manually, not sure if fine for now but open to suggestions for a better approach!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you revert all the changes made to gen-stringify-test.go, what exactly breaks?

If it is simply the formatting in a unit test, then I would say that I would rather update those broken unit tests than to make a new map of special special cases in gen-strigify-test.go.

Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, @tommaso-moro - but I'm not OK with the changes to gen-stringify-test.go that were made since my last code review (and prior approval).

There should be no reason to add this extra maintenance burden to this code.

I'm going to have to go through all the comments and try to figure out why you added this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Issue Dependencies REST API

5 participants