feat: Add Issue Dependencies API support#4130
Conversation
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
|
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4130 +/- ##
==========================================
+ Coverage 97.47% 97.48% +0.01%
==========================================
Files 192 193 +1
Lines 19320 19400 +80
==========================================
+ Hits 18832 18912 +80
Misses 270 270
Partials 218 218 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
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
|
@Not-Dhananjay-Mishra thank you for the review! I have addressed the points you raised and updated this branch. |
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
…dependencies.go Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Per review feedback: both issue_id and issue_number are integer in the OpenAPI spec, so issueNumber should be int64 for consistency.
gmlewis
left a comment
There was a problem hiding this comment.
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.
…dencies-support # Conflicts: # github/github-accessors.go # github/github-accessors_test.go # github/issues.go
|
Apologies for letting this sit so long. Thanks for your patience, and for the earlier reviews @gmlewis @alexandear. @gmlewis you were right about Also merged in the latest master and resolved the conflicts. |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @tommaso-moro!
Just one question and one minor nit, otherwise LGTM.
|
@tommaso-moro - EDIT: Resolved, thank you! |
Addresses review feedback that issueNumber and issueID are easy to confuse. blockingIssueID makes it clear which issue is being removed as a blocker.
d0ec43f to
d7a57bd
Compare
IssueDependencyRequest has no custom MarshalJSON, so the test only exercises the standard library's encoding/json. Per the project convention (google#4253), marshal tests are reserved for types with custom (Un)MarshalJSON implementations.
|
Thank you, @tommaso-moro , @Not-Dhananjay-Mishra , @alexandear, and @munlicode! |
closes: #4129
Add Issue Dependencies API support
Add support for the Issue Dependencies REST API.
Changes
New file
github/issues_dependencies.goadds four methods toIssuesService:ListBlockedByGET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_byAddBlockedByPOST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_byRemoveBlockedByDELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}ListBlockingGET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blockingAlso adds
IssueDependencyRequesttype used byAddBlockedBy.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.