1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Allow lint and unit results to be reported via harbormaster.sendmessage

Summary:
Ref T8095. When build results are reported for a target, allow them to include unit and lint results.

There is no real way to see this stuff in the UI yet, either in Harbormaster or Differential.

Test Plan: Manually called this method with some results, saw Harbormaster update appropriately.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8095

Differential Revision: https://secure.phabricator.com/D13380
This commit is contained in:
epriestley 2015-06-21 10:55:08 -07:00
parent 831c18e6be
commit 41b3f9236a
3 changed files with 36 additions and 6 deletions

View file

@ -160,6 +160,7 @@ final class DifferentialCreateDiffConduitAPIMethod
return array(
'diffid' => $diff->getID(),
'phid' => $diff->getPHID(),
'uri' => $uri,
);
}

View file

@ -18,6 +18,8 @@ final class HarbormasterSendMessageConduitAPIMethod
return array(
'buildTargetPHID' => 'required phid',
'lint' => 'optional list<wild>',
'unit' => 'optional list<wild>',
'type' => 'required '.$type_const,
);
}
@ -40,10 +42,31 @@ final class HarbormasterSendMessageConduitAPIMethod
throw new Exception(pht('No such build target!'));
}
$message = HarbormasterBuildMessage::initializeNewMessage($viewer)
$save = array();
$lint_messages = $request->getValue('lint', array());
foreach ($lint_messages as $lint) {
$save[] = HarbormasterBuildLintMessage::newFromDictionary(
$build_target,
$lint);
}
$unit_messages = $request->getValue('unit', array());
foreach ($unit_messages as $unit) {
$save[] = HarbormasterBuildUnitMessage::newFromDictionary(
$build_target,
$unit);
}
$save[] = HarbormasterBuildMessage::initializeNewMessage($viewer)
->setBuildTargetPHID($build_target->getPHID())
->setType($message_type)
->save();
->setType($message_type);
$build_target->openTransaction();
foreach ($save as $object) {
$object->save();
}
$build_target->saveTransaction();
// If the build has completely paused because all steps are blocked on
// waiting targets, this will resume it.

View file

@ -248,7 +248,13 @@ final class HarbormasterBuildableViewController
$build_list->addItem($item);
}
return $build_list;
$build_list->setFlush(true);
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Builds'))
->appendChild($build_list);
return $box;
}
}