danielbeardsley/cimpler — pull request #39 by danielbeardsley (2013-09-27 19:29:21+00:00)
Title: commit-status: only one status when fast-failing

Only report a single "failed" status when a build is "finished" before it is
"started"

Plugins have the option of calling finish() on a build before calling start()
which causes the system to implicitly call start(). The git-build plugin does
this for merge-failures (start isn't usually called till the merge is
successful).

The problem is that "buildStarted" and "buildFinished" are called right after
eachother, causing the github-commit-status plugin to fire off two commit
statuses (one 'started' and one 'merge failed') at almsot exactly the same
time. Github uses whichever status was recieved most recently, so it's kind of
a race condition and half the time, the 'started' message arrives after the
'failed' message, causing a forever 'in progress' state for that commit / pull.

This change simply doesn't send the 'started' status to github during the
'buildStarted' even when a build has already been marked as failed.