1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

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
This commit is contained in:
epriestley 2015-09-01 15:35:25 -07:00
parent 809c7fb4f3
commit 13516cf35f
3 changed files with 17 additions and 18 deletions

View file

@ -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',

View file

@ -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;
}

View file

@ -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();
}
}