Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PullRequest MergeableState field #1763

Closed
ryangribble opened this issue Feb 15, 2018 · 0 comments
Closed

Implement PullRequest MergeableState field #1763

ryangribble opened this issue Feb 15, 2018 · 0 comments
Assignees
Labels
Type: Feature New feature or request

Comments

@ryangribble
Copy link
Contributor

ryangribble commented Feb 15, 2018

This is currently an undocumented field (likely to be added to docs in the future) but provides very useful information about whether a PR can be merged or not, and what the reasons preventing merge actually are.

This field should be implemented as a new Enum class, using our standard Parameter() property to map to the api string values. In the PullRequest class it will be wrapped by our StringEnum<T> wrapper to guard against the addition of more values upstream. It most likely will need to be declared nullable, as it probably isn't returned in GetAll responses, that only return a subset of PullRequest fields

The following values are possible

dirty: Merge conflict. Merging will be blocked

unknown: Mergeability was not checked yet. Merging will be blocked

blocked: Blocked by a failing/missing required status check.

behind: Head branch is behind the base branch. Only if required status checks is enabled but loose policy is not. Merging will be blocked.

unstable: Failing/pending commit status that is not part of the required status checks. Merging is allowed (yellow box).

has_hooks: GitHub Enterprise only, if a repo has custom pre-receive hooks. Merging is allowed (green box).

clean: No conflicts, everything good. Merging is allowed (green box).

Some references:
octokit/octokit.rb#626
google/go-github#820 (comment)
https://platform.github.community/t/documentation-about-mergeable-state/4259

@ryangribble ryangribble self-assigned this Feb 16, 2018
nhaarman pushed a commit to Label305/AutoRebase that referenced this issue Dec 17, 2020
Based on octokit/octokit.net#1763 the
'blocked' state represents "Blocked by a failing/missing required
status check". Since there are no conflicts at this point, a rebase
is possible and might even be able to fix the status checks.
ryanmoran pushed a commit to paketo-buildpacks/github-config that referenced this issue Jan 14, 2021
As outline in an [issue on
octokit](octokit/octokit.net#1763), the
`unstable` state is defined as "Failing/pending commit status that is
not part of the required status checks. Merging is allowed."

Running the "Auto Merge" workflow itself induces an `unstable` state as
it is a pending check that is not part of the required status checks.
This is different than the `blocked` state which is induced by running
one of the required status checks. Either way, a merge will only be
possible if all of the required checks have passed and so it should be
safe to allow the "Auto Merge" workflow to attempt to merge the PR given
an `unstable` state.
sophiewigmore pushed a commit to paketo-buildpacks/github-config that referenced this issue Jan 14, 2021
As outline in an [issue on
octokit](octokit/octokit.net#1763), the
`unstable` state is defined as "Failing/pending commit status that is
not part of the required status checks. Merging is allowed."

Running the "Auto Merge" workflow itself induces an `unstable` state as
it is a pending check that is not part of the required status checks.
This is different than the `blocked` state which is induced by running
one of the required status checks. Either way, a merge will only be
possible if all of the required checks have passed and so it should be
safe to allow the "Auto Merge" workflow to attempt to merge the PR given
an `unstable` state.
ryanmoran pushed a commit to paketo-buildpacks/full-builder that referenced this issue Jan 21, 2021
As outline in an [issue on
octokit](octokit/octokit.net#1763), the
`unstable` state is defined as "Failing/pending commit status that is
not part of the required status checks. Merging is allowed."

Running the "Auto Merge" workflow itself induces an `unstable` state as
it is a pending check that is not part of the required status checks.
This is different than the `blocked` state which is induced by running
one of the required status checks. Either way, a merge will only be
possible if all of the required checks have passed and so it should be
safe to allow the "Auto Merge" workflow to attempt to merge the PR given
an `unstable` state.
ryanmoran pushed a commit to paketo-buildpacks/base-builder that referenced this issue Jan 21, 2021
As outline in an [issue on
octokit](octokit/octokit.net#1763), the
`unstable` state is defined as "Failing/pending commit status that is
not part of the required status checks. Merging is allowed."

Running the "Auto Merge" workflow itself induces an `unstable` state as
it is a pending check that is not part of the required status checks.
This is different than the `blocked` state which is induced by running
one of the required status checks. Either way, a merge will only be
possible if all of the required checks have passed and so it should be
safe to allow the "Auto Merge" workflow to attempt to merge the PR given
an `unstable` state.
ryanmoran pushed a commit to paketo-buildpacks/tiny-builder that referenced this issue Jan 21, 2021
As outline in an [issue on
octokit](octokit/octokit.net#1763), the
`unstable` state is defined as "Failing/pending commit status that is
not part of the required status checks. Merging is allowed."

Running the "Auto Merge" workflow itself induces an `unstable` state as
it is a pending check that is not part of the required status checks.
This is different than the `blocked` state which is induced by running
one of the required status checks. Either way, a merge will only be
possible if all of the required checks have passed and so it should be
safe to allow the "Auto Merge" workflow to attempt to merge the PR given
an `unstable` state.
@nickfloyd nickfloyd added Type: Feature New feature or request and removed category: feature labels Oct 27, 2022
bluedev41 added a commit to bluedev41/AutoRebase that referenced this issue Dec 22, 2022
Based on octokit/octokit.net#1763 the
'blocked' state represents "Blocked by a failing/missing required
status check". Since there are no conflicts at this point, a rebase
is possible and might even be able to fix the status checks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants