Build fix after r196870.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Mar 2016 01:02:35 +0000 (01:02 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Mar 2016 01:02:35 +0000 (01:02 +0000)
* public/include/report-processor.php:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@197904 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/include/report-processor.php

index 10b80da..6429f67 100644 (file)
@@ -1,5 +1,11 @@
 2016-03-09  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Build fix after r196870.
+
+        * public/include/report-processor.php:
+
+2016-03-09  Ryosuke Niwa  <rniwa@webkit.org>
+
         Add Size metric to perf dashboard
         https://bugs.webkit.org/show_bug.cgi?id=155266
 
index 9fc93bd..b58ca81 100644 (file)
@@ -63,18 +63,18 @@ class ReportProcessor {
             $hash = NULL;
             if ($slave_name && array_key_exists('slavePassword', $report)) {
                 $universal_password = config('universalSlavePassword');
-                if ($universal_password && $universal_password == $report['slavePassword'])
-                    $slave = $this->db->select_first_row('build_slaves', 'slave', array('name' => $slave_name));
+                if ($slave_name && $universal_password && $universal_password == $report['slavePassword'])
+                    $slave_id = $this->db->select_or_insert_row('build_slaves', 'slave', array('name' => $slave_name));
                 else {
                     $hash = hash('sha256', $report['slavePassword']);
                     $slave = $this->db->select_first_row('build_slaves', 'slave', array('name' => $slave_name, 'password_hash' => $hash));
+                    if ($slave)
+                        $slave_id = $slave['slave_id'];
                 }
-                if ($slave)
-                    $slave_id = $slave['slave_id'];
             } else if (array_key_exists('builderPassword', $report))
                 $hash = hash('sha256', $report['builderPassword']);
 
-            if (!$hash)
+            if (!$hash && !$slave_id)
                 $this->exit_with_error('BuilderNotFound');
             if (!$slave_id)
                 $builder_info['password_hash'] = $hash;