Async merge API docs - #321
Open
skarim wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds documentation for programmatic asynchronous stack merging.
Changes:
- Documents submit/poll endpoints, statuses, and limitations.
- Adds FAQ and CLI cross-links.
- Registers the page in the sidebar.
Show a summary per file
| File | Description |
|---|---|
docs/astro.config.mjs |
Adds Merge API navigation. |
docs/src/content/docs/faq.md |
Adds programmatic merge guidance. |
docs/src/content/docs/reference/cli.md |
Links CLI merging to the API. |
docs/src/content/docs/reference/merge-api.md |
Adds the API reference. |
Review details
Comments suppressed due to low confidence (3)
docs/src/content/docs/reference/merge-api.md:54
- The response table omits
422 Unprocessable Entity, even though the async client explicitly handles and tests that validation response (internal/github/merge_async_test.go:98-101). Document it so callers know invalid request fields or enum values produce the standard validation error rather than a{status, details}result.
| `400 Bad Request` | The pull request is not ready to be merged (for example, it is closed or a draft). | `failed` |
| `404 Not Found` | Async merge is not available for this repository, or the pull request was not found. | — |
docs/src/content/docs/reference/merge-api.md:150
defaultis not a resolved action—it asks the server to choose between direct merge and merge queue—and the pending examples show that value being echoed unchanged. Calling this field “resolved” contradicts the request-field description and may lead clients to treatdefaultas an actual routing outcome.
| `merge_action` | `string` | `pending` | The resolved action (`default`, `direct_merge`, or `merge_queue`). |
docs/src/content/docs/reference/merge-api.md:29
- This endpoint does not unconditionally return a UUID: the
200 mergedresponse documented below is terminal and has onlydetails.sha. Qualify this sentence so consumers do not reject a valid immediate result or attempt to poll without an identifier.
Merges the pull request (and, for a stacked PR, everything below it in the stack) into the base branch in the background. Returns a `uuid` used to fetch the result.
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Medium
| | Body field | Type | Description | | ||
| |------------|------|-------------| | ||
| | `merge_method` | `string` | The merge method: `merge`, `squash`, or `rebase`. Defaults to a merge commit. | | ||
| | `merge_action` | `string` | How to merge: `default` (recommended), `direct_merge`, or `merge_queue`. `default` picks the most appropriate option — it merges directly, or adds the stack to the base branch's merge queue when the branch requires one. `direct_merge` forces a direct merge; `merge_queue` forces the merge queue, if available. | |
Comment on lines
+18
to
+19
| 1. **Submit** a merge request with `PUT .../merge-async`. The response contains a `uuid` identifying the request. | ||
| 2. **Poll** for the result with `GET .../merge-async/{uuid}` until the `status` is no longer `pending`. |
skarim
force-pushed
the
skarim/docs-merge-api
branch
from
July 28, 2026 21:34
28e19d9 to
40aa300
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Merge API reference page documenting the asynchronous merge endpoints used to land stacked PRs (
PUT/GET .../pulls/{n}/merge-async): the submit → poll flow, request parameters, response statuses (pending/merged/enqueued/failed), and current limitations.reference/merge-api.mdpage, added to the docs sidebargh stack mergeCLI referenceStack created with GitHub Stacks CLI • Give Feedback 💬