@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+36 -6
+2 -1
src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
··· 160 160 161 161 return array( 162 162 'diffid' => $diff->getID(), 163 - 'uri' => $uri, 163 + 'phid' => $diff->getPHID(), 164 + 'uri' => $uri, 164 165 ); 165 166 } 166 167
+27 -4
src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php
··· 18 18 19 19 return array( 20 20 'buildTargetPHID' => 'required phid', 21 - 'type' => 'required '.$type_const, 21 + 'lint' => 'optional list<wild>', 22 + 'unit' => 'optional list<wild>', 23 + 'type' => 'required '.$type_const, 22 24 ); 23 25 } 24 26 ··· 40 42 throw new Exception(pht('No such build target!')); 41 43 } 42 44 43 - $message = HarbormasterBuildMessage::initializeNewMessage($viewer) 45 + $save = array(); 46 + 47 + $lint_messages = $request->getValue('lint', array()); 48 + foreach ($lint_messages as $lint) { 49 + $save[] = HarbormasterBuildLintMessage::newFromDictionary( 50 + $build_target, 51 + $lint); 52 + } 53 + 54 + $unit_messages = $request->getValue('unit', array()); 55 + foreach ($unit_messages as $unit) { 56 + $save[] = HarbormasterBuildUnitMessage::newFromDictionary( 57 + $build_target, 58 + $unit); 59 + } 60 + 61 + $save[] = HarbormasterBuildMessage::initializeNewMessage($viewer) 44 62 ->setBuildTargetPHID($build_target->getPHID()) 45 - ->setType($message_type) 46 - ->save(); 63 + ->setType($message_type); 64 + 65 + $build_target->openTransaction(); 66 + foreach ($save as $object) { 67 + $object->save(); 68 + } 69 + $build_target->saveTransaction(); 47 70 48 71 // If the build has completely paused because all steps are blocked on 49 72 // waiting targets, this will resume it.
+7 -1
src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
··· 248 248 $build_list->addItem($item); 249 249 } 250 250 251 - return $build_list; 251 + $build_list->setFlush(true); 252 + 253 + $box = id(new PHUIObjectBoxView()) 254 + ->setHeaderText(pht('Builds')) 255 + ->appendChild($build_list); 256 + 257 + return $box; 252 258 } 253 259 254 260 }