From 13516cf35f0369632814e4e14a66403cdaa4eda8 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 1 Sep 2015 15:35:25 -0700 Subject: [PATCH] Fix an issue with "packages(...)" in typeaheads Summary: Fixes T9302. This datasource wasn't resolving package PHIDs correctly for the actual query. Also fixes an issue with the "Affected packages that need audit" Herald rule. Test Plan: Ran a "Needs Audit" query with only packages, and only `packages(user)`. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9302 Differential Revision: https://secure.phabricator.com/D14029 --- resources/celerity/map.php | 20 +++++++++---------- .../diffusion/herald/HeraldCommitAdapter.php | 4 +--- ...habricatorOwnersPackageOwnerDatasource.php | 11 +++++----- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 7e000ecb6a..c600d8d7bd 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'core.pkg.css' => '928faf7e', - 'core.pkg.js' => 'a590b451', + 'core.pkg.js' => '47dc9ebb', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', 'differential.pkg.js' => '813c1633', @@ -210,7 +210,7 @@ return array( 'rsrc/externals/javelin/ext/view/__tests__/ViewInterpreter.js' => '7a94d6a5', 'rsrc/externals/javelin/ext/view/__tests__/ViewRenderer.js' => '6ea96ac9', 'rsrc/externals/javelin/lib/Cookie.js' => '62dfea03', - 'rsrc/externals/javelin/lib/DOM.js' => '147805fa', + 'rsrc/externals/javelin/lib/DOM.js' => '805b806a', 'rsrc/externals/javelin/lib/History.js' => 'd4505101', 'rsrc/externals/javelin/lib/JSON.js' => '69adf288', 'rsrc/externals/javelin/lib/Leader.js' => '331b1611', @@ -659,7 +659,7 @@ return array( 'javelin-color' => '7e41274a', 'javelin-cookie' => '62dfea03', 'javelin-diffusion-locate-file-source' => 'b42eddc7', - 'javelin-dom' => '147805fa', + 'javelin-dom' => '805b806a', 'javelin-dynval' => 'f6555212', 'javelin-event' => '85ea0626', 'javelin-fx' => '54b612ba', @@ -918,13 +918,6 @@ return array( 'javelin-uri', 'phabricator-textareautils', ), - '147805fa' => array( - 'javelin-magical-init', - 'javelin-install', - 'javelin-util', - 'javelin-vector', - 'javelin-stratcom', - ), '1499a8cb' => array( 'javelin-behavior', 'javelin-stratcom', @@ -1451,6 +1444,13 @@ return array( 'javelin-behavior', 'javelin-history', ), + '805b806a' => array( + 'javelin-magical-init', + 'javelin-install', + 'javelin-util', + 'javelin-vector', + 'javelin-stratcom', + ), 82439934 => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/applications/diffusion/herald/HeraldCommitAdapter.php b/src/applications/diffusion/herald/HeraldCommitAdapter.php index ab3e850475..ed82e90820 100644 --- a/src/applications/diffusion/herald/HeraldCommitAdapter.php +++ b/src/applications/diffusion/herald/HeraldCommitAdapter.php @@ -168,9 +168,7 @@ final class HeraldCommitAdapter 'commitPHID = %s AND auditStatus IN (%Ls)', $this->commit->getPHID(), $status_arr); - - $packages = mpull($requests, 'getAuditorPHID'); - $this->auditNeededPackages = $packages; + $this->auditNeededPackages = $requests; } return $this->auditNeededPackages; } diff --git a/src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php b/src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php index a9aa80ef48..99e770d266 100644 --- a/src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php +++ b/src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php @@ -62,19 +62,20 @@ final class PhabricatorOwnersPackageOwnerDatasource $phids = $this->resolvePHIDs($phids); $user_phids = array(); - foreach ($phids as $phid) { + foreach ($phids as $key => $phid) { if (phid_get_type($phid) == PhabricatorPeopleUserPHIDType::TYPECONST) { $user_phids[] = $phid; + unset($phids[$key]); } } if ($user_phids) { - $projects = id(new PhabricatorProjectQuery()) + $packages = id(new PhabricatorOwnersPackageQuery()) ->setViewer($this->getViewer()) - ->withMemberPHIDs($user_phids) + ->withOwnerPHIDs($user_phids) ->execute(); - foreach ($projects as $project) { - $phids[] = $project->getPHID(); + foreach ($packages as $package) { + $phids[] = $package->getPHID(); } }