If harbormaster.sendmessage method is called multiple times for same build target only the first message is consumed. In other words, if I'd send "fail" and then "pass" to the same build target, build would be marked as failing still.
For example, lets have some build target PHID-HMBT-dwor4e56q7f2mzrn3xrr:
echo '{ "buildTargetPHID": "PHID-HMBT-dwor4e56q7f2mzrn3xrr", "type": "fail" }' | arc call-conduit --conduit-uri http://phabricator.local/ harbormaster.sendmessage echo '{ "buildTargetPHID": "PHID-HMBT-dwor4e56q7f2mzrn3xrr", "type": "pass" }' | arc call-conduit --conduit-uri http://phabricator.local/ harbormaster.sendmessage
First message will be consumed and build will be marked as "failing". And no matter if "pass" will be sent after some time.
mysql> SELECT * FROM harbormaster_buildmessage WHERE buildTargetPHID = 'PHID-HMBT-dwor4e56q7f2mzrn3xrr'; +----+--------------------------------+--------------------------------+------+------------+-------------+--------------+ | id | authorPHID | buildTargetPHID | type | isConsumed | dateCreated | dateModified | +----+--------------------------------+--------------------------------+------+------------+-------------+--------------+ | 10 | PHID-USER-7mufbthf75bu64nprxfd | PHID-HMBT-dwor4e56q7f2mzrn3xrr | fail | 1 | 1441973511 | 1441973511 | | 11 | PHID-USER-7mufbthf75bu64nprxfd | PHID-HMBT-dwor4e56q7f2mzrn3xrr | pass | 0 | 1441973527 | 1441973527 | +----+--------------------------------+--------------------------------+------+------------+-------------+--------------+
It is possible go to buildable page, restart failed build. Then new build target will be created for the diff and diff will be marked as passed (if build will pass of course).
But if external CI platform is used (in my case it is Jenkins), sometimes builds are failing because of environment reasons. harbormaster.sendmessage method is called with "fail" value. In this case it is simpler just restart build on Jenkins side with the same parameters (and same Harbormaster Build Target). Let's assume, build is passing after restart. harbormaster.sendmessage with same HMBT and "pass" is sent again, record is stored in harbormaster_buildmessage but not consumed.
I'm wondering if it is expected behavior that build status can not be updated once it is consumed?