]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Pass lint and unit results to diff created event
authorvrana <jakubv@fb.com>
Mon, 13 Aug 2012 19:20:34 +0000 (12:20 -0700)
committervrana <jakubv@fb.com>
Mon, 13 Aug 2012 21:57:18 +0000 (14:57 -0700)
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

src/workflow/ArcanistDiffWorkflow.php

index fa850845de49160f31799772ad660967ed26ef43..1e2c940462333f7afbe68d11372c26d0869bb4e8 100644 (file)
@@ -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);
-  }
 }