+2015-01-23 Ryosuke Niwa <rniwa@webkit.org>
+
+ Perf dashboard always assigns the result of A/B testing with build request 1
+ https://bugs.webkit.org/show_bug.cgi?id=140382
+
+ Reviewed by Darin Adler.
+
+ The bug was caused by the expression array_get($report, 'jobId') or array_get($report, 'buildRequest')
+ which always evaluated to 1 when the report contained jobId. Fixed the bug by cascading array_get instead.
+
+ Also fixed a typo as well as a bug that reports were never associated with builds.
+
+ * public/include/report-processor.php:
+ (ReportProcessor::process): Don't use "or" to find the non-null value since that always evaluates to 1
+ instead of the first non-null value.
+ (ReportProcessor::resolve_build_id): Fixed the typo by adding the missing "$this->".
+ (ReportProcessor::commit): Associate the report with the corresponding build as intended.
+
2015-01-23 Ryosuke Niwa <rniwa@webkit.org>
Unreviewed typo fix. The prefix in triggerable_configurations is "trigconfig", not "trigrepo".
// FIXME: Deprecate and unsupport "jobId".
$build_id = $this->resolve_build_id($build_data, array_get($report, 'revisions', array()),
- array_get($report, 'jobId') or array_get($report, 'buildRequest'));
+ array_get($report, 'jobId', array_get($report, 'buildRequest')));
$this->runs->commit($platform_id, $build_id);
}
$this->exit_with_error('FailedToInsertBuild', $build_data);
if ($build_request_id) {
- if ($db->update_row('build_requests', 'request', array('id' => $build_request_id), array('status' => 'completed', 'build' => $build_id))
+ if ($this->db->update_row('build_requests', 'request', array('id' => $build_request_id), array('status' => 'completed', 'build' => $build_id))
!= $build_request_id)
$this->exit_with_error('FailedToUpdateBuildRequest', array('buildRequest' => $build_request_id, 'build' => $build_id));
}
}
}
- $this->db->query_and_get_affected_rows("UPDATE reports SET report_committed_at = CURRENT_TIMESTAMP AT TIME ZONE 'UTC'
- WHERE report_id = $1", array($this->report_id));
+ $this->db->query_and_get_affected_rows("UPDATE reports
+ SET (report_committed_at, report_build) = (CURRENT_TIMESTAMP AT TIME ZONE 'UTC', $2)
+ WHERE report_id = $1", array($this->report_id, $build_id));
$this->db->commit_transaction() or $this->exit_with_error('FailedToCommitTransaction');
}