I switched to Drone 0.5-rc a couple of weeks ago and I noticed that Drone builds the wrong commit after a force-push. If I manually press on “Rebuild”, the correct version of the code is picked up and everything is fine. Here are the steps:
open a PR. Drone picks it up and builds. Assume it failed
I fix the failure and force-push (amending the last commit, for instance)
Drone builds the code again, fails in exactly the same way (interestingly, the Drone UI shows the correct commit hash in the build header)
I press “Rebuild”. This time the build succeeds
I think Drone is using the old version of the code/old commit hash, but I don’t know exactly how to debug it. The git plugin doesn’t print the git hash after checking out FETCH_HEAD. I used Drone 0.4.2 for a long time and this never happened.
There is also a patch that was submitted to the git plugin, but this is failing unit tests and cannot be merged until passing. https://github.com/drone/drone/issues/1000
Thanks! To me it’s not clear it is the same issue. #1000 is about building the “newer” SHA, while I’m observing the opposite: the old, broken SHA is being built even after a force push (and there are no running builds when I force-push). I am printing now the git commit that’s being built and I see that it is indeed the wrong one.
@drago not sure, I can tell you there have been no changes to how receives build information or clones the repository between 0.4 and 0.5. If you are experiencing this issue, I recommend jumping into the code and looking at the contents of the pull request hook from GitHub to ensure the correct SHA is being sent and being saved in the database. If you see any issues and can send a PR that is much appreciated.
You can also create a new ticket, but to be 100% up front this won’t get worked on unless someone volunteers to debug and patch.
@dragos - we suffered from the same problem as you describe. It seems to be fixed if you use this new Git logic, but isn’t a problem in Travis which uses the same Git logic as is broken at the moment.
We are suffering from this problem, so after force push it shows the right commit in a build job, but somehow builds the the wrong one and I don’t know how to fix it.
Sometimes it needs to be force pushed with different hashes 10 times, sometimes it helps just to try in hours… We haven’t found reliable workaround yet, but it solves somehow later mostly, but even new branch doesn’t help. Would be nice at least to know a workaround to this problem.
One thing, I have thought from last short investigation, that it can be github cache and not drone problem at all…