gocd-build-github-pull-requests
gocd-build-github-pull-requests copied to clipboard
Plugin execution is not triggered on merge commits
hello guys, consider this situation:
- create feature branch from master
- make changes, commit and push -- pipeline will be executed automatically
- few PRs went into master
- merge master into feature branch -- this generates a merge commit
- push to remote repo -- it won't be picked up by gocd plugin
Is it known limitation? any way to work around it?
I just had a PR not trigger the plugin this morning, not understanding why. After starting the pipeline manually the build status was reported to the PR.
I am not sure if it followed the exact sequence you describe here since I was only playing around to try out the plugin, but I can confirm that the topmost commit in the PR was indeed a merge commit.
Does it pick up the latest changes when you trigger the pipeline manually?
@ashwanthkumar yes, and it also works if I trigger for specific revision (revision is properly shown) the problem is that it's not triggered automatically
@akurkin Can you share the plugin logs? If possible enable debug logging on the go server and if you can retry the above steps and share the logs, that would be even great.
We're experiencing the exact same issue: Automatic triggering works, unless it's a merge commit. Unfortunately I don't have access to the log files.
Confirm, autobuild does not work after merge commit push
Thanks for the issue report. I'll have a look at it and keep you guys posted.
On Tue, May 24, 2016 at 8:50 PM, Alexander Yastrebov < [email protected]> wrote:
Confirm, autobuild does not work after merge commit push
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/ashwanthkumar/gocd-build-github-pull-requests/issues/71#issuecomment-221305892
Ashwanth Kumar / ashwanthkumar.in
Hello. I have created pull request to fix it. Actual fix is just removing break in cycle. See #74
that's awesome. Looking forward to seeing this issue fixed!
@AlexanderYastrebov Thank you so much for getting this done. I'll verify and merge them.
Meanwhile @akurkin @whiskeysierra @gunnarx - can you guys also verify the changes from your side?
Sure, happy to do it. Is there a jar file available or some instructions on how to build it myself? (sorry, not well versed in java world)
@akurkin Please check out github-pr-poller-1.2.4-merge-commit-fix.jar.zip
PS: Github doesn't support attaching JAR files on the issues. So had to compress into into a ZIP :(
Here's the Git Feature Branch plugin (with fixes from #74), if you're directly using it from Git repos without Github.
@akurkin Please check out github-pr-poller-1.2.4-merge-commit-fix.jar.zip
I tried it, but a merge commit still doesn't trigger a build for my PR:
See my attached screenshots. Last build was an hour ago, but the last changes show my merge from 7 minutes ago.

Same issue here, any news on this?
It seems that when the modified-material list is empty, the pipeline is NOT triggered. This happens when e.g. GitHub does a merge (master into a branch, for example). The change is detected, but nothing happens because the modified-material-list is empty.
I have made a plain work-around by inserted a fake-change in the list to trigger the pipeline. This is probably not the way to go, but I didn't really see another solution since the Java-Git library doesn't give me extra information.
Take a look here for the change.
BTW, the use-case is that we want that ALL changes on a PR are build in the pipeline, including all the merges!
I just made a release with the changes on PR at ashwanthkumar/git-cmd#2
https://github.com/ashwanthkumar/gocd-build-github-pull-requests/releases/tag/v1.3.0-RC2
Please check and let me know if that fixes the problem.
cc: @juhasipo
Please check and let me know if that fixes the problem.
Not for us, no.
I'm still seeing the issue as well.
Actually I just realized that we're still using the old version of the plugin. I have to check again, next time a merge appears.
Nope, doesn't work.
Okay, I finally got some time to look into this issue and it seems that for merge commits the modifiedFiles list seems to be empty, even after the changes from https://github.com/ashwanthkumar/git-cmd/pull/2/ that doesn't seem to help for cases wherein there're only new files added via merge commits. Added an ugly patch to force trigger the commits and it seems to be working. The fix is part of https://github.com/ashwanthkumar/gocd-build-github-pull-requests/pull/94.
EDIT - Thanks to @decoomanj for the original solution.
@ashwanthkumar It seems like the issue is back again in v1.3.3
I tried to deploy gocd server v17.2.0.2 with github-pr-poller-1.3.3.jar - the issue's back.
Then I deployed gocd server v17.2.0.2 with github-pr-poller-1.3.1.jar - the issue's gone.
@qlibin Oops looks like a regression, most likely as part of this. Will fix it but this time with tests around that part. Thanks for reporting.
This issue also seems to applies to the stash-pr-poller. Would you be so kind to fix it there as well?
This issue also exists on git-fb-poller-1.3.4.jar. Will this be fixed too ?
I am still facing this issue @ashwanthkumar, is there any updates on this?
I am facing this issue when :
1.)I create a feature branch which does not have the latest changes from master. 2.) then I click on the button given to update the branch with master changes which rebases all the commits from master into our feature branch.
The pipeline does not run.
For the time being I am ammending the commit with some whitespace or making a dummy commit and force pushing it into my feature branch to retrigger the pipeline.