@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove remaining arcanist project code

Summary: Fixes T7604. This is the big scary change which drops the "arcanist project" fields from the database permanently.

Test Plan:
`grep`ped for the following to ensure that I had found all remaining references:

- `/arcanistProject/i`
- `/arcanist_project/i`
- `/projectName/i`
- `/project_name/i`
- `/project_id/i`

WARNING: Wait at least one month before landing this.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7604

Differential Revision: https://secure.phabricator.com/D12899

+10 -310
+10
resources/sql/autopatches/20150708.arcanistproject.sql
··· 1 + ALTER TABLE {$NAMESPACE}_differential.differential_diff 2 + DROP COLUMN arcanistProjectPHID; 3 + 4 + ALTER TABLE {$NAMESPACE}_differential.differential_revision 5 + DROP COLUMN arcanistProjectPHID; 6 + 7 + ALTER TABLE {$NAMESPACE}_releeph.releeph_project 8 + DROP COLUMN arcanistProjectID; 9 + 10 + DROP TABLE {$NAMESPACE}_repository.repository_arcanistproject;
-12
src/__phutil_library_map__.php
··· 173 173 'AphrontView' => 'view/AphrontView.php', 174 174 'AphrontWebpageResponse' => 'aphront/response/AphrontWebpageResponse.php', 175 175 'ArcanistConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistConduitAPIMethod.php', 176 - 'ArcanistProjectInfoConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php', 177 176 'AuditConduitAPIMethod' => 'applications/audit/conduit/AuditConduitAPIMethod.php', 178 177 'AuditQueryConduitAPIMethod' => 'applications/audit/conduit/AuditQueryConduitAPIMethod.php', 179 178 'AuthManageProvidersCapability' => 'applications/auth/capability/AuthManageProvidersCapability.php', ··· 2492 2491 'PhabricatorRemarkupUIExample' => 'applications/uiexample/examples/PhabricatorRemarkupUIExample.php', 2493 2492 'PhabricatorRepositoriesSetupCheck' => 'applications/config/check/PhabricatorRepositoriesSetupCheck.php', 2494 2493 'PhabricatorRepository' => 'applications/repository/storage/PhabricatorRepository.php', 2495 - 'PhabricatorRepositoryArcanistProject' => 'applications/repository/storage/PhabricatorRepositoryArcanistProject.php', 2496 - 'PhabricatorRepositoryArcanistProjectPHIDType' => 'applications/repository/phid/PhabricatorRepositoryArcanistProjectPHIDType.php', 2497 - 'PhabricatorRepositoryArcanistProjectQuery' => 'applications/repository/query/PhabricatorRepositoryArcanistProjectQuery.php', 2498 2494 'PhabricatorRepositoryAuditRequest' => 'applications/repository/storage/PhabricatorRepositoryAuditRequest.php', 2499 2495 'PhabricatorRepositoryBranch' => 'applications/repository/storage/PhabricatorRepositoryBranch.php', 2500 2496 'PhabricatorRepositoryCommit' => 'applications/repository/storage/PhabricatorRepositoryCommit.php', ··· 3598 3594 ), 3599 3595 'AphrontWebpageResponse' => 'AphrontHTMLResponse', 3600 3596 'ArcanistConduitAPIMethod' => 'ConduitAPIMethod', 3601 - 'ArcanistProjectInfoConduitAPIMethod' => 'ArcanistConduitAPIMethod', 3602 3597 'AuditConduitAPIMethod' => 'ConduitAPIMethod', 3603 3598 'AuditQueryConduitAPIMethod' => 'AuditConduitAPIMethod', 3604 3599 'AuthManageProvidersCapability' => 'PhabricatorPolicyCapability', ··· 6290 6285 'PhabricatorProjectInterface', 6291 6286 'PhabricatorSpacesInterface', 6292 6287 ), 6293 - 'PhabricatorRepositoryArcanistProject' => array( 6294 - 'PhabricatorRepositoryDAO', 6295 - 'PhabricatorPolicyInterface', 6296 - 'PhabricatorDestructibleInterface', 6297 - ), 6298 - 'PhabricatorRepositoryArcanistProjectPHIDType' => 'PhabricatorPHIDType', 6299 - 'PhabricatorRepositoryArcanistProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 6300 6288 'PhabricatorRepositoryAuditRequest' => array( 6301 6289 'PhabricatorRepositoryDAO', 6302 6290 'PhabricatorPolicyInterface',
-74
src/applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php
··· 1 - <?php 2 - 3 - final class ArcanistProjectInfoConduitAPIMethod 4 - extends ArcanistConduitAPIMethod { 5 - 6 - public function getAPIMethodName() { 7 - return 'arcanist.projectinfo'; 8 - } 9 - 10 - public function getMethodStatus() { 11 - return self::METHOD_STATUS_DEPRECATED; 12 - } 13 - 14 - public function getMethodDescription() { 15 - return pht('Arcanist projects are deprecated.'); 16 - } 17 - 18 - protected function defineParamTypes() { 19 - return array( 20 - 'name' => 'required string', 21 - ); 22 - } 23 - 24 - protected function defineReturnType() { 25 - return 'nonempty dict'; 26 - } 27 - 28 - protected function defineErrorTypes() { 29 - return array( 30 - 'ERR-BAD-ARCANIST-PROJECT' => pht('No such project exists.'), 31 - ); 32 - } 33 - 34 - protected function execute(ConduitAPIRequest $request) { 35 - $name = $request->getValue('name'); 36 - 37 - $project = id(new PhabricatorRepositoryArcanistProject())->loadOneWhere( 38 - 'name = %s', 39 - $name); 40 - 41 - if (!$project) { 42 - throw new ConduitException('ERR-BAD-ARCANIST-PROJECT'); 43 - } 44 - 45 - $repository = null; 46 - if ($project->getRepositoryID()) { 47 - $repository = id(new PhabricatorRepositoryQuery()) 48 - ->setViewer($request->getUser()) 49 - ->withIDs(array($project->getRepositoryID())) 50 - ->executeOne(); 51 - } 52 - 53 - $repository_phid = null; 54 - $tracked = false; 55 - $encoding = null; 56 - $dictionary = array(); 57 - if ($repository) { 58 - $repository_phid = $repository->getPHID(); 59 - $tracked = $repository->isTracked(); 60 - $encoding = $repository->getDetail('encoding'); 61 - $dictionary = $repository->toDictionary(); 62 - } 63 - 64 - return array( 65 - 'name' => $project->getName(), 66 - 'phid' => $project->getPHID(), 67 - 'repositoryPHID' => $repository_phid, 68 - 'tracked' => $tracked, 69 - 'encoding' => $encoding, 70 - 'repository' => $dictionary, 71 - ); 72 - } 73 - 74 - }
-1
src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
··· 39 39 'sourceControlPath' => 'required string', 40 40 'sourceControlBaseRevision' => 'required string', 41 41 'creationMethod' => 'optional string', 42 - 'arcanistProject' => 'deprecated', 43 42 'lintStatus' => 'required '.$status_const, 44 43 'unitStatus' => 'required '.$status_const, 45 44 'repositoryPHID' => 'optional phid',
-2
src/applications/differential/storage/DifferentialDiff.php
··· 27 27 protected $branch; 28 28 protected $bookmark; 29 29 30 - protected $arcanistProjectPHID; 31 30 protected $creationMethod; 32 31 protected $repositoryUUID; 33 32 ··· 58 57 'lineCount' => 'uint32', 59 58 'branch' => 'text255?', 60 59 'bookmark' => 'text255?', 61 - 'arcanistProjectPHID' => 'phid?', 62 60 'repositoryUUID' => 'text64?', 63 61 64 62 // T6203/NULLABILITY
-2
src/applications/differential/storage/DifferentialRevision.php
··· 30 30 31 31 protected $mailKey; 32 32 protected $branchName; 33 - protected $arcanistProjectPHID; 34 33 protected $repositoryPHID; 35 34 protected $viewPolicy = PhabricatorPolicies::POLICY_USER; 36 35 protected $editPolicy = PhabricatorPolicies::POLICY_USER; ··· 87 86 'lineCount' => 'uint32?', 88 87 'mailKey' => 'bytes40', 89 88 'branchName' => 'text255?', 90 - 'arcanistProjectPHID' => 'phid?', 91 89 'repositoryPHID' => 'phid?', 92 90 ), 93 91 self::CONFIG_KEY_SCHEMA => array(
-2
src/applications/releeph/storage/ReleephProject.php
··· 18 18 protected $repositoryPHID; 19 19 protected $isActive; 20 20 protected $createdByUserPHID; 21 - protected $arcanistProjectID; 22 21 23 22 protected $details = array(); 24 23 ··· 34 33 'name' => 'text128', 35 34 'trunkBranch' => 'text255', 36 35 'isActive' => 'bool', 37 - 'arcanistProjectID' => 'id?', 38 36 ), 39 37 self::CONFIG_KEY_SCHEMA => array( 40 38 'projectName' => array(
-35
src/applications/repository/phid/PhabricatorRepositoryArcanistProjectPHIDType.php
··· 1 - <?php 2 - 3 - final class PhabricatorRepositoryArcanistProjectPHIDType 4 - extends PhabricatorPHIDType { 5 - 6 - const TYPECONST = 'APRJ'; 7 - 8 - public function getTypeName() { 9 - return pht('Arcanist Project'); 10 - } 11 - 12 - public function newObject() { 13 - return new PhabricatorRepositoryArcanistProject(); 14 - } 15 - 16 - protected function buildQueryForObjects( 17 - PhabricatorObjectQuery $query, 18 - array $phids) { 19 - 20 - return id(new PhabricatorRepositoryArcanistProjectQuery()) 21 - ->withPHIDs($phids); 22 - } 23 - 24 - public function loadHandles( 25 - PhabricatorHandleQuery $query, 26 - array $handles, 27 - array $objects) { 28 - 29 - foreach ($handles as $phid => $handle) { 30 - $project = $objects[$phid]; 31 - $handle->setName($project->getName()); 32 - } 33 - } 34 - 35 - }
-87
src/applications/repository/query/PhabricatorRepositoryArcanistProjectQuery.php
··· 1 - <?php 2 - 3 - final class PhabricatorRepositoryArcanistProjectQuery 4 - extends PhabricatorCursorPagedPolicyAwareQuery { 5 - 6 - private $ids; 7 - private $phids; 8 - 9 - private $needRepositories; 10 - 11 - public function withIDs(array $ids) { 12 - $this->ids = $ids; 13 - return $this; 14 - } 15 - 16 - public function withPHIDs(array $phids) { 17 - $this->phids = $phids; 18 - return $this; 19 - } 20 - 21 - public function needRepositories($need_repositories) { 22 - $this->needRepositories = $need_repositories; 23 - return $this; 24 - } 25 - 26 - protected function loadPage() { 27 - $table = new PhabricatorRepositoryArcanistProject(); 28 - $conn_r = $table->establishConnection('r'); 29 - 30 - $data = queryfx_all( 31 - $conn_r, 32 - 'SELECT * FROM %T %Q %Q %Q', 33 - $table->getTableName(), 34 - $this->buildWhereClause($conn_r), 35 - $this->buildOrderClause($conn_r), 36 - $this->buildLimitClause($conn_r)); 37 - 38 - return $table->loadAllFromArray($data); 39 - } 40 - 41 - protected function willFilterPage(array $projects) { 42 - assert_instances_of($projects, 'PhabricatorRepositoryArcanistProject'); 43 - 44 - if ($this->needRepositories) { 45 - $repository_ids = mpull($projects, 'getRepositoryID'); 46 - $repositories = id(new PhabricatorRepositoryQuery()) 47 - ->setViewer($this->getViewer()) 48 - ->withIDs($repository_ids) 49 - ->execute(); 50 - foreach ($projects as $project) { 51 - $repo = idx($repositories, $project->getRepositoryID()); 52 - $project->attachRepository($repo); 53 - } 54 - } 55 - 56 - return $projects; 57 - } 58 - 59 - protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { 60 - $where = array(); 61 - 62 - if ($this->ids) { 63 - $where[] = qsprintf( 64 - $conn_r, 65 - 'id IN (%Ld)', 66 - $this->ids); 67 - } 68 - 69 - if ($this->phids) { 70 - $where[] = qsprintf( 71 - $conn_r, 72 - 'phid IN (%Ls)', 73 - $this->phids); 74 - } 75 - 76 - $where[] = $this->buildPagingClause($conn_r); 77 - 78 - return $this->formatWhereClause($where); 79 - } 80 - 81 - 82 - public function getQueryApplicationClass() { 83 - // TODO: Diffusion? Differential? 84 - return null; 85 - } 86 - 87 - }
-6
src/applications/repository/storage/PhabricatorRepository.php
··· 1169 1169 $path->delete(); 1170 1170 } 1171 1171 1172 - $projects = id(new PhabricatorRepositoryArcanistProject()) 1173 - ->loadAllWhere('repositoryID = %d', $this->getID()); 1174 - foreach ($projects as $project) { 1175 - $project->delete(); 1176 - } 1177 - 1178 1172 queryfx( 1179 1173 $this->establishConnection('w'), 1180 1174 'DELETE FROM %T WHERE repositoryPHID = %s',
-89
src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
··· 1 - <?php 2 - 3 - final class PhabricatorRepositoryArcanistProject 4 - extends PhabricatorRepositoryDAO 5 - implements 6 - PhabricatorPolicyInterface, 7 - PhabricatorDestructibleInterface { 8 - 9 - protected $name; 10 - protected $repositoryID; 11 - 12 - private $repository = self::ATTACHABLE; 13 - 14 - protected function getConfiguration() { 15 - return array( 16 - self::CONFIG_AUX_PHID => true, 17 - self::CONFIG_TIMESTAMPS => false, 18 - self::CONFIG_COLUMN_SCHEMA => array( 19 - 'name' => 'text128', 20 - 'repositoryID' => 'id?', 21 - ), 22 - self::CONFIG_KEY_SCHEMA => array( 23 - 'key_phid' => null, 24 - 'phid' => array( 25 - 'columns' => array('phid'), 26 - 'unique' => true, 27 - ), 28 - 'name' => array( 29 - 'columns' => array('name'), 30 - 'unique' => true, 31 - ), 32 - ), 33 - ) + parent::getConfiguration(); 34 - } 35 - 36 - public function generatePHID() { 37 - return PhabricatorPHID::generateNewPHID( 38 - PhabricatorRepositoryArcanistProjectPHIDType::TYPECONST); 39 - } 40 - 41 - public function getRepository() { 42 - return $this->assertAttached($this->repository); 43 - } 44 - 45 - public function attachRepository(PhabricatorRepository $repository = null) { 46 - $this->repository = $repository; 47 - return $this; 48 - } 49 - 50 - 51 - 52 - /* -( PhabricatorPolicyInterface )----------------------------------------- */ 53 - 54 - public function getCapabilities() { 55 - return array( 56 - PhabricatorPolicyCapability::CAN_VIEW, 57 - PhabricatorPolicyCapability::CAN_EDIT, 58 - ); 59 - } 60 - 61 - public function getPolicy($capability) { 62 - switch ($capability) { 63 - case PhabricatorPolicyCapability::CAN_VIEW: 64 - return PhabricatorPolicies::POLICY_USER; 65 - case PhabricatorPolicyCapability::CAN_EDIT: 66 - return PhabricatorPolicies::POLICY_ADMIN; 67 - } 68 - } 69 - 70 - public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { 71 - return false; 72 - } 73 - 74 - public function describeAutomaticCapability($capability) { 75 - return null; 76 - } 77 - 78 - 79 - /* -( PhabricatorDestructibleInterface )----------------------------------- */ 80 - 81 - public function destroyObjectPermanently( 82 - PhabricatorDestructionEngine $engine) { 83 - 84 - $this->openTransaction(); 85 - $this->delete(); 86 - $this->saveTransaction(); 87 - } 88 - 89 - }