Skip to content

GHPullRequest.getMergeable() never returns True #399

@jamesdh

Description

@jamesdh

This used to work, but a change in the last couple months seems to have broken this for us.

We have some Jenkins Pipeline code that does some automatic PR creation + merging for specific use cases. Initially when creating the PR, GitHub isn't always immediately able to act on it, so we would check if it were mergeable before actually attempting to merge:

GHPullRequest pull = repo.createPullRequest("Release $version", "master", "production", body)
while(!pull.getMergeable()) {
    echo "PR not yet mergeable, retrying..."
}
pull.merge("Merged & released via [${env.BUILD_NUMBER}](${env.BUILD_URL})", pull.getHead().getSha())

Now however, pull.getMergeable() never returns true if it returns false the first time it is called (which is basically every time), so it just sits in that loop, retrying.

Again, this only broke after we recently updated all of our plugins on our Jenkins instance, so it seems a recent change is causing this but I've been unable to identify what it might be in the recent history.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions