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

Pull request mergeability is boolean but should be trinary #275

Closed
PerilousApricot opened this issue Apr 26, 2016 · 6 comments
Closed

Pull request mergeability is boolean but should be trinary #275

PerilousApricot opened this issue Apr 26, 2016 · 6 comments

Comments

@PerilousApricot
Copy link

PerilousApricot commented Apr 26, 2016

According to the API docs:

"The value of the mergeable attribute can be true, false, or null. If the value is null, this means that the mergeability hasn't been computed yet, and a background job was started to compute it. Give the job a few moments to complete, and then submit the request again. When the job is complete, the response will include a non-null value for the mergeable attribute."

This casting currently treats "null" as "can not merge", which cascades down to other plugins. Should the returned type be expanded?

@KostyaSha
Copy link
Contributor

KostyaSha commented Apr 26, 2016

And while you will calculate single variable you can:

  • always get to null values because of recalculates
  • consume rate limits
  • may be not interesting in this status, but client would continue sending requests

All code that i know care about status themselve.

@KostyaSha
Copy link
Contributor

And btw, that what i wrote to GH API developers about, but didn't get any answer.

@PerilousApricot
Copy link
Author

I'm not sure I follow? I ended up chasing this down because Jenkins thought every commit it saw was unmergeable and refused to build them, when in actuality it just didn't know whether or not it could be merged. Seems like letting the API say "null" instead of coercing the 3 possible inputs to 2 outputs lets people downstream do the right thing

@KostyaSha
Copy link
Contributor

KostyaSha commented Apr 26, 2016

This the library and it returns what gh API provides. API provides 3 states, everything right.

@kohsuke
Copy link
Collaborator

kohsuke commented Jun 4, 2016

This library correctly defines Boolean GHPullRequest.getMergeable() to represent the tri-state.

@PerilousApricot it seems to me that you should be actually filing this bug to whatever Jenkins plugin that takes this Boolean return value and coerce that to boolean.

@kohsuke kohsuke closed this as completed Jun 4, 2016
@PerilousApricot
Copy link
Author

@kohshuke I have the utmost respect for you. I was using Jenkins before it
was called Jenkins

With the 2.0 push, isn't the point to make the common case easier? GitHub
and Jenkins blow up for an easily triggerable reason. It's a "plugin" but
probably the most common integration people want to make.

On Friday, June 3, 2016, Kohsuke Kawaguchi [email protected] wrote:

This library correctly defines Boolean GHPullRequest.getMergeable() to
represent the tri-state.

@PerilousApricot https://github.com/PerilousApricot it seems to me that
you should be actually filing this bug to whatever Jenkins plugin that
takes this Boolean return value and coerce that to boolean.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#275 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAFsqjDdKsQmwJTwQ4NP9jUxBIOShOHnks5qIPZ9gaJpZM4IQFI8
.

It's dark in this basement.

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

3 participants