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.
Here’s what I see on the Git section:
+ git init Initialized empty Git repository in /drone/src/github.com/xxxx/.git/ + git remote add origin https://github.com/xxxx.git + git fetch --no-tags origin +refs/pull/32/merge: From https://github.com/xxxx * branch refs/pull/32/merge -> FETCH_HEAD + git checkout -qf FETCH_HEAD + git submodule update --init --recursive exit code 0