@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

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

+19 -179
+9 -9
resources/celerity/map.php
··· 11 11 'core.pkg.js' => 'a2f2598e', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => 'bb338e4b', 14 - 'differential.pkg.js' => '895b8d62', 14 + 'differential.pkg.js' => '45b3b51d', 15 15 'diffusion.pkg.css' => '591664fa', 16 16 'diffusion.pkg.js' => '0115b37c', 17 17 'maniphest.pkg.css' => '68d4dd3d', ··· 397 397 'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf', 398 398 'rsrc/js/application/releeph/releeph-request-state-change.js' => 'a0b57eb8', 399 399 'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f', 400 - 'rsrc/js/application/repository/repository-crossreference.js' => 'f9539603', 400 + 'rsrc/js/application/repository/repository-crossreference.js' => '3975b470', 401 401 'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08', 402 402 'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f', 403 403 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6', ··· 631 631 'javelin-behavior-remarkup-preview' => 'f7379f45', 632 632 'javelin-behavior-reorder-applications' => '76b9fc3e', 633 633 'javelin-behavior-reorder-columns' => 'e1d25dfb', 634 - 'javelin-behavior-repository-crossreference' => 'f9539603', 634 + 'javelin-behavior-repository-crossreference' => '3975b470', 635 635 'javelin-behavior-scrollbar' => '834a1173', 636 636 'javelin-behavior-search-reorder-queries' => 'e9581f08', 637 637 'javelin-behavior-select-on-click' => '4e3e79a6', ··· 1041 1041 '331b1611' => array( 1042 1042 'javelin-install', 1043 1043 ), 1044 + '3975b470' => array( 1045 + 'javelin-behavior', 1046 + 'javelin-dom', 1047 + 'javelin-stratcom', 1048 + 'javelin-uri', 1049 + ), 1044 1050 '3ab51e2c' => array( 1045 1051 'javelin-behavior', 1046 1052 'javelin-behavior-device', ··· 1985 1991 'javelin-mask', 1986 1992 'javelin-util', 1987 1993 'phabricator-busy', 1988 - ), 1989 - 'f9539603' => array( 1990 - 'javelin-behavior', 1991 - 'javelin-dom', 1992 - 'javelin-stratcom', 1993 - 'javelin-uri', 1994 1994 ), 1995 1995 'fa0f4fc2' => array( 1996 1996 'javelin-behavior',
-2
src/__phutil_library_map__.php
··· 296 296 'DifferentialAdjustmentMapTestCase' => 'applications/differential/storage/__tests__/DifferentialAdjustmentMapTestCase.php', 297 297 'DifferentialAffectedPath' => 'applications/differential/storage/DifferentialAffectedPath.php', 298 298 'DifferentialApplyPatchField' => 'applications/differential/customfield/DifferentialApplyPatchField.php', 299 - 'DifferentialArcanistProjectField' => 'applications/differential/customfield/DifferentialArcanistProjectField.php', 300 299 'DifferentialAsanaRepresentationField' => 'applications/differential/customfield/DifferentialAsanaRepresentationField.php', 301 300 'DifferentialAuditorsField' => 'applications/differential/customfield/DifferentialAuditorsField.php', 302 301 'DifferentialAuthorField' => 'applications/differential/customfield/DifferentialAuthorField.php', ··· 3542 3541 'DifferentialAdjustmentMapTestCase' => 'ArcanistPhutilTestCase', 3543 3542 'DifferentialAffectedPath' => 'DifferentialDAO', 3544 3543 'DifferentialApplyPatchField' => 'DifferentialCustomField', 3545 - 'DifferentialArcanistProjectField' => 'DifferentialCustomField', 3546 3544 'DifferentialAsanaRepresentationField' => 'DifferentialCustomField', 3547 3545 'DifferentialAuditorsField' => 'DifferentialStoredCustomField', 3548 3546 'DifferentialAuthorField' => 'DifferentialCustomField',
+1 -18
src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
··· 12 12 } 13 13 14 14 protected function defineParamTypes() { 15 - 16 15 $vcs_const = $this->formatStringConstants( 17 16 array( 18 17 'svn', ··· 40 39 'sourceControlPath' => 'required string', 41 40 'sourceControlBaseRevision' => 'required string', 42 41 'creationMethod' => 'optional string', 43 - 'arcanistProject' => 'optional string', 42 + 'arcanistProject' => 'deprecated', 44 43 'lintStatus' => 'required '.$status_const, 45 44 'unitStatus' => 'required '.$status_const, 46 45 'repositoryPHID' => 'optional phid', ··· 84 83 } 85 84 } 86 85 87 - $project_name = $request->getValue('arcanistProject'); 88 - $project_phid = null; 89 - if ($project_name) { 90 - $arcanist_project = id(new PhabricatorRepositoryArcanistProject()) 91 - ->loadOneWhere( 92 - 'name = %s', 93 - $project_name); 94 - if (!$arcanist_project) { 95 - $arcanist_project = new PhabricatorRepositoryArcanistProject(); 96 - $arcanist_project->setName($project_name); 97 - $arcanist_project->save(); 98 - } 99 - $project_phid = $arcanist_project->getPHID(); 100 - } 101 - 102 86 switch ($request->getValue('lintStatus')) { 103 87 case 'skip': 104 88 $lint_status = DifferentialLintStatus::LINT_SKIP; ··· 156 140 'sourceControlPath' => $request->getValue('sourceControlPath'), 157 141 'sourceControlBaseRevision' => 158 142 $request->getValue('sourceControlBaseRevision'), 159 - 'arcanistProjectPHID' => $project_phid, 160 143 'lintStatus' => $lint_status, 161 144 'unitStatus' => $unit_status, 162 145 );
+5 -4
src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php
··· 17 17 18 18 public function getMethodStatusDescription() { 19 19 return pht( 20 - 'This method has been deprecated in favor of differential.querydiffs.'); 20 + 'This method has been deprecated in favor of %s.', 21 + 'differential.querydiffs'); 21 22 } 22 23 23 24 24 25 public function getMethodDescription() { 25 - return pht('Load the content of a diff from Differential by revision id '. 26 - 'or diff id.'); 26 + return pht( 27 + 'Load the content of a diff from Differential by revision id '. 28 + 'or diff id.'); 27 29 } 28 30 29 31 protected function defineParamTypes() { ··· 67 69 ->setViewer($request->getUser()) 68 70 ->withIDs(array($diff_id)) 69 71 ->needChangesets(true) 70 - ->needArcanistProjects(true) 71 72 ->executeOne(); 72 73 } 73 74
+3 -4
src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php
··· 12 12 } 13 13 14 14 public function getMethodStatusDescription() { 15 - return "Replaced by 'differential.query'."; 15 + return pht("Replaced by '%s'.", 'differential.query'); 16 16 } 17 17 18 18 public function getMethodDescription() { 19 - return 'Load the content of a revision from Differential.'; 19 + return pht('Load the content of a revision from Differential.'); 20 20 } 21 21 22 22 protected function defineParamTypes() { ··· 31 31 32 32 protected function defineErrorTypes() { 33 33 return array( 34 - 'ERR_BAD_REVISION' => 'No such revision exists.', 34 + 'ERR_BAD_REVISION' => pht('No such revision exists.'), 35 35 ); 36 36 } 37 37 ··· 56 56 ->setViewer($request->getUser()) 57 57 ->withRevisionIDs(array($revision_id)) 58 58 ->needChangesets(true) 59 - ->needArcanistProjects(true) 60 59 ->execute(); 61 60 $diff_dicts = mpull($diffs, 'getDiffDict'); 62 61
-16
src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php
··· 44 44 'subscribers' => 'optional list<phid>', 45 45 'responsibleUsers' => 'optional list<phid>', 46 46 'branches' => 'optional list<string>', 47 - 'arcanistProjects' => 'optional list<string>', 48 47 ); 49 48 } 50 49 ··· 73 72 $subscribers = $request->getValue('subscribers'); 74 73 $responsible_users = $request->getValue('responsibleUsers'); 75 74 $branches = $request->getValue('branches'); 76 - $arc_projects = $request->getValue('arcanistProjects'); 77 75 78 76 $query = id(new DifferentialRevisionQuery()) 79 77 ->setViewer($request->getUser()); ··· 169 167 if ($branches) { 170 168 $query->withBranches($branches); 171 169 } 172 - if ($arc_projects) { 173 - // This is sort of special-cased, but don't make arc do an extra round 174 - // trip. 175 - $projects = id(new PhabricatorRepositoryArcanistProject()) 176 - ->loadAllWhere( 177 - 'name in (%Ls)', 178 - $arc_projects); 179 - if (!$projects) { 180 - return array(); 181 - } 182 - 183 - $query->withArcanistProjectPHIDs(mpull($projects, 'getPHID')); 184 - } 185 170 186 171 $query->needRelationships(true); 187 172 $query->needCommitPHIDs(true); ··· 228 213 'ccs' => array_values($revision->getCCPHIDs()), 229 214 'hashes' => $revision->getHashes(), 230 215 'auxiliary' => idx($field_data, $phid, array()), 231 - 'arcanistProjectPHID' => $diff->getArcanistProjectPHID(), 232 216 'repositoryPHID' => $diff->getRepositoryPHID(), 233 217 ); 234 218
-1
src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php
··· 33 33 ->withIDs($ids) 34 34 ->withRevisionIDs($revision_ids) 35 35 ->needChangesets(true) 36 - ->needArcanistProjects(true) 37 36 ->execute(); 38 37 } 39 38
-1
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 33 33 $diffs = id(new DifferentialDiffQuery()) 34 34 ->setViewer($request->getUser()) 35 35 ->withRevisionIDs(array($this->revisionID)) 36 - ->needArcanistProjects(true) 37 36 ->execute(); 38 37 $diffs = array_reverse($diffs, $preserve_keys = true); 39 38
-42
src/applications/differential/customfield/DifferentialArcanistProjectField.php
··· 1 - <?php 2 - 3 - final class DifferentialArcanistProjectField 4 - extends DifferentialCustomField { 5 - 6 - public function getFieldKey() { 7 - return 'differential:arcanist-project'; 8 - } 9 - 10 - public function getFieldName() { 11 - return pht('Arcanist Project'); 12 - } 13 - 14 - public function getFieldDescription() { 15 - return pht('Shows arcanist project name.'); 16 - } 17 - 18 - public function shouldAppearInPropertyView() { 19 - return true; 20 - } 21 - 22 - public function renderPropertyViewLabel() { 23 - return $this->getFieldName(); 24 - } 25 - 26 - public function getRequiredHandlePHIDsForPropertyView() { 27 - $phid = $this->getArcanistProjectPHID(); 28 - if ($phid) { 29 - return array($phid); 30 - } 31 - return array(); 32 - } 33 - 34 - public function renderPropertyViewValue(array $handles) { 35 - return $this->renderHandleList($handles); 36 - } 37 - 38 - private function getArcanistProjectPHID() { 39 - return $this->getObject()->getActiveDiff()->getArcanistProjectPHID(); 40 - } 41 - 42 - }
+1 -2
src/applications/differential/editor/DifferentialDiffEditor.php
··· 234 234 ->setSourceControlPath(idx($dict, 'sourceControlPath')) 235 235 ->setSourceControlBaseRevision(idx($dict, 'sourceControlBaseRevision')) 236 236 ->setLintStatus(idx($dict, 'lintStatus')) 237 - ->setUnitStatus(idx($dict, 'unitStatus')) 238 - ->setArcanistProjectPHID(idx($dict, 'arcanistProjectPHID')); 237 + ->setUnitStatus(idx($dict, 'unitStatus')); 239 238 240 239 return $diff; 241 240 }
-1
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 220 220 } else { 221 221 $object->setRepositoryPHID($diff->getRepositoryPHID()); 222 222 } 223 - $object->setArcanistProjectPHID($diff->getArcanistProjectPHID()); 224 223 $object->attachActiveDiff($diff); 225 224 226 225 // TODO: Update the `diffPHID` once we add that.
-33
src/applications/differential/query/DifferentialDiffQuery.php
··· 7 7 private $phids; 8 8 private $revisionIDs; 9 9 private $needChangesets = false; 10 - private $needArcanistProjects = false; 11 10 12 11 public function withIDs(array $ids) { 13 12 $this->ids = $ids; ··· 26 25 27 26 public function needChangesets($bool) { 28 27 $this->needChangesets = $bool; 29 - return $this; 30 - } 31 - 32 - public function needArcanistProjects($bool) { 33 - $this->needArcanistProjects = $bool; 34 28 return $this; 35 29 } 36 30 ··· 79 73 $diffs = $this->loadChangesets($diffs); 80 74 } 81 75 82 - if ($diffs && $this->needArcanistProjects) { 83 - $diffs = $this->loadArcanistProjects($diffs); 84 - } 85 - 86 76 return $diffs; 87 77 } 88 78 ··· 94 84 ->needAttachToDiffs(true) 95 85 ->needHunks(true) 96 86 ->execute(); 97 - 98 - return $diffs; 99 - } 100 - 101 - private function loadArcanistProjects(array $diffs) { 102 - $phids = array_filter(mpull($diffs, 'getArcanistProjectPHID')); 103 - $projects = array(); 104 - $project_map = array(); 105 - if ($phids) { 106 - $projects = id(new PhabricatorRepositoryArcanistProject()) 107 - ->loadAllWhere( 108 - 'phid IN (%Ls)', 109 - $phids); 110 - $project_map = mpull($projects, null, 'getPHID'); 111 - } 112 - 113 - foreach ($diffs as $diff) { 114 - $project = null; 115 - if ($diff->getArcanistProjectPHID()) { 116 - $project = idx($project_map, $diff->getArcanistProjectPHID()); 117 - } 118 - $diff->attachArcanistProject($project); 119 - } 120 87 121 88 return $diffs; 122 89 }
-16
src/applications/differential/query/DifferentialRepositoryLookup.php
··· 22 22 $viewer = $this->viewer; 23 23 $diff = $this->diff; 24 24 25 - // Look for an explicit Arcanist project. 26 - if ($diff->getArcanistProjectPHID()) { 27 - $project = id(new PhabricatorRepositoryArcanistProject())->loadOneWhere( 28 - 'phid = %s', 29 - $diff->getArcanistProjectPHID()); 30 - if ($project && $project->getRepositoryID()) { 31 - $repositories = id(new PhabricatorRepositoryQuery()) 32 - ->setViewer($viewer) 33 - ->withIDs(array($project->getRepositoryID())) 34 - ->execute(); 35 - if ($repositories) { 36 - return head($repositories); 37 - } 38 - } 39 - } 40 - 41 25 // Look for a repository UUID. 42 26 if ($diff->getRepositoryUUID()) { 43 27 $repositories = id(new PhabricatorRepositoryQuery())
-21
src/applications/differential/query/DifferentialRevisionQuery.php
··· 36 36 private $phids = array(); 37 37 private $responsibles = array(); 38 38 private $branches = array(); 39 - private $arcanistProjectPHIDs = array(); 40 39 private $repositoryPHIDs; 41 40 private $updatedEpochMin; 42 41 private $updatedEpochMax; ··· 227 226 return $this; 228 227 } 229 228 230 - 231 - /** 232 - * Filter results to only return revisions with a given set of arcanist 233 - * projects. 234 - * 235 - * @param array List of project PHIDs. 236 - * @return this 237 - * @task config 238 - */ 239 - public function withArcanistProjectPHIDs(array $arc_project_phids) { 240 - $this->arcanistProjectPHIDs = $arc_project_phids; 241 - return $this; 242 - } 243 229 244 230 public function withRepositoryPHIDs(array $repository_phids) { 245 231 $this->repositoryPHIDs = $repository_phids; ··· 769 755 $conn_r, 770 756 'r.branchName in (%Ls)', 771 757 $this->branches); 772 - } 773 - 774 - if ($this->arcanistProjectPHIDs) { 775 - $where[] = qsprintf( 776 - $conn_r, 777 - 'r.arcanistProjectPHID in (%Ls)', 778 - $this->arcanistProjectPHIDs); 779 758 } 780 759 781 760 if ($this->updatedEpochMin !== null) {
-1
src/applications/differential/storage/DifferentialDiff.php
··· 262 262 'lintStatus' => $this->getLintStatus(), 263 263 'changes' => array(), 264 264 'properties' => array(), 265 - 'projectName' => $this->getArcanistProjectName(), 266 265 ); 267 266 268 267 $dict['changes'] = $this->buildChangesList();
-8
src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
··· 321 321 $this->repository->getCallsign(). 322 322 $this->commit->getCommitIdentifier()); 323 323 324 - // TODO: This is not correct in SVN where one repository can have multiple 325 - // Arcanist projects. 326 - $arcanist_project = id(new PhabricatorRepositoryArcanistProject()) 327 - ->loadOneWhere('repositoryID = %d LIMIT 1', $this->repository->getID()); 328 - if ($arcanist_project) { 329 - $diff->setArcanistProjectPHID($arcanist_project->getPHID()); 330 - } 331 - 332 324 $parents = DiffusionQuery::callConduitWithDiffusionRequest( 333 325 $viewer, 334 326 $drequest,