Skip to content

feat: Add MergeAsync and GetMergeAsyncResult support - #4491

Open
ymh3090 wants to merge 7 commits into
google:masterfrom
ymh3090:feat/merge-async
Open

feat: Add MergeAsync and GetMergeAsyncResult support#4491
ymh3090 wants to merge 7 commits into
google:masterfrom
ymh3090:feat/merge-async

Conversation

@ymh3090

@ymh3090 ymh3090 commented Aug 26, 2026

Copy link
Copy Markdown

Adds support for the asynchronous pull request merge endpoints, needed for merging stacked pull requests (the existing Merge method doesn't support stacks).

  • PullRequestsService.MergeAsyncPUT /repos/{owner}/{repo}/pulls/{pull_number}/merge-async
  • PullRequestsService.GetMergeAsyncResultGET /repos/{owner}/{repo}/pulls/{pull_number}/merge-async/{uuid}

Docs:

Closes #4485

@google-cla

google-cla Bot commented Aug 26, 2026

Copy link
Copy Markdown

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.

@ymh3090

ymh3090 commented Aug 26, 2026

Copy link
Copy Markdown
Author

recheck

1 similar comment
@ymh3090

ymh3090 commented Aug 26, 2026

Copy link
Copy Markdown
Author

recheck

@ymh3090

ymh3090 commented Aug 26, 2026

Copy link
Copy Markdown
Author

hi, @gmlewis !
I've signed the Google CLA, but the cla/google check is still failing after a recheck. Could you take a look?

@gmlewis gmlewis changed the title feat: add MergeAsync and GetMergeAsyncResult support feat: Add MergeAsync and GetMergeAsyncResult support Aug 26, 2026
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Aug 26, 2026
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.53%. Comparing base (f9fec07) to head (c2cab06).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4491   +/-   ##
=======================================
  Coverage   98.52%   98.53%           
=======================================
  Files         195      195           
  Lines       17729    17747   +18     
=======================================
+ Hits        17468    17487   +19     
+ Misses        261      260    -1     

☔ View full report in Codecov by Harness.
📢 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.

@gmlewis gmlewis left a comment

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.

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

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

@alexandear alexandear left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please improve naming for consistency.

Comment thread github/pulls.go Outdated
Comment thread github/pulls.go Outdated
ymh3090 and others added 4 commits August 26, 2026 22:06
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
@ymh3090
ymh3090 requested a review from alexandear August 26, 2026 20:09
@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Aug 28, 2026
@gmlewis

gmlewis commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

@ymh3090 - could you please git pull the "merge" I performed on your branch and then change the "Ptr" instances to "new" (due to #4481 ) and push the changes to this PR? Sorry for the inconvenience.

Comment thread github/pulls.go

var result *PullRequestMergeAsyncResult
resp, err := s.client.Do(req, &result)
if err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This endpoint can return a 202 AcceptedError - other places where this happens is either handled in the function or documented in the function docs. Not sure what the maintainers prefer but we should do something here

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.

It seems like adding a comment in the function docs would be sufficient here - do you agree, @DP19?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ah maybe it should be handled in the function just based on a previous bug #3036 / #3047 - the doc might be fine as long as people don't care about the response in that case. Up to you all!

@gmlewis

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.

Since this is an asynchronous call anyway, I think a comment should be just fine. In those other examples, users were waiting for the upload, but here, they are explicitly calling an async endpoint anyway and are planning on waiting. Thoughts?

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.

Support /merge-async endpoint

4 participants