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

isMergeable always returning true #61

Open
borisivan opened this issue May 21, 2019 · 1 comment
Open

isMergeable always returning true #61

borisivan opened this issue May 21, 2019 · 1 comment

Comments

@borisivan
Copy link

in a PR I have a pending status check. and the repo settings have branch protection with the setting: "Require status checks to pass before merging", and the status check in question is listed.

I have a test with the following code:

   def isMergeable = false
   isMergeable = pullRequest.mergeable
   echo "mergeability: ${isMergeable} should be false..."
   sleep (5)
   isMergeable = pullRequest.mergeable
   echo "mergeability: ${isMergeable} should be false..."
   sleep (5)
   pullRequest.createStatus(status: 'success', context: 'pr examination', description: 'examination successful', targetUrl: "${env.JOB_URL}")
   isMergeable = pullRequest.mergeable
   echo "mergeability: ${isMergeable} true if change immediate... since I just set the status as success immediately prior"
   sleep (5)
   isMergeable = pullRequest.mergeable
   echo "mergeability: ${isMergeable} after 5 second delay since setting, really should be true here..."

.... yet it's always 'true'. I even made sure the repo settings had the configuration for "Enforce all configured restrictions for administrators."

I had a window up to the github UI that I was refreshing after I made a small change to the branch and pushed to github. The PR instantly went to having they merge button greyed out as soon as it received the push, and stayed grey as I spammed the refresh button on my browser, and immediately went to mergeable (in the UI) only when the createStatus command was executed in the code above.

But pullRequest.mergeable appears to always be true, even though the github UI is saying that the PR is not mergeable until I set that statusCheck to success. Any ideas?

@borisivan
Copy link
Author

learning more about how this works -- I suspect that this only takes into consideration if there is a git conflict. But if anything that prevents a PR from being merged (reviewers, required status checks, etc) are currently active for a PR.... isMergeable is still true.

Would love to see a solution somehow to really know "is it mergeable".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants