mohamicorp / stash-jenkins-postreceive-webhook

Webhook used to notify Jenkins when commits are made to Stash
Other
138 stars 98 forks source link

Post-merge trigger doesn't execute #47

Closed melvyndekort closed 10 years ago

melvyndekort commented 10 years ago

I have to agree with ashnazg on issue #38. The post-merge trigger doesn't execute anymore, causing the post-merge build not to run.

https://github.com/Nerdwin15/stash-jenkins-postreceive-webhook/issues/38#issuecomment-31838260

mikesir87 commented 10 years ago

Ok. I'll look into it. I've been thinking lately that I need to figure out how to do automated functional tests that will actually do commits, etc. Hmmm...

mikesir87 commented 10 years ago

Ahh... I see the problem. During the pull request merge, a PullRequestMergedEvent is triggered, which is both a PullRequestEvent AND a RepositoryRefsChangedEvent. This means it was still being evaluated by the IsMergeabilityEligibilityFilter. When the canMerge was checked, it threw the exception stating it was already merged.

Looks like the fix is to check if the PullRequest's state is still OPEN in the filter. Will try it out and let you know how it goes.

mikesir87 commented 10 years ago

Got it fixed. Updated version of the plugin is going out now. :+1:

melvyndekort commented 10 years ago

Thanks!

ashnazg commented 10 years ago

Working good for me... thanks Mike!