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

GHPullRequest.getMergeable() never returns True #399

Closed
jamesdh opened this issue Nov 16, 2017 · 4 comments
Closed

GHPullRequest.getMergeable() never returns True #399

jamesdh opened this issue Nov 16, 2017 · 4 comments

Comments

@jamesdh
Copy link

jamesdh commented Nov 16, 2017

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.

@jamesdh
Copy link
Author

jamesdh commented Nov 16, 2017

Also worth noting that this does create the pull request on GitHub. We can just never act on it after creating it because of this issue.

kohsuke added a commit that referenced this issue Jan 13, 2018
This ends up changing the behaviour cloes to that of #394.
@kohsuke
Copy link
Collaborator

kohsuke commented Jan 13, 2018

Fixed toward 1.91.

@kohsuke kohsuke closed this as completed Jan 13, 2018
@jamesdh
Copy link
Author

jamesdh commented Jan 15, 2018

Awesome, thank you! Any chance we can get 1.91 or 1.92 released to the Jenkins plugin portal? :)

@jamesdh
Copy link
Author

jamesdh commented Feb 7, 2018

@kohsuke anything I can do to help get this released into the wild?

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

No branches or pull requests

2 participants