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:
parent
f8b7f03145
commit
021223907d
16 changed files with 19 additions and 179 deletions
|
@ -11,7 +11,7 @@ return array(
|
|||
'core.pkg.js' => 'a2f2598e',
|
||||
'darkconsole.pkg.js' => 'e7393ebb',
|
||||
'differential.pkg.css' => 'bb338e4b',
|
||||
'differential.pkg.js' => '895b8d62',
|
||||
'differential.pkg.js' => '45b3b51d',
|
||||
'diffusion.pkg.css' => '591664fa',
|
||||
'diffusion.pkg.js' => '0115b37c',
|
||||
'maniphest.pkg.css' => '68d4dd3d',
|
||||
|
@ -397,7 +397,7 @@ return array(
|
|||
'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-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/slowvote/behavior-slowvote-embed.js' => '887ad43f',
|
||||
'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6',
|
||||
|
@ -631,7 +631,7 @@ return array(
|
|||
'javelin-behavior-remarkup-preview' => 'f7379f45',
|
||||
'javelin-behavior-reorder-applications' => '76b9fc3e',
|
||||
'javelin-behavior-reorder-columns' => 'e1d25dfb',
|
||||
'javelin-behavior-repository-crossreference' => 'f9539603',
|
||||
'javelin-behavior-repository-crossreference' => '3975b470',
|
||||
'javelin-behavior-scrollbar' => '834a1173',
|
||||
'javelin-behavior-search-reorder-queries' => 'e9581f08',
|
||||
'javelin-behavior-select-on-click' => '4e3e79a6',
|
||||
|
@ -1041,6 +1041,12 @@ return array(
|
|||
'331b1611' => array(
|
||||
'javelin-install',
|
||||
),
|
||||
'3975b470' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
'javelin-stratcom',
|
||||
'javelin-uri',
|
||||
),
|
||||
'3ab51e2c' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-behavior-device',
|
||||
|
@ -1986,12 +1992,6 @@ return array(
|
|||
'javelin-util',
|
||||
'phabricator-busy',
|
||||
),
|
||||
'f9539603' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
'javelin-stratcom',
|
||||
'javelin-uri',
|
||||
),
|
||||
'fa0f4fc2' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
|
|
|
@ -296,7 +296,6 @@ phutil_register_library_map(array(
|
|||
'DifferentialAdjustmentMapTestCase' => 'applications/differential/storage/__tests__/DifferentialAdjustmentMapTestCase.php',
|
||||
'DifferentialAffectedPath' => 'applications/differential/storage/DifferentialAffectedPath.php',
|
||||
'DifferentialApplyPatchField' => 'applications/differential/customfield/DifferentialApplyPatchField.php',
|
||||
'DifferentialArcanistProjectField' => 'applications/differential/customfield/DifferentialArcanistProjectField.php',
|
||||
'DifferentialAsanaRepresentationField' => 'applications/differential/customfield/DifferentialAsanaRepresentationField.php',
|
||||
'DifferentialAuditorsField' => 'applications/differential/customfield/DifferentialAuditorsField.php',
|
||||
'DifferentialAuthorField' => 'applications/differential/customfield/DifferentialAuthorField.php',
|
||||
|
@ -3542,7 +3541,6 @@ phutil_register_library_map(array(
|
|||
'DifferentialAdjustmentMapTestCase' => 'ArcanistPhutilTestCase',
|
||||
'DifferentialAffectedPath' => 'DifferentialDAO',
|
||||
'DifferentialApplyPatchField' => 'DifferentialCustomField',
|
||||
'DifferentialArcanistProjectField' => 'DifferentialCustomField',
|
||||
'DifferentialAsanaRepresentationField' => 'DifferentialCustomField',
|
||||
'DifferentialAuditorsField' => 'DifferentialStoredCustomField',
|
||||
'DifferentialAuthorField' => 'DifferentialCustomField',
|
||||
|
|
|
@ -12,7 +12,6 @@ final class DifferentialCreateDiffConduitAPIMethod
|
|||
}
|
||||
|
||||
protected function defineParamTypes() {
|
||||
|
||||
$vcs_const = $this->formatStringConstants(
|
||||
array(
|
||||
'svn',
|
||||
|
@ -40,7 +39,7 @@ final class DifferentialCreateDiffConduitAPIMethod
|
|||
'sourceControlPath' => 'required string',
|
||||
'sourceControlBaseRevision' => 'required string',
|
||||
'creationMethod' => 'optional string',
|
||||
'arcanistProject' => 'optional string',
|
||||
'arcanistProject' => 'deprecated',
|
||||
'lintStatus' => 'required '.$status_const,
|
||||
'unitStatus' => 'required '.$status_const,
|
||||
'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')) {
|
||||
case 'skip':
|
||||
$lint_status = DifferentialLintStatus::LINT_SKIP;
|
||||
|
@ -156,7 +140,6 @@ final class DifferentialCreateDiffConduitAPIMethod
|
|||
'sourceControlPath' => $request->getValue('sourceControlPath'),
|
||||
'sourceControlBaseRevision' =>
|
||||
$request->getValue('sourceControlBaseRevision'),
|
||||
'arcanistProjectPHID' => $project_phid,
|
||||
'lintStatus' => $lint_status,
|
||||
'unitStatus' => $unit_status,
|
||||
);
|
||||
|
|
|
@ -17,13 +17,15 @@ final class DifferentialGetDiffConduitAPIMethod
|
|||
|
||||
public function getMethodStatusDescription() {
|
||||
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() {
|
||||
return pht('Load the content of a diff from Differential by revision id '.
|
||||
'or diff id.');
|
||||
return pht(
|
||||
'Load the content of a diff from Differential by revision id '.
|
||||
'or diff id.');
|
||||
}
|
||||
|
||||
protected function defineParamTypes() {
|
||||
|
@ -67,7 +69,6 @@ final class DifferentialGetDiffConduitAPIMethod
|
|||
->setViewer($request->getUser())
|
||||
->withIDs(array($diff_id))
|
||||
->needChangesets(true)
|
||||
->needArcanistProjects(true)
|
||||
->executeOne();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@ final class DifferentialGetRevisionConduitAPIMethod
|
|||
}
|
||||
|
||||
public function getMethodStatusDescription() {
|
||||
return "Replaced by 'differential.query'.";
|
||||
return pht("Replaced by '%s'.", 'differential.query');
|
||||
}
|
||||
|
||||
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() {
|
||||
|
@ -31,7 +31,7 @@ final class DifferentialGetRevisionConduitAPIMethod
|
|||
|
||||
protected function defineErrorTypes() {
|
||||
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())
|
||||
->withRevisionIDs(array($revision_id))
|
||||
->needChangesets(true)
|
||||
->needArcanistProjects(true)
|
||||
->execute();
|
||||
$diff_dicts = mpull($diffs, 'getDiffDict');
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ final class DifferentialQueryConduitAPIMethod
|
|||
'subscribers' => 'optional list<phid>',
|
||||
'responsibleUsers' => 'optional list<phid>',
|
||||
'branches' => 'optional list<string>',
|
||||
'arcanistProjects' => 'optional list<string>',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -73,7 +72,6 @@ final class DifferentialQueryConduitAPIMethod
|
|||
$subscribers = $request->getValue('subscribers');
|
||||
$responsible_users = $request->getValue('responsibleUsers');
|
||||
$branches = $request->getValue('branches');
|
||||
$arc_projects = $request->getValue('arcanistProjects');
|
||||
|
||||
$query = id(new DifferentialRevisionQuery())
|
||||
->setViewer($request->getUser());
|
||||
|
@ -169,19 +167,6 @@ final class DifferentialQueryConduitAPIMethod
|
|||
if ($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->needCommitPHIDs(true);
|
||||
|
@ -228,7 +213,6 @@ final class DifferentialQueryConduitAPIMethod
|
|||
'ccs' => array_values($revision->getCCPHIDs()),
|
||||
'hashes' => $revision->getHashes(),
|
||||
'auxiliary' => idx($field_data, $phid, array()),
|
||||
'arcanistProjectPHID' => $diff->getArcanistProjectPHID(),
|
||||
'repositoryPHID' => $diff->getRepositoryPHID(),
|
||||
);
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ final class DifferentialQueryDiffsConduitAPIMethod
|
|||
->withIDs($ids)
|
||||
->withRevisionIDs($revision_ids)
|
||||
->needChangesets(true)
|
||||
->needArcanistProjects(true)
|
||||
->execute();
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
|||
$diffs = id(new DifferentialDiffQuery())
|
||||
->setViewer($request->getUser())
|
||||
->withRevisionIDs(array($this->revisionID))
|
||||
->needArcanistProjects(true)
|
||||
->execute();
|
||||
$diffs = array_reverse($diffs, $preserve_keys = true);
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
|
@ -234,8 +234,7 @@ final class DifferentialDiffEditor
|
|||
->setSourceControlPath(idx($dict, 'sourceControlPath'))
|
||||
->setSourceControlBaseRevision(idx($dict, 'sourceControlBaseRevision'))
|
||||
->setLintStatus(idx($dict, 'lintStatus'))
|
||||
->setUnitStatus(idx($dict, 'unitStatus'))
|
||||
->setArcanistProjectPHID(idx($dict, 'arcanistProjectPHID'));
|
||||
->setUnitStatus(idx($dict, 'unitStatus'));
|
||||
|
||||
return $diff;
|
||||
}
|
||||
|
|
|
@ -220,7 +220,6 @@ final class DifferentialTransactionEditor
|
|||
} else {
|
||||
$object->setRepositoryPHID($diff->getRepositoryPHID());
|
||||
}
|
||||
$object->setArcanistProjectPHID($diff->getArcanistProjectPHID());
|
||||
$object->attachActiveDiff($diff);
|
||||
|
||||
// TODO: Update the `diffPHID` once we add that.
|
||||
|
|
|
@ -7,7 +7,6 @@ final class DifferentialDiffQuery
|
|||
private $phids;
|
||||
private $revisionIDs;
|
||||
private $needChangesets = false;
|
||||
private $needArcanistProjects = false;
|
||||
|
||||
public function withIDs(array $ids) {
|
||||
$this->ids = $ids;
|
||||
|
@ -29,11 +28,6 @@ final class DifferentialDiffQuery
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function needArcanistProjects($bool) {
|
||||
$this->needArcanistProjects = $bool;
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function loadPage() {
|
||||
$table = new DifferentialDiff();
|
||||
$conn_r = $table->establishConnection('r');
|
||||
|
@ -79,10 +73,6 @@ final class DifferentialDiffQuery
|
|||
$diffs = $this->loadChangesets($diffs);
|
||||
}
|
||||
|
||||
if ($diffs && $this->needArcanistProjects) {
|
||||
$diffs = $this->loadArcanistProjects($diffs);
|
||||
}
|
||||
|
||||
return $diffs;
|
||||
}
|
||||
|
||||
|
@ -98,29 +88,6 @@ final class DifferentialDiffQuery
|
|||
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) {
|
||||
$where = array();
|
||||
|
||||
|
|
|
@ -22,22 +22,6 @@ final class DifferentialRepositoryLookup extends Phobject {
|
|||
$viewer = $this->viewer;
|
||||
$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.
|
||||
if ($diff->getRepositoryUUID()) {
|
||||
$repositories = id(new PhabricatorRepositoryQuery())
|
||||
|
|
|
@ -36,7 +36,6 @@ final class DifferentialRevisionQuery
|
|||
private $phids = array();
|
||||
private $responsibles = array();
|
||||
private $branches = array();
|
||||
private $arcanistProjectPHIDs = array();
|
||||
private $repositoryPHIDs;
|
||||
private $updatedEpochMin;
|
||||
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) {
|
||||
$this->repositoryPHIDs = $repository_phids;
|
||||
return $this;
|
||||
|
@ -771,13 +757,6 @@ final class DifferentialRevisionQuery
|
|||
$this->branches);
|
||||
}
|
||||
|
||||
if ($this->arcanistProjectPHIDs) {
|
||||
$where[] = qsprintf(
|
||||
$conn_r,
|
||||
'r.arcanistProjectPHID in (%Ls)',
|
||||
$this->arcanistProjectPHIDs);
|
||||
}
|
||||
|
||||
if ($this->updatedEpochMin !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn_r,
|
||||
|
|
|
@ -262,7 +262,6 @@ final class DifferentialDiff
|
|||
'lintStatus' => $this->getLintStatus(),
|
||||
'changes' => array(),
|
||||
'properties' => array(),
|
||||
'projectName' => $this->getArcanistProjectName(),
|
||||
);
|
||||
|
||||
$dict['changes'] = $this->buildChangesList();
|
||||
|
|
|
@ -321,14 +321,6 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
|
|||
$this->repository->getCallsign().
|
||||
$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(
|
||||
$viewer,
|
||||
$drequest,
|
||||
|
|
Loading…
Reference in a new issue