From 60b42750b64123a9fcfc66bdb0e03992fa467a8f Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 10 Mar 2016 18:14:22 -0800 Subject: [PATCH] Cast old duration values for unit tests to float in DifferentialController Summary: Fixes T10549. Test Plan: N/A Reviewers: #blessed_reviewers, avivey, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Maniphest Tasks: T10549 Differential Revision: https://secure.phabricator.com/D15452 --- .../differential/controller/DifferentialController.php | 6 ++++++ .../controller/DifferentialRevisionViewController.php | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/applications/differential/controller/DifferentialController.php b/src/applications/differential/controller/DifferentialController.php index 46ac290c09..1aba876c68 100644 --- a/src/applications/differential/controller/DifferentialController.php +++ b/src/applications/differential/controller/DifferentialController.php @@ -190,6 +190,12 @@ abstract class DifferentialController extends PhabricatorController { } } + // Cast duration to a float since it used to be a string in some + // cases. + if (isset($map['duration'])) { + $map['duration'] = (double)$map['duration']; + } + return $map; } diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index afd5875a1a..cad2932a0c 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -1078,6 +1078,10 @@ final class DifferentialRevisionViewController extends DifferentialController { return null; } + if (!$diff->getBuildable()) { + return null; + } + $interesting_messages = array(); foreach ($diff->getUnitMessages() as $message) { switch ($message->getResult()) {