feat: Add Issue Dependencies API support#4130
feat: Add Issue Dependencies API support#4130tommaso-moro wants to merge 25 commits intogoogle:masterfrom
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 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. 🚀 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 <[email protected]>
Co-authored-by: Oleksandr Redko <[email protected]>
…dependencies.go Co-authored-by: Oleksandr Redko <[email protected]>
Co-authored-by: Oleksandr Redko <[email protected]>
Per review feedback: both issue_id and issue_number are integer in the OpenAPI spec, so issueNumber should be int64 for consistency.
|
@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{ |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
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.
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.