From: vrana Date: Mon, 13 Aug 2012 19:20:34 +0000 (-0700) Subject: Pass lint and unit results to diff created event X-Git-Tag: conduit-6~160 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ab602e3a524a8366688b1bcf118b8e98cf63c153;p=arcanist.git Pass lint and unit results to diff created event Summary: I need to run some jobs only if the tests hasn't been skipped. I know that this could end up by passing more and more data to the event but this is all I need so far. Test Plan: Dumped `unitResult` from the listener. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3259 --- diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index fa850845..1e2c9404 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -435,7 +435,14 @@ EOTEXT $this->diffID = $diff_info['diffid']; - $this->dispatchDiffWasCreatedEvent($diff_info['diffid']); + $event = new PhutilEvent( + ArcanistEventType::TYPE_DIFF_WASCREATED, + array( + 'diffID' => $diff_info['diffid'], + 'lintResult' => $lint_result, + 'unitResult' => $unit_result, + )); + PhutilEventEngine::dispatchEvent($event); $this->updateLintDiffProperty(); $this->updateUnitDiffProperty(); @@ -2268,13 +2275,4 @@ EOTEXT return $event->getValue('fields'); } - private function dispatchDiffWasCreatedEvent($diff_id) { - $event = new PhutilEvent( - ArcanistEventType::TYPE_DIFF_WASCREATED, - array( - 'diffID' => $diff_id, - )); - - PhutilEventEngine::dispatchEvent($event); - } }