Skip to main content

Module land

Module land 

Source
Expand description

The GitHub writes behind jouet pr land: updating a branch with its base, merging, and confirming the merge.

Both writes go through the REST endpoints that take the head SHA as a guard, so a push between the check and the write makes GitHub refuse rather than merge something nobody looked at. Neither ever force-pushes: updating merges the base into the branch on GitHub. Merging asks for the same merge a person gets from the button, so branch protection applies and nothing here asks to bypass it.

A PR in one of GitHub’s native stacks cannot go through the merge endpoint: GitHub only merges it through the asynchronous one, which takes the same head SHA guard, merges in the background, and is polled for its result. It merges every PR below the one named as well, so callers use it only for the bottom PR of a stack.

Structs§

Pull
Stack
A GitHub native stack a PR is in.

Enums§

Async
Where an asynchronous merge stands.
Method
How the merge is made.
Refused
Why a write did not happen.

Functions§

merge
Merges the PR if its head is still head_oid, and returns the merge commit GitHub reports.
merge_async
Asks GitHub to merge a stacked PR in the background through the asynchronous merge endpoint, if its head is still head_oid. Like the merge endpoint, it applies branch protection; direct_merge keeps it from queueing the PR instead. It merges the PRs below this one too.
merge_async_result
Where an asynchronous merge GitHub accepted as uuid stands now.
pull
The PR as the REST API reads it: whether it is merged, its merge commit, its base, and the stack it is in.
update_branch
Asks GitHub to merge the base into the branch, if the head is still head_oid. GitHub does this in the background, so the new head appears a moment after this returns.