Closed magni- closed 8 years ago
Heads up! This PR modifies the following files:
Thank you for doing this work! I haven't been able to come up with a better solution, but let's move to a 1s delay. I'm also tempted to limit the scope of get_pull
by renaming it is_pull_request_mergeable
. This also makes it easier to write a test; we can just make is_pull_request_mergeable
return true in the test API, and have the test JSON contain mergeable: null
, then verify that the label is removed.
I went ahead and changed the delay, but kept the method to the more general get_pull
.
I also figured out how to write the test (should have looked more closely at test.py
the first time around). Good thing I did, since it caught the missing import! (seems like a lint check could come in handy for that though... :smile: )
Thanks!
This fixes an issue with the removing the
S-needs-rebase
label when getting asynchronize
event from GitHub.GitHub doesn't wait to calculate mergeability when firing off a webhook, instead they send
mergeable
asnull
. In that happens, with this PR we now hit GitHub again until they return themergeable
field as eithertrue
orfalse
.Two questions: 1) What's an appropriate wait time in between
GET
s? 2) How do I test this? Is there a way to specify multiple API response payloads?