# Inconsistency between commit and PR builds

**URL:** <https://drone.discourse.group/t/inconsistency-between-commit-and-pr-builds/9475>\
**Category:** Drone Support\
**Created:** [February 19, 2018, 3:38pm UTC](https://drone.discourse.group/t/inconsistency-between-commit-and-pr-builds/9475 "2018-02-19T15:38:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![laszlocph](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/laszlocph/32/3233_2.png) [@laszlocph](https://drone.discourse.group/u/laszlocph)\
**Post date:** [February 19, 2018, 3:38pm UTC](https://drone.discourse.group/t/inconsistency-between-commit-and-pr-builds/9475/1 "2018-02-19T15:38:27Z")

</div>

Hi Community,

There was a weird case on our build server.

A single commit triggered a commit build and a PR build, which kicked off at the same time. They both show the same commit hash on the UI.

However the commit build passed, the PR build failed, because the changes of this commit did not reflect in the PR build yet. After manually restarting the PR build, it succeeded.

I digged a bit in how Drone does the clone step:

- commit builds do a “git reset --hard” on the git hash, so no room for error
- while PR builds just go on the merge HEAD:

```auto
 * branch refs/pull/361/merge -> FETCH_HEAD
git checkout -qf FETCH_HEAD

```

My explanation on the described behavior, that if this merge HEAD lags behind, we get inconsistent builds.

Does anyone seen similar before?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [February 19, 2018, 6:56pm UTC](https://drone.discourse.group/t/inconsistency-between-commit-and-pr-builds/9475/2 "2018-02-19T18:56:38Z")

</div>

This is a known issues with CI systems like Drone, Travis, Apveyor, etc which use the merge ref to clone the pull requests. There are plans to change the pull request clone logic in a future release, which is discussed in the following thread:

> [@Pipeline Event Merge Requests w/GitLab](http://discuss.harness.io/t/planned-change-to-git-clone-logic/1165):
>
> Hello – I am having issues getting my pipeline to trigger when a Merge Request is created in GitLab and am unsure if this is possible. I have two scenarios I would like to try out: Execute Drone pipeline once a Merge Request is created OR Once the Drone pipeline succeeds create a Merge Request in Gitlab For option 1) I have tried adding the following in my pipeline but unfortunately doesn’t kickoff the pipeline once I create a merge request in my branch\_name: kind: pipeline type: docker…

---

<div class="post-metadata">

**Author:** ![laszlocph](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/laszlocph/32/3233_2.png) [@laszlocph](https://drone.discourse.group/u/laszlocph)\
**Post date:** [February 20, 2018, 7:40am UTC](https://drone.discourse.group/t/inconsistency-between-commit-and-pr-builds/9475/3 "2018-02-20T07:40:29Z")

</div>

Fantastic, thanks for the answer Brad. It does make me more comfortable.
