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:
		@@ -160,6 +160,7 @@ final class DifferentialCreateDiffConduitAPIMethod
 | 
			
		||||
 | 
			
		||||
    return array(
 | 
			
		||||
      'diffid' => $diff->getID(),
 | 
			
		||||
      'phid' => $diff->getPHID(),
 | 
			
		||||
      'uri' => $uri,
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user