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

Remove arcanist projects from differential

Summary: Ref T7604. Remove arcanist projects from differential. Depends on D12687 and D12893.

Test Plan: Submitted a diff. Patched the diff with `arc patch`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7604

Differential Revision: https://secure.phabricator.com/D12894
This commit is contained in:
Joshua Spence 2015-05-19 00:36:52 +10:00
parent f8b7f03145
commit 021223907d
16 changed files with 19 additions and 179 deletions

View file

@ -11,7 +11,7 @@ return array(
'core.pkg.js' => 'a2f2598e', 'core.pkg.js' => 'a2f2598e',
'darkconsole.pkg.js' => 'e7393ebb', 'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => 'bb338e4b', 'differential.pkg.css' => 'bb338e4b',
'differential.pkg.js' => '895b8d62', 'differential.pkg.js' => '45b3b51d',
'diffusion.pkg.css' => '591664fa', 'diffusion.pkg.css' => '591664fa',
'diffusion.pkg.js' => '0115b37c', 'diffusion.pkg.js' => '0115b37c',
'maniphest.pkg.css' => '68d4dd3d', 'maniphest.pkg.css' => '68d4dd3d',
@ -397,7 +397,7 @@ return array(
'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf', 'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf',
'rsrc/js/application/releeph/releeph-request-state-change.js' => 'a0b57eb8', 'rsrc/js/application/releeph/releeph-request-state-change.js' => 'a0b57eb8',
'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f', 'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f',
'rsrc/js/application/repository/repository-crossreference.js' => 'f9539603', 'rsrc/js/application/repository/repository-crossreference.js' => '3975b470',
'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08', 'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08',
'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f', 'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f',
'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6', 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6',
@ -631,7 +631,7 @@ return array(
'javelin-behavior-remarkup-preview' => 'f7379f45', 'javelin-behavior-remarkup-preview' => 'f7379f45',
'javelin-behavior-reorder-applications' => '76b9fc3e', 'javelin-behavior-reorder-applications' => '76b9fc3e',
'javelin-behavior-reorder-columns' => 'e1d25dfb', 'javelin-behavior-reorder-columns' => 'e1d25dfb',
'javelin-behavior-repository-crossreference' => 'f9539603', 'javelin-behavior-repository-crossreference' => '3975b470',
'javelin-behavior-scrollbar' => '834a1173', 'javelin-behavior-scrollbar' => '834a1173',
'javelin-behavior-search-reorder-queries' => 'e9581f08', 'javelin-behavior-search-reorder-queries' => 'e9581f08',
'javelin-behavior-select-on-click' => '4e3e79a6', 'javelin-behavior-select-on-click' => '4e3e79a6',
@ -1041,6 +1041,12 @@ return array(
'331b1611' => array( '331b1611' => array(
'javelin-install', 'javelin-install',
), ),
'3975b470' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'javelin-uri',
),
'3ab51e2c' => array( '3ab51e2c' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-behavior-device', 'javelin-behavior-device',
@ -1986,12 +1992,6 @@ return array(
'javelin-util', 'javelin-util',
'phabricator-busy', 'phabricator-busy',
), ),
'f9539603' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'javelin-uri',
),
'fa0f4fc2' => array( 'fa0f4fc2' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',

View file

@ -296,7 +296,6 @@ phutil_register_library_map(array(
'DifferentialAdjustmentMapTestCase' => 'applications/differential/storage/__tests__/DifferentialAdjustmentMapTestCase.php', 'DifferentialAdjustmentMapTestCase' => 'applications/differential/storage/__tests__/DifferentialAdjustmentMapTestCase.php',
'DifferentialAffectedPath' => 'applications/differential/storage/DifferentialAffectedPath.php', 'DifferentialAffectedPath' => 'applications/differential/storage/DifferentialAffectedPath.php',
'DifferentialApplyPatchField' => 'applications/differential/customfield/DifferentialApplyPatchField.php', 'DifferentialApplyPatchField' => 'applications/differential/customfield/DifferentialApplyPatchField.php',
'DifferentialArcanistProjectField' => 'applications/differential/customfield/DifferentialArcanistProjectField.php',
'DifferentialAsanaRepresentationField' => 'applications/differential/customfield/DifferentialAsanaRepresentationField.php', 'DifferentialAsanaRepresentationField' => 'applications/differential/customfield/DifferentialAsanaRepresentationField.php',
'DifferentialAuditorsField' => 'applications/differential/customfield/DifferentialAuditorsField.php', 'DifferentialAuditorsField' => 'applications/differential/customfield/DifferentialAuditorsField.php',
'DifferentialAuthorField' => 'applications/differential/customfield/DifferentialAuthorField.php', 'DifferentialAuthorField' => 'applications/differential/customfield/DifferentialAuthorField.php',
@ -3542,7 +3541,6 @@ phutil_register_library_map(array(
'DifferentialAdjustmentMapTestCase' => 'ArcanistPhutilTestCase', 'DifferentialAdjustmentMapTestCase' => 'ArcanistPhutilTestCase',
'DifferentialAffectedPath' => 'DifferentialDAO', 'DifferentialAffectedPath' => 'DifferentialDAO',
'DifferentialApplyPatchField' => 'DifferentialCustomField', 'DifferentialApplyPatchField' => 'DifferentialCustomField',
'DifferentialArcanistProjectField' => 'DifferentialCustomField',
'DifferentialAsanaRepresentationField' => 'DifferentialCustomField', 'DifferentialAsanaRepresentationField' => 'DifferentialCustomField',
'DifferentialAuditorsField' => 'DifferentialStoredCustomField', 'DifferentialAuditorsField' => 'DifferentialStoredCustomField',
'DifferentialAuthorField' => 'DifferentialCustomField', 'DifferentialAuthorField' => 'DifferentialCustomField',

View file

@ -12,7 +12,6 @@ final class DifferentialCreateDiffConduitAPIMethod
} }
protected function defineParamTypes() { protected function defineParamTypes() {
$vcs_const = $this->formatStringConstants( $vcs_const = $this->formatStringConstants(
array( array(
'svn', 'svn',
@ -40,7 +39,7 @@ final class DifferentialCreateDiffConduitAPIMethod
'sourceControlPath' => 'required string', 'sourceControlPath' => 'required string',
'sourceControlBaseRevision' => 'required string', 'sourceControlBaseRevision' => 'required string',
'creationMethod' => 'optional string', 'creationMethod' => 'optional string',
'arcanistProject' => 'optional string', 'arcanistProject' => 'deprecated',
'lintStatus' => 'required '.$status_const, 'lintStatus' => 'required '.$status_const,
'unitStatus' => 'required '.$status_const, 'unitStatus' => 'required '.$status_const,
'repositoryPHID' => 'optional phid', 'repositoryPHID' => 'optional phid',
@ -84,21 +83,6 @@ final class DifferentialCreateDiffConduitAPIMethod
} }
} }
$project_name = $request->getValue('arcanistProject');
$project_phid = null;
if ($project_name) {
$arcanist_project = id(new PhabricatorRepositoryArcanistProject())
->loadOneWhere(
'name = %s',
$project_name);
if (!$arcanist_project) {
$arcanist_project = new PhabricatorRepositoryArcanistProject();
$arcanist_project->setName($project_name);
$arcanist_project->save();
}
$project_phid = $arcanist_project->getPHID();
}
switch ($request->getValue('lintStatus')) { switch ($request->getValue('lintStatus')) {
case 'skip': case 'skip':
$lint_status = DifferentialLintStatus::LINT_SKIP; $lint_status = DifferentialLintStatus::LINT_SKIP;
@ -156,7 +140,6 @@ final class DifferentialCreateDiffConduitAPIMethod
'sourceControlPath' => $request->getValue('sourceControlPath'), 'sourceControlPath' => $request->getValue('sourceControlPath'),
'sourceControlBaseRevision' => 'sourceControlBaseRevision' =>
$request->getValue('sourceControlBaseRevision'), $request->getValue('sourceControlBaseRevision'),
'arcanistProjectPHID' => $project_phid,
'lintStatus' => $lint_status, 'lintStatus' => $lint_status,
'unitStatus' => $unit_status, 'unitStatus' => $unit_status,
); );

View file

@ -17,13 +17,15 @@ final class DifferentialGetDiffConduitAPIMethod
public function getMethodStatusDescription() { public function getMethodStatusDescription() {
return pht( return pht(
'This method has been deprecated in favor of differential.querydiffs.'); 'This method has been deprecated in favor of %s.',
'differential.querydiffs');
} }
public function getMethodDescription() { public function getMethodDescription() {
return pht('Load the content of a diff from Differential by revision id '. return pht(
'or diff id.'); 'Load the content of a diff from Differential by revision id '.
'or diff id.');
} }
protected function defineParamTypes() { protected function defineParamTypes() {
@ -67,7 +69,6 @@ final class DifferentialGetDiffConduitAPIMethod
->setViewer($request->getUser()) ->setViewer($request->getUser())
->withIDs(array($diff_id)) ->withIDs(array($diff_id))
->needChangesets(true) ->needChangesets(true)
->needArcanistProjects(true)
->executeOne(); ->executeOne();
} }

View file

@ -12,11 +12,11 @@ final class DifferentialGetRevisionConduitAPIMethod
} }
public function getMethodStatusDescription() { public function getMethodStatusDescription() {
return "Replaced by 'differential.query'."; return pht("Replaced by '%s'.", 'differential.query');
} }
public function getMethodDescription() { public function getMethodDescription() {
return 'Load the content of a revision from Differential.'; return pht('Load the content of a revision from Differential.');
} }
protected function defineParamTypes() { protected function defineParamTypes() {
@ -31,7 +31,7 @@ final class DifferentialGetRevisionConduitAPIMethod
protected function defineErrorTypes() { protected function defineErrorTypes() {
return array( return array(
'ERR_BAD_REVISION' => 'No such revision exists.', 'ERR_BAD_REVISION' => pht('No such revision exists.'),
); );
} }
@ -56,7 +56,6 @@ final class DifferentialGetRevisionConduitAPIMethod
->setViewer($request->getUser()) ->setViewer($request->getUser())
->withRevisionIDs(array($revision_id)) ->withRevisionIDs(array($revision_id))
->needChangesets(true) ->needChangesets(true)
->needArcanistProjects(true)
->execute(); ->execute();
$diff_dicts = mpull($diffs, 'getDiffDict'); $diff_dicts = mpull($diffs, 'getDiffDict');

View file

@ -44,7 +44,6 @@ final class DifferentialQueryConduitAPIMethod
'subscribers' => 'optional list<phid>', 'subscribers' => 'optional list<phid>',
'responsibleUsers' => 'optional list<phid>', 'responsibleUsers' => 'optional list<phid>',
'branches' => 'optional list<string>', 'branches' => 'optional list<string>',
'arcanistProjects' => 'optional list<string>',
); );
} }
@ -73,7 +72,6 @@ final class DifferentialQueryConduitAPIMethod
$subscribers = $request->getValue('subscribers'); $subscribers = $request->getValue('subscribers');
$responsible_users = $request->getValue('responsibleUsers'); $responsible_users = $request->getValue('responsibleUsers');
$branches = $request->getValue('branches'); $branches = $request->getValue('branches');
$arc_projects = $request->getValue('arcanistProjects');
$query = id(new DifferentialRevisionQuery()) $query = id(new DifferentialRevisionQuery())
->setViewer($request->getUser()); ->setViewer($request->getUser());
@ -169,19 +167,6 @@ final class DifferentialQueryConduitAPIMethod
if ($branches) { if ($branches) {
$query->withBranches($branches); $query->withBranches($branches);
} }
if ($arc_projects) {
// This is sort of special-cased, but don't make arc do an extra round
// trip.
$projects = id(new PhabricatorRepositoryArcanistProject())
->loadAllWhere(
'name in (%Ls)',
$arc_projects);
if (!$projects) {
return array();
}
$query->withArcanistProjectPHIDs(mpull($projects, 'getPHID'));
}
$query->needRelationships(true); $query->needRelationships(true);
$query->needCommitPHIDs(true); $query->needCommitPHIDs(true);
@ -228,7 +213,6 @@ final class DifferentialQueryConduitAPIMethod
'ccs' => array_values($revision->getCCPHIDs()), 'ccs' => array_values($revision->getCCPHIDs()),
'hashes' => $revision->getHashes(), 'hashes' => $revision->getHashes(),
'auxiliary' => idx($field_data, $phid, array()), 'auxiliary' => idx($field_data, $phid, array()),
'arcanistProjectPHID' => $diff->getArcanistProjectPHID(),
'repositoryPHID' => $diff->getRepositoryPHID(), 'repositoryPHID' => $diff->getRepositoryPHID(),
); );

View file

@ -33,7 +33,6 @@ final class DifferentialQueryDiffsConduitAPIMethod
->withIDs($ids) ->withIDs($ids)
->withRevisionIDs($revision_ids) ->withRevisionIDs($revision_ids)
->needChangesets(true) ->needChangesets(true)
->needArcanistProjects(true)
->execute(); ->execute();
} }

View file

@ -33,7 +33,6 @@ final class DifferentialRevisionViewController extends DifferentialController {
$diffs = id(new DifferentialDiffQuery()) $diffs = id(new DifferentialDiffQuery())
->setViewer($request->getUser()) ->setViewer($request->getUser())
->withRevisionIDs(array($this->revisionID)) ->withRevisionIDs(array($this->revisionID))
->needArcanistProjects(true)
->execute(); ->execute();
$diffs = array_reverse($diffs, $preserve_keys = true); $diffs = array_reverse($diffs, $preserve_keys = true);

View file

@ -1,42 +0,0 @@
<?php
final class DifferentialArcanistProjectField
extends DifferentialCustomField {
public function getFieldKey() {
return 'differential:arcanist-project';
}
public function getFieldName() {
return pht('Arcanist Project');
}
public function getFieldDescription() {
return pht('Shows arcanist project name.');
}
public function shouldAppearInPropertyView() {
return true;
}
public function renderPropertyViewLabel() {
return $this->getFieldName();
}
public function getRequiredHandlePHIDsForPropertyView() {
$phid = $this->getArcanistProjectPHID();
if ($phid) {
return array($phid);
}
return array();
}
public function renderPropertyViewValue(array $handles) {
return $this->renderHandleList($handles);
}
private function getArcanistProjectPHID() {
return $this->getObject()->getActiveDiff()->getArcanistProjectPHID();
}
}

View file

@ -234,8 +234,7 @@ final class DifferentialDiffEditor
->setSourceControlPath(idx($dict, 'sourceControlPath')) ->setSourceControlPath(idx($dict, 'sourceControlPath'))
->setSourceControlBaseRevision(idx($dict, 'sourceControlBaseRevision')) ->setSourceControlBaseRevision(idx($dict, 'sourceControlBaseRevision'))
->setLintStatus(idx($dict, 'lintStatus')) ->setLintStatus(idx($dict, 'lintStatus'))
->setUnitStatus(idx($dict, 'unitStatus')) ->setUnitStatus(idx($dict, 'unitStatus'));
->setArcanistProjectPHID(idx($dict, 'arcanistProjectPHID'));
return $diff; return $diff;
} }

View file

@ -220,7 +220,6 @@ final class DifferentialTransactionEditor
} else { } else {
$object->setRepositoryPHID($diff->getRepositoryPHID()); $object->setRepositoryPHID($diff->getRepositoryPHID());
} }
$object->setArcanistProjectPHID($diff->getArcanistProjectPHID());
$object->attachActiveDiff($diff); $object->attachActiveDiff($diff);
// TODO: Update the `diffPHID` once we add that. // TODO: Update the `diffPHID` once we add that.

View file

@ -7,7 +7,6 @@ final class DifferentialDiffQuery
private $phids; private $phids;
private $revisionIDs; private $revisionIDs;
private $needChangesets = false; private $needChangesets = false;
private $needArcanistProjects = false;
public function withIDs(array $ids) { public function withIDs(array $ids) {
$this->ids = $ids; $this->ids = $ids;
@ -29,11 +28,6 @@ final class DifferentialDiffQuery
return $this; return $this;
} }
public function needArcanistProjects($bool) {
$this->needArcanistProjects = $bool;
return $this;
}
protected function loadPage() { protected function loadPage() {
$table = new DifferentialDiff(); $table = new DifferentialDiff();
$conn_r = $table->establishConnection('r'); $conn_r = $table->establishConnection('r');
@ -79,10 +73,6 @@ final class DifferentialDiffQuery
$diffs = $this->loadChangesets($diffs); $diffs = $this->loadChangesets($diffs);
} }
if ($diffs && $this->needArcanistProjects) {
$diffs = $this->loadArcanistProjects($diffs);
}
return $diffs; return $diffs;
} }
@ -98,29 +88,6 @@ final class DifferentialDiffQuery
return $diffs; return $diffs;
} }
private function loadArcanistProjects(array $diffs) {
$phids = array_filter(mpull($diffs, 'getArcanistProjectPHID'));
$projects = array();
$project_map = array();
if ($phids) {
$projects = id(new PhabricatorRepositoryArcanistProject())
->loadAllWhere(
'phid IN (%Ls)',
$phids);
$project_map = mpull($projects, null, 'getPHID');
}
foreach ($diffs as $diff) {
$project = null;
if ($diff->getArcanistProjectPHID()) {
$project = idx($project_map, $diff->getArcanistProjectPHID());
}
$diff->attachArcanistProject($project);
}
return $diffs;
}
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
$where = array(); $where = array();

View file

@ -22,22 +22,6 @@ final class DifferentialRepositoryLookup extends Phobject {
$viewer = $this->viewer; $viewer = $this->viewer;
$diff = $this->diff; $diff = $this->diff;
// Look for an explicit Arcanist project.
if ($diff->getArcanistProjectPHID()) {
$project = id(new PhabricatorRepositoryArcanistProject())->loadOneWhere(
'phid = %s',
$diff->getArcanistProjectPHID());
if ($project && $project->getRepositoryID()) {
$repositories = id(new PhabricatorRepositoryQuery())
->setViewer($viewer)
->withIDs(array($project->getRepositoryID()))
->execute();
if ($repositories) {
return head($repositories);
}
}
}
// Look for a repository UUID. // Look for a repository UUID.
if ($diff->getRepositoryUUID()) { if ($diff->getRepositoryUUID()) {
$repositories = id(new PhabricatorRepositoryQuery()) $repositories = id(new PhabricatorRepositoryQuery())

View file

@ -36,7 +36,6 @@ final class DifferentialRevisionQuery
private $phids = array(); private $phids = array();
private $responsibles = array(); private $responsibles = array();
private $branches = array(); private $branches = array();
private $arcanistProjectPHIDs = array();
private $repositoryPHIDs; private $repositoryPHIDs;
private $updatedEpochMin; private $updatedEpochMin;
private $updatedEpochMax; private $updatedEpochMax;
@ -228,19 +227,6 @@ final class DifferentialRevisionQuery
} }
/**
* Filter results to only return revisions with a given set of arcanist
* projects.
*
* @param array List of project PHIDs.
* @return this
* @task config
*/
public function withArcanistProjectPHIDs(array $arc_project_phids) {
$this->arcanistProjectPHIDs = $arc_project_phids;
return $this;
}
public function withRepositoryPHIDs(array $repository_phids) { public function withRepositoryPHIDs(array $repository_phids) {
$this->repositoryPHIDs = $repository_phids; $this->repositoryPHIDs = $repository_phids;
return $this; return $this;
@ -771,13 +757,6 @@ final class DifferentialRevisionQuery
$this->branches); $this->branches);
} }
if ($this->arcanistProjectPHIDs) {
$where[] = qsprintf(
$conn_r,
'r.arcanistProjectPHID in (%Ls)',
$this->arcanistProjectPHIDs);
}
if ($this->updatedEpochMin !== null) { if ($this->updatedEpochMin !== null) {
$where[] = qsprintf( $where[] = qsprintf(
$conn_r, $conn_r,

View file

@ -262,7 +262,6 @@ final class DifferentialDiff
'lintStatus' => $this->getLintStatus(), 'lintStatus' => $this->getLintStatus(),
'changes' => array(), 'changes' => array(),
'properties' => array(), 'properties' => array(),
'projectName' => $this->getArcanistProjectName(),
); );
$dict['changes'] = $this->buildChangesList(); $dict['changes'] = $this->buildChangesList();

View file

@ -321,14 +321,6 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
$this->repository->getCallsign(). $this->repository->getCallsign().
$this->commit->getCommitIdentifier()); $this->commit->getCommitIdentifier());
// TODO: This is not correct in SVN where one repository can have multiple
// Arcanist projects.
$arcanist_project = id(new PhabricatorRepositoryArcanistProject())
->loadOneWhere('repositoryID = %d LIMIT 1', $this->repository->getID());
if ($arcanist_project) {
$diff->setArcanistProjectPHID($arcanist_project->getPHID());
}
$parents = DiffusionQuery::callConduitWithDiffusionRequest( $parents = DiffusionQuery::callConduitWithDiffusionRequest(
$viewer, $viewer,
$drequest, $drequest,