feat: Add Stack field to PullRequest for stacked pull requests - #4423
Conversation
Stack field to PullRequest for stacked pull requests
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4423 +/- ##
=======================================
Coverage 97.54% 97.54%
=======================================
Files 194 194
Lines 19765 19765
=======================================
Hits 19279 19279
Misses 268 268
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, @joeljeske!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
|
Friendly bump @stevehipwell - @alexandear - @Not-Dhananjay-Mishra |
Not-Dhananjay-Mishra
left a comment
There was a problem hiding this comment.
Few nits, otherwise LGTM.
Apologies for the delay 🫠.
Co-authored-by: Dhananjay Mishra <technicaldmcontact@gmail.com>
|
Thank you @Not-Dhananjay-Mishra great find - completely agree! I applied your suggestions here. |
|
Thanks @joeljeske. One more thing, you'll need to run |
|
Ah thanks @Not-Dhananjay-Mishra. Done! |
GitHub's REST API and
pull_requestwebhook payloads now include astackobject on pull requests that belong to a stack (stacked pull requests). It
reports the branch the whole stack ultimately targets, which can differ from the
PR's own base branch. go-github didn't expose it.
This adds
PullRequest.Stackand aPullRequestStacktype(
id,number,base,size,position). Because webhook events reuse thePullRequeststruct (PullRequestEvent.PullRequest), the field is available forboth REST responses and incoming
pull_requestwebhooks.Accessors and stringify tests were regenerated via
go generate ./....Ref: pull request schema in the REST API docs
(https://docs.github.com/en/rest/pulls/pulls), which documents the
stackobject.