diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -391,7 +391,7 @@ 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => 'e5822781', 'rsrc/js/application/files/behavior-icon-composer.js' => '8ef9ab58', 'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888', - 'rsrc/js/application/herald/HeraldRuleEditor.js' => '9229e764', + 'rsrc/js/application/herald/HeraldRuleEditor.js' => '271ffdd7', 'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec', 'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3', 'rsrc/js/application/maniphest/behavior-batch-editor.js' => 'f5d1233b', @@ -544,7 +544,7 @@ 'global-drag-and-drop-css' => '697324ad', 'harbormaster-css' => '49d64eb4', 'herald-css' => '826075fa', - 'herald-rule-editor' => '9229e764', + 'herald-rule-editor' => '271ffdd7', 'herald-test-css' => '778b008e', 'homepage-panel-css' => 'e34bf140', 'inline-comment-summary-css' => 'eb5f8e8c', @@ -989,6 +989,15 @@ 'javelin-request', 'javelin-workflow', ), + '271ffdd7' => array( + 'multirow-row-manager', + 'javelin-install', + 'javelin-util', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-json', + 'phabricator-prefab', + ), '2818f5ce' => array( 'javelin-install', 'javelin-util', @@ -1545,15 +1554,6 @@ 'javelin-dom', 'javelin-stratcom', ), - '9229e764' => array( - 'multirow-row-manager', - 'javelin-install', - 'javelin-util', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-json', - 'phabricator-prefab', - ), 93568464 => array( 'javelin-behavior', 'javelin-dom', diff --git a/resources/sql/autopatches/20150503.repositorysymbols.2.php b/resources/sql/autopatches/20150503.repositorysymbols.2.php --- a/resources/sql/autopatches/20150503.repositorysymbols.2.php +++ b/resources/sql/autopatches/20150503.repositorysymbols.2.php @@ -1,26 +1,29 @@ setViewer(PhabricatorUser::getOmnipotentUser()) - ->needRepositories(true) - ->execute(); - $table = new PhabricatorRepositorySymbol(); $conn_w = $table->establishConnection('w'); +$projects = queryfx_all( + $conn_w, + 'SELECT * FROM %T', + 'repository_arcanistproject'); + foreach ($projects as $project) { - $repo = $project->getRepository(); + $repo = id(new PhabricatorRepositoryQuery()) + ->setViewer(PhabricatorUser::getOmnipotentUser()) + ->withIDs(array($project['repository'])) + ->executeOne(); if (!$repo) { continue; } - echo pht("Migrating symbols for '%s' project...\n", $project->getName()); + echo pht("Migrating symbols for '%s' project...\n", $project['name']); queryfx( $conn_w, 'UPDATE %T SET repositoryPHID = %s WHERE arcanistProjectID = %d', $table->getTableName(), $repo->getPHID(), - $project->getID()); + $project['id']); } diff --git a/resources/sql/autopatches/20150504.symbolsproject.1.php b/resources/sql/autopatches/20150504.symbolsproject.1.php --- a/resources/sql/autopatches/20150504.symbolsproject.1.php +++ b/resources/sql/autopatches/20150504.symbolsproject.1.php @@ -1,24 +1,21 @@ setViewer(PhabricatorUser::getOmnipotentUser()) - ->needRepositories(true) - ->execute(); +$table_w = new PhabricatorRepository(); +$conn_w = $table_w->establishConnection('w'); + +$projects = queryfx_all( + $conn_w, + 'SELECT * FROM %T', + 'repository_arcanistproject'); $projects_to_repos_map = mpull($projects, 'getRepository', 'getPHID'); $projects_to_repos_map = array_filter($projects_to_repos_map); $projects_to_repos_map = mpull($projects_to_repos_map, 'getPHID'); -$table_r = new PhabricatorRepositoryArcanistProject(); -$conn_r = $table_r->establishConnection('r'); -$table_w = new PhabricatorRepository(); -$conn_w = $table_w->establishConnection('w'); - -$raw_data = queryfx_all($conn_r, 'SELECT * FROM %T', $table_r->getTableName()); -$raw_data = ipull($raw_data, null, 'id'); +$raw_data = ipull($projects, null, 'id'); foreach ($projects as $project) { - $repo = $project->getRepository(); + $repo = $project['repository']; if (!$repo) { continue; @@ -26,8 +23,8 @@ echo pht( "Migrating symbols configuration for '%s' project...\n", - $project->getName()); - $row = $raw_data[$project->getID()]; + $project['name']); + $row = $raw_data[$project['id']]; $symbol_index_projects = $row['symbolIndexProjects']; $symbol_index_projects = json_decode($symbol_index_projects); diff --git a/resources/sql/autopatches/20150506.arcanistprojects.sql b/resources/sql/autopatches/20150506.arcanistprojects.sql new file mode 100644 --- /dev/null +++ b/resources/sql/autopatches/20150506.arcanistprojects.sql @@ -0,0 +1,10 @@ +ALTER TABLE {$NAMESPACE}_differential.differential_diff + DROP COLUMN arcanistProjectPHID; + +ALTER TABLE {$NAMESPACE}_differential.differential_revision + DROP COLUMN arcanistProjectPHID; + +ALTER TABLE {$NAMESPACE}_releeph.releeph_project + DROP COLUMN arcanistProjectID; + +DROP TABLE {$NAMESPACE}_repository.repository_arcanistproject; diff --git a/resources/sql/patches/131.migraterevisionquery.php b/resources/sql/patches/131.migraterevisionquery.php --- a/resources/sql/patches/131.migraterevisionquery.php +++ b/resources/sql/patches/131.migraterevisionquery.php @@ -18,14 +18,18 @@ } $branch_name = $diff->getBranch(); - $arc_project_phid = $diff->getArcanistProjectPHID(); + $arc_project_phid = queryfx( + $conn_w, + 'SELECT arcanistProjectPHID FROM %T WHERE id = %d', + id(new DifferentialDiff())->getTableName(), + $diff->getID()); queryfx( $conn_w, 'UPDATE %T SET branchName = %s, arcanistProjectPHID = %s WHERE id = %d', $table->getTableName(), $branch_name, - $arc_project_phid, + $arc_project_phid['arcanistProjectPHID'], $revision->getID()); } } while (count($revisions) == 1000); diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -173,7 +173,6 @@ 'AphrontView' => 'view/AphrontView.php', 'AphrontWebpageResponse' => 'aphront/response/AphrontWebpageResponse.php', 'ArcanistConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistConduitAPIMethod.php', - 'ArcanistProjectInfoConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php', 'AuditConduitAPIMethod' => 'applications/audit/conduit/AuditConduitAPIMethod.php', 'AuditQueryConduitAPIMethod' => 'applications/audit/conduit/AuditQueryConduitAPIMethod.php', 'AuthManageProvidersCapability' => 'applications/auth/capability/AuthManageProvidersCapability.php', @@ -296,7 +295,6 @@ 'DifferentialAddCommentView' => 'applications/differential/view/DifferentialAddCommentView.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', @@ -461,7 +459,6 @@ 'DifferentialUpdateRevisionConduitAPIMethod' => 'applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php', 'DifferentialUpdateUnitResultsConduitAPIMethod' => 'applications/differential/conduit/DifferentialUpdateUnitResultsConduitAPIMethod.php', 'DifferentialViewPolicyField' => 'applications/differential/customfield/DifferentialViewPolicyField.php', - 'DiffusionArcanistProjectDatasource' => 'applications/diffusion/typeahead/DiffusionArcanistProjectDatasource.php', 'DiffusionAuditorDatasource' => 'applications/diffusion/typeahead/DiffusionAuditorDatasource.php', 'DiffusionBranchQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionBranchQueryConduitAPIMethod.php', 'DiffusionBranchTableController' => 'applications/diffusion/controller/DiffusionBranchTableController.php', @@ -2388,11 +2385,6 @@ 'PhabricatorRepositoriesApplication' => 'applications/repository/application/PhabricatorRepositoriesApplication.php', 'PhabricatorRepositoriesSetupCheck' => 'applications/config/check/PhabricatorRepositoriesSetupCheck.php', 'PhabricatorRepository' => 'applications/repository/storage/PhabricatorRepository.php', - 'PhabricatorRepositoryArcanistProject' => 'applications/repository/storage/PhabricatorRepositoryArcanistProject.php', - 'PhabricatorRepositoryArcanistProjectDeleteController' => 'applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php', - 'PhabricatorRepositoryArcanistProjectEditController' => 'applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php', - 'PhabricatorRepositoryArcanistProjectPHIDType' => 'applications/repository/phid/PhabricatorRepositoryArcanistProjectPHIDType.php', - 'PhabricatorRepositoryArcanistProjectQuery' => 'applications/repository/query/PhabricatorRepositoryArcanistProjectQuery.php', 'PhabricatorRepositoryAuditRequest' => 'applications/repository/storage/PhabricatorRepositoryAuditRequest.php', 'PhabricatorRepositoryBranch' => 'applications/repository/storage/PhabricatorRepositoryBranch.php', 'PhabricatorRepositoryCommit' => 'applications/repository/storage/PhabricatorRepositoryCommit.php', @@ -3146,7 +3138,6 @@ 'ReleephProductTransactionQuery' => 'applications/releeph/query/ReleephProductTransactionQuery.php', 'ReleephProductViewController' => 'applications/releeph/controller/product/ReleephProductViewController.php', 'ReleephProject' => 'applications/releeph/storage/ReleephProject.php', - 'ReleephProjectInfoConduitAPIMethod' => 'applications/releeph/conduit/ReleephProjectInfoConduitAPIMethod.php', 'ReleephQueryBranchesConduitAPIMethod' => 'applications/releeph/conduit/ReleephQueryBranchesConduitAPIMethod.php', 'ReleephQueryProductsConduitAPIMethod' => 'applications/releeph/conduit/ReleephQueryProductsConduitAPIMethod.php', 'ReleephQueryRequestsConduitAPIMethod' => 'applications/releeph/conduit/ReleephQueryRequestsConduitAPIMethod.php', @@ -3423,7 +3414,6 @@ ), 'AphrontWebpageResponse' => 'AphrontHTMLResponse', 'ArcanistConduitAPIMethod' => 'ConduitAPIMethod', - 'ArcanistProjectInfoConduitAPIMethod' => 'ArcanistConduitAPIMethod', 'AuditConduitAPIMethod' => 'ConduitAPIMethod', 'AuditQueryConduitAPIMethod' => 'AuditConduitAPIMethod', 'AuthManageProvidersCapability' => 'PhabricatorPolicyCapability', @@ -3535,7 +3525,6 @@ 'DifferentialAddCommentView' => 'AphrontView', 'DifferentialAffectedPath' => 'DifferentialDAO', 'DifferentialApplyPatchField' => 'DifferentialCustomField', - 'DifferentialArcanistProjectField' => 'DifferentialCustomField', 'DifferentialAsanaRepresentationField' => 'DifferentialCustomField', 'DifferentialAuditorsField' => 'DifferentialStoredCustomField', 'DifferentialAuthorField' => 'DifferentialCustomField', @@ -3708,7 +3697,6 @@ 'DifferentialUpdateRevisionConduitAPIMethod' => 'DifferentialConduitAPIMethod', 'DifferentialUpdateUnitResultsConduitAPIMethod' => 'DifferentialConduitAPIMethod', 'DifferentialViewPolicyField' => 'DifferentialCoreCustomField', - 'DiffusionArcanistProjectDatasource' => 'PhabricatorTypeaheadDatasource', 'DiffusionAuditorDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 'DiffusionBranchQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod', 'DiffusionBranchTableController' => 'DiffusionController', @@ -5828,15 +5816,6 @@ 'PhabricatorDestructibleInterface', 'PhabricatorProjectInterface', ), - 'PhabricatorRepositoryArcanistProject' => array( - 'PhabricatorRepositoryDAO', - 'PhabricatorPolicyInterface', - 'PhabricatorDestructibleInterface', - ), - 'PhabricatorRepositoryArcanistProjectDeleteController' => 'PhabricatorRepositoryController', - 'PhabricatorRepositoryArcanistProjectEditController' => 'PhabricatorRepositoryController', - 'PhabricatorRepositoryArcanistProjectPHIDType' => 'PhabricatorPHIDType', - 'PhabricatorRepositoryArcanistProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorRepositoryAuditRequest' => array( 'PhabricatorRepositoryDAO', 'PhabricatorPolicyInterface', @@ -6724,7 +6703,6 @@ 'PhabricatorApplicationTransactionInterface', 'PhabricatorPolicyInterface', ), - 'ReleephProjectInfoConduitAPIMethod' => 'ReleephConduitAPIMethod', 'ReleephQueryBranchesConduitAPIMethod' => 'ReleephConduitAPIMethod', 'ReleephQueryProductsConduitAPIMethod' => 'ReleephConduitAPIMethod', 'ReleephQueryRequestsConduitAPIMethod' => 'ReleephConduitAPIMethod', diff --git a/src/applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php b/src/applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php deleted file mode 100644 --- a/src/applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php +++ /dev/null @@ -1,70 +0,0 @@ - 'required string', - ); - } - - protected function defineReturnType() { - return 'nonempty dict'; - } - - protected function defineErrorTypes() { - return array( - 'ERR-BAD-ARCANIST-PROJECT' => 'No such project exists.', - ); - } - - protected function execute(ConduitAPIRequest $request) { - $name = $request->getValue('name'); - - $project = id(new PhabricatorRepositoryArcanistProject())->loadOneWhere( - 'name = %s', - $name); - - if (!$project) { - throw new ConduitException('ERR-BAD-ARCANIST-PROJECT'); - } - - $repository = null; - if ($project->getRepositoryID()) { - $repository = id(new PhabricatorRepositoryQuery()) - ->setViewer($request->getUser()) - ->withIDs(array($project->getRepositoryID())) - ->executeOne(); - } - - $repository_phid = null; - $tracked = false; - $encoding = null; - $dictionary = array(); - if ($repository) { - $repository_phid = $repository->getPHID(); - $tracked = $repository->isTracked(); - $encoding = $repository->getDetail('encoding'); - $dictionary = $repository->toDictionary(); - } - - return array( - 'name' => $project->getName(), - 'phid' => $project->getPHID(), - 'repositoryPHID' => $repository_phid, - 'tracked' => $tracked, - 'encoding' => $encoding, - 'repository' => $dictionary, - ); - } - -} diff --git a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php --- a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php @@ -40,7 +40,6 @@ 'sourceControlPath' => 'required string', 'sourceControlBaseRevision' => 'required string', 'creationMethod' => 'optional string', - 'arcanistProject' => 'optional string', 'lintStatus' => 'required '.$status_const, 'unitStatus' => 'required '.$status_const, 'repositoryPHID' => 'optional phid', @@ -84,21 +83,6 @@ } } - $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 @@ 'sourceControlPath' => $request->getValue('sourceControlPath'), 'sourceControlBaseRevision' => $request->getValue('sourceControlBaseRevision'), - 'arcanistProjectPHID' => $project_phid, 'lintStatus' => $lint_status, 'unitStatus' => $unit_status, ); diff --git a/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php --- a/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php @@ -67,7 +67,6 @@ ->setViewer($request->getUser()) ->withIDs(array($diff_id)) ->needChangesets(true) - ->needArcanistProjects(true) ->executeOne(); } diff --git a/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php --- a/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php @@ -56,7 +56,6 @@ ->setViewer($request->getUser()) ->withRevisionIDs(array($revision_id)) ->needChangesets(true) - ->needArcanistProjects(true) ->execute(); $diff_dicts = mpull($diffs, 'getDiffDict'); diff --git a/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php --- a/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php @@ -44,7 +44,6 @@ 'subscribers' => 'optional list', 'responsibleUsers' => 'optional list', 'branches' => 'optional list', - 'arcanistProjects' => 'optional list', ); } @@ -73,7 +72,6 @@ $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 @@ 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 @@ 'ccs' => array_values($revision->getCCPHIDs()), 'hashes' => $revision->getHashes(), 'auxiliary' => idx($field_data, $phid, array()), - 'arcanistProjectPHID' => $diff->getArcanistProjectPHID(), 'repositoryPHID' => $diff->getRepositoryPHID(), ); diff --git a/src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php --- a/src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php @@ -33,7 +33,6 @@ ->withIDs($ids) ->withRevisionIDs($revision_ids) ->needChangesets(true) - ->needArcanistProjects(true) ->execute(); } diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -33,7 +33,6 @@ $diffs = id(new DifferentialDiffQuery()) ->setViewer($request->getUser()) ->withRevisionIDs(array($this->revisionID)) - ->needArcanistProjects(true) ->execute(); $diffs = array_reverse($diffs, $preserve_keys = true); diff --git a/src/applications/differential/customfield/DifferentialArcanistProjectField.php b/src/applications/differential/customfield/DifferentialArcanistProjectField.php deleted file mode 100644 --- a/src/applications/differential/customfield/DifferentialArcanistProjectField.php +++ /dev/null @@ -1,42 +0,0 @@ -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(); - } - -} diff --git a/src/applications/differential/editor/DifferentialDiffEditor.php b/src/applications/differential/editor/DifferentialDiffEditor.php --- a/src/applications/differential/editor/DifferentialDiffEditor.php +++ b/src/applications/differential/editor/DifferentialDiffEditor.php @@ -234,8 +234,7 @@ ->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; } diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php --- a/src/applications/differential/editor/DifferentialTransactionEditor.php +++ b/src/applications/differential/editor/DifferentialTransactionEditor.php @@ -220,7 +220,6 @@ } else { $object->setRepositoryPHID($diff->getRepositoryPHID()); } - $object->setArcanistProjectPHID($diff->getArcanistProjectPHID()); $object->attachActiveDiff($diff); // TODO: Update the `diffPHID` once we add that. diff --git a/src/applications/differential/query/DifferentialDiffQuery.php b/src/applications/differential/query/DifferentialDiffQuery.php --- a/src/applications/differential/query/DifferentialDiffQuery.php +++ b/src/applications/differential/query/DifferentialDiffQuery.php @@ -7,7 +7,6 @@ private $phids; private $revisionIDs; private $needChangesets = false; - private $needArcanistProjects = false; public function withIDs(array $ids) { $this->ids = $ids; @@ -29,11 +28,6 @@ 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 @@ $diffs = $this->loadChangesets($diffs); } - if ($diffs && $this->needArcanistProjects) { - $diffs = $this->loadArcanistProjects($diffs); - } - return $diffs; } @@ -98,29 +88,6 @@ 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(); diff --git a/src/applications/differential/query/DifferentialRepositoryLookup.php b/src/applications/differential/query/DifferentialRepositoryLookup.php --- a/src/applications/differential/query/DifferentialRepositoryLookup.php +++ b/src/applications/differential/query/DifferentialRepositoryLookup.php @@ -22,22 +22,6 @@ $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()) diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php --- a/src/applications/differential/query/DifferentialRevisionQuery.php +++ b/src/applications/differential/query/DifferentialRevisionQuery.php @@ -36,7 +36,6 @@ private $phids = array(); private $responsibles = array(); private $branches = array(); - private $arcanistProjectPHIDs = array(); private $repositoryPHIDs; private $updatedEpochMin; private $updatedEpochMax; @@ -227,20 +226,6 @@ return $this; } - - /** - * 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 +756,6 @@ $this->branches); } - if ($this->arcanistProjectPHIDs) { - $where[] = qsprintf( - $conn_r, - 'r.arcanistProjectPHID in (%Ls)', - $this->arcanistProjectPHIDs); - } - if ($this->updatedEpochMin !== null) { $where[] = qsprintf( $conn_r, diff --git a/src/applications/differential/storage/DifferentialDiff.php b/src/applications/differential/storage/DifferentialDiff.php --- a/src/applications/differential/storage/DifferentialDiff.php +++ b/src/applications/differential/storage/DifferentialDiff.php @@ -27,7 +27,6 @@ protected $branch; protected $bookmark; - protected $arcanistProjectPHID; protected $creationMethod; protected $repositoryUUID; @@ -37,7 +36,6 @@ private $unsavedChangesets = array(); private $changesets = self::ATTACHABLE; - private $arcanistProject = self::ATTACHABLE; private $revision = self::ATTACHABLE; private $properties = array(); @@ -58,7 +56,6 @@ 'lineCount' => 'uint32', 'branch' => 'text255?', 'bookmark' => 'text255?', - 'arcanistProjectPHID' => 'phid?', 'repositoryUUID' => 'text64?', // T6203/NULLABILITY @@ -108,25 +105,6 @@ $this->getID()); } - public function attachArcanistProject( - PhabricatorRepositoryArcanistProject $project = null) { - $this->arcanistProject = $project; - return $this; - } - - public function getArcanistProject() { - return $this->assertAttached($this->arcanistProject); - } - - public function getArcanistProjectName() { - $name = ''; - if ($this->arcanistProject) { - $project = $this->getArcanistProject(); - $name = $project->getName(); - } - return $name; - } - public function save() { $this->openTransaction(); $ret = parent::save(); @@ -262,7 +240,6 @@ 'lintStatus' => $this->getLintStatus(), 'changes' => array(), 'properties' => array(), - 'projectName' => $this->getArcanistProjectName(), ); $dict['changes'] = $this->buildChangesList(); diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -29,7 +29,6 @@ protected $mailKey; protected $branchName; - protected $arcanistProjectPHID; protected $repositoryPHID; protected $viewPolicy = PhabricatorPolicies::POLICY_USER; protected $editPolicy = PhabricatorPolicies::POLICY_USER; @@ -85,7 +84,6 @@ 'lineCount' => 'uint32?', 'mailKey' => 'bytes40', 'branchName' => 'text255?', - 'arcanistProjectPHID' => 'phid?', 'repositoryPHID' => 'phid?', ), self::CONFIG_KEY_SCHEMA => array( diff --git a/src/applications/diffusion/DiffusionLintSaveRunner.php b/src/applications/diffusion/DiffusionLintSaveRunner.php --- a/src/applications/diffusion/DiffusionLintSaveRunner.php +++ b/src/applications/diffusion/DiffusionLintSaveRunner.php @@ -58,17 +58,11 @@ } } - $project_id = $working_copy->getProjectID(); - $project = id(new PhabricatorRepositoryArcanistProject()) - ->loadOneWhere('name = %s', $project_id); - if (!$project || !$project->getRepositoryID()) { - throw new Exception("Couldn't find repository for {$project_id}."); - } - + $repo_phid = $working_copy->getRepositoryPHID(); $branch_name = $api->getBranchName(); $this->branch = PhabricatorRepositoryBranch::loadOrCreateBranch( - $project->getRepositoryID(), + $repo_phid, $branch_name); $this->conn = $this->branch->establishConnection('w'); diff --git a/src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php --- a/src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php +++ b/src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php @@ -17,10 +17,10 @@ protected function defineParamTypes() { return array( - 'arcanistProject' => 'required string', - 'branch' => 'optional string', - 'commit' => 'optional string', - 'files' => 'required list', + 'repositoryPHID' => 'optional string', + 'branch' => 'optional string', + 'commit' => 'optional string', + 'files' => 'required list', ); } @@ -29,25 +29,20 @@ } protected function execute(ConduitAPIRequest $request) { - $project = id(new PhabricatorRepositoryArcanistProject())->loadOneWhere( - 'name = %s', - $request->getValue('arcanistProject')); - if (!$project || !$project->getRepositoryID()) { - return array(); - } - + $repo_phid = $request->getValue('repositoryPHID'); $branch_name = $request->getValue('branch'); + if ($branch_name == '') { $repository = id(new PhabricatorRepositoryQuery()) ->setViewer($request->getUser()) - ->withIDs(array($project->getRepositoryID())) + ->withIDs(array($repo_phid)) ->executeOne(); $branch_name = $repository->getDefaultArcanistBranch(); } $branch = id(new PhabricatorRepositoryBranch())->loadOneWhere( 'repositoryID = %d AND name = %s', - $project->getRepositoryID(), + $repo_phid, $branch_name); if (!$branch || !$branch->getLintCommit()) { return array(); diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php --- a/src/applications/diffusion/request/DiffusionRequest.php +++ b/src/applications/diffusion/request/DiffusionRequest.php @@ -22,7 +22,6 @@ protected $repository; protected $repositoryCommit; protected $repositoryCommitData; - protected $arcanistProjects; private $isClusterRequest = false; private $initFromConduit = true; @@ -401,16 +400,6 @@ return $this->repositoryCommit; } - public function loadArcanistProjects() { - if (empty($this->arcanistProjects)) { - $projects = id(new PhabricatorRepositoryArcanistProject())->loadAllWhere( - 'repositoryID = %d', - $this->getRepository()->getID()); - $this->arcanistProjects = $projects; - } - return $this->arcanistProjects; - } - public function loadCommitData() { if (empty($this->repositoryCommitData)) { $commit = $this->loadCommit(); diff --git a/src/applications/diffusion/typeahead/DiffusionArcanistProjectDatasource.php b/src/applications/diffusion/typeahead/DiffusionArcanistProjectDatasource.php deleted file mode 100644 --- a/src/applications/diffusion/typeahead/DiffusionArcanistProjectDatasource.php +++ /dev/null @@ -1,39 +0,0 @@ -getViewer(); - $raw_query = $this->getRawQuery(); - - $results = array(); - - $arcprojs = id(new PhabricatorRepositoryArcanistProject())->loadAll(); - foreach ($arcprojs as $proj) { - $results[] = id(new PhabricatorTypeaheadResult()) - ->setName($proj->getName()) - ->setPHID($proj->getPHID()); - } - - return $results; - } - -} diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php --- a/src/applications/herald/adapter/HeraldAdapter.php +++ b/src/applications/herald/adapter/HeraldAdapter.php @@ -42,7 +42,6 @@ const FIELD_APPLICATION_EMAIL = 'applicaton-email'; const FIELD_TASK_PRIORITY = 'taskpriority'; const FIELD_TASK_STATUS = 'taskstatus'; - const FIELD_ARCANIST_PROJECT = 'arcanist-project'; const FIELD_PUSHER_IS_COMMITTER = 'pusher-is-committer'; const FIELD_PATH = 'path'; @@ -100,7 +99,6 @@ const VALUE_BUILD_PLAN = 'buildplan'; const VALUE_TASK_PRIORITY = 'taskpriority'; const VALUE_TASK_STATUS = 'taskstatus'; - const VALUE_ARCANIST_PROJECT = 'arcanistprojects'; const VALUE_LEGAL_DOCUMENTS = 'legaldocuments'; const VALUE_APPLICATION_EMAIL = 'applicationemail'; @@ -381,7 +379,6 @@ self::FIELD_APPLICATION_EMAIL => pht('Receiving email address'), self::FIELD_TASK_PRIORITY => pht('Task priority'), self::FIELD_TASK_STATUS => pht('Task status'), - self::FIELD_ARCANIST_PROJECT => pht('Arcanist Project'), self::FIELD_PUSHER_IS_COMMITTER => pht('Pusher same as committer'), self::FIELD_PATH => pht('Path'), ) + $this->getCustomFieldNameMap(); @@ -437,7 +434,6 @@ case self::FIELD_PUSHER: case self::FIELD_TASK_PRIORITY: case self::FIELD_TASK_STATUS: - case self::FIELD_ARCANIST_PROJECT: return array( self::CONDITION_IS_ANY, self::CONDITION_IS_NOT_ANY, @@ -940,8 +936,6 @@ return self::VALUE_TASK_PRIORITY; case self::FIELD_TASK_STATUS: return self::VALUE_TASK_STATUS; - case self::FIELD_ARCANIST_PROJECT: - return self::VALUE_ARCANIST_PROJECT; default: return self::VALUE_USER; } diff --git a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php --- a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php +++ b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php @@ -80,7 +80,6 @@ self::FIELD_AFFECTED_PACKAGE, self::FIELD_AFFECTED_PACKAGE_OWNER, self::FIELD_IS_NEW_OBJECT, - self::FIELD_ARCANIST_PROJECT, ), parent::getFields()); } @@ -259,8 +258,6 @@ $packages = $this->loadAffectedPackages(); return PhabricatorOwnersOwner::loadAffiliatedUserPHIDs( mpull($packages, 'getID')); - case self::FIELD_ARCANIST_PROJECT: - return $this->revision->getArcanistProjectPHID(); } return parent::getHeraldField($field); diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -603,7 +603,6 @@ 'taskpriority' => new ManiphestTaskPriorityDatasource(), 'taskstatus' => new ManiphestTaskStatusDatasource(), 'buildplan' => new HarbormasterBuildPlanDatasource(), - 'arcanistprojects' => new DiffusionArcanistProjectDatasource(), 'package' => new PhabricatorOwnersPackageDatasource(), 'project' => new PhabricatorProjectDatasource(), 'user' => new PhabricatorPeopleDatasource(), diff --git a/src/applications/releeph/conduit/ReleephProjectInfoConduitAPIMethod.php b/src/applications/releeph/conduit/ReleephProjectInfoConduitAPIMethod.php deleted file mode 100644 --- a/src/applications/releeph/conduit/ReleephProjectInfoConduitAPIMethod.php +++ /dev/null @@ -1,98 +0,0 @@ - 'optional string', - ); - } - - protected function defineReturnType() { - return 'dict'; - } - - protected function defineErrorTypes() { - return array( - 'ERR_UNKNOWN_ARC' => - "The given Arcanist project name doesn't exist in the ". - "installation of Phabricator you are accessing.", - ); - } - - protected function execute(ConduitAPIRequest $request) { - $arc_project_name = $request->getValue('arcProjectName'); - if ($arc_project_name) { - $arc_project = id(new PhabricatorRepositoryArcanistProject()) - ->loadOneWhere('name = %s', $arc_project_name); - if (!$arc_project) { - throw id(new ConduitException('ERR_UNKNOWN_ARC')) - ->setErrorDescription( - "Unknown Arcanist project '{$arc_project_name}': ". - "are you using the correct Conduit URI?"); - } - - $releeph_projects = id(new ReleephProject()) - ->loadAllWhere('arcanistProjectID = %d', $arc_project->getID()); - } else { - $releeph_projects = id(new ReleephProject())->loadAll(); - } - - $releeph_projects = mfilter($releeph_projects, 'getIsActive'); - - $result = array(); - foreach ($releeph_projects as $releeph_project) { - $selector = $releeph_project->getReleephFieldSelector(); - $fields = $selector->getFieldSpecifications(); - - $fields_info = array(); - foreach ($fields as $field) { - $field->setReleephProject($releeph_project); - if ($field->isEditable()) { - $key = $field->getKeyForConduit(); - $fields_info[$key] = array( - 'class' => get_class($field), - 'name' => $field->getName(), - 'key' => $key, - 'arcHelp' => $field->renderHelpForArcanist(), - ); - } - } - - $releeph_branches = mfilter( - id(new ReleephBranch()) - ->loadAllWhere('releephProjectID = %d', $releeph_project->getID()), - 'getIsActive'); - - $releeph_branches_struct = array(); - foreach ($releeph_branches as $branch) { - $releeph_branches_struct[] = array( - 'branchName' => $branch->getName(), - 'projectName' => $releeph_project->getName(), - 'projectPHID' => $releeph_project->getPHID(), - 'branchPHID' => $branch->getPHID(), - ); - } - - $result[] = array( - 'projectName' => $releeph_project->getName(), - 'projectPHID' => $releeph_project->getPHID(), - 'branches' => $releeph_branches_struct, - 'fields' => $fields_info, - ); - } - - return $result; - } - -} diff --git a/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php b/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php --- a/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php +++ b/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php @@ -13,10 +13,9 @@ $template = ReleephBranchTemplate::getDefaultTemplate(); } - $arc_project_id = $request->getInt('arcProjectID'); $fake_commit_handle = ReleephBranchTemplate::getFakeCommitHandleFor( - $arc_project_id, + null, $request->getUser()); list($name, $errors) = id(new ReleephBranchTemplate()) diff --git a/src/applications/releeph/controller/product/ReleephProductCreateController.php b/src/applications/releeph/controller/product/ReleephProductCreateController.php --- a/src/applications/releeph/controller/product/ReleephProductCreateController.php +++ b/src/applications/releeph/controller/product/ReleephProductCreateController.php @@ -6,9 +6,6 @@ $request = $this->getRequest(); $name = trim($request->getStr('name')); $trunk_branch = trim($request->getStr('trunkBranch')); - $arc_pr_id = $request->getInt('arcPrID'); - - $arc_projects = $this->loadArcProjects(); $e_name = true; $e_trunk_branch = true; @@ -27,22 +24,13 @@ 'You must specify which branch you will be picking from.'); } - $arc_project = $arc_projects[$arc_pr_id]; $pr_repository = null; - if ($arc_project->getRepositoryID()) { - $pr_repository = id(new PhabricatorRepositoryQuery()) - ->setViewer($request->getUser()) - ->withIDs(array($arc_project->getRepositoryID())) - ->executeOne(); - } - if (!$errors) { $releeph_product = id(new ReleephProject()) ->setName($name) ->setTrunkBranch($trunk_branch) ->setRepositoryPHID($pr_repository->getPHID()) - ->setArcanistProjectID($arc_project->getID()) ->setCreatedByUserPHID($request->getUser()->getPHID()) ->setIsActive(1); @@ -58,8 +46,6 @@ } } - $arc_project_options = $this->getArcProjectSelectOptions($arc_projects); - $product_name_input = id(new AphrontFormTextControl()) ->setLabel(pht('Name')) ->setDisableAutocomplete(true) @@ -68,32 +54,15 @@ ->setError($e_name) ->setCaption(pht('A name like "Thrift" but not "Thrift releases".')); - $arc_project_input = id(new AphrontFormSelectControl()) - ->setLabel(pht('Arc Project')) - ->setName('arcPrID') - ->setValue($arc_pr_id) - ->setCaption(pht( - 'If your Arc project isn\'t listed, associate it with a repository %s', - phutil_tag( - 'a', - array( - 'href' => '/repository/', - 'target' => '_blank', - ), - 'here'))) - ->setOptions($arc_project_options); - $branch_name_preview = id(new ReleephBranchPreviewView()) ->setLabel(pht('Example Branch')) ->addControl('projectName', $product_name_input) - ->addControl('arcProjectID', $arc_project_input) ->addStatic('template', '') ->addStatic('isSymbolic', false); $form = id(new AphrontFormView()) ->setUser($request->getUser()) ->appendChild($product_name_input) - ->appendChild($arc_project_input) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Trunk')) @@ -126,44 +95,4 @@ )); } - private function loadArcProjects() { - $viewer = $this->getRequest()->getUser(); - - $projects = id(new PhabricatorRepositoryArcanistProjectQuery()) - ->setViewer($viewer) - ->needRepositories(true) - ->execute(); - - $projects = mfilter($projects, 'getRepository'); - $projects = msort($projects, 'getName'); - - return $projects; - } - - private function getArcProjectSelectOptions(array $arc_projects) { - assert_instances_of($arc_projects, 'PhabricatorRepositoryArcanistProject'); - - $repos = mpull($arc_projects, 'getRepository'); - $repos = mpull($repos, null, 'getID'); - - $groups = array(); - foreach ($arc_projects as $arc_project) { - $id = $arc_project->getID(); - $repo_id = $arc_project->getRepository()->getID(); - $groups[$repo_id][$id] = $arc_project->getName(); - } - - $choices = array(); - foreach ($groups as $repo_id => $group) { - $repo_name = $repos[$repo_id]->getName(); - $callsign = $repos[$repo_id]->getCallsign(); - $name = "r{$callsign} ({$repo_name})"; - $choices[$name] = $group; - } - - ksort($choices); - - return $choices; - } - } diff --git a/src/applications/releeph/controller/product/ReleephProductEditController.php b/src/applications/releeph/controller/product/ReleephProductEditController.php --- a/src/applications/releeph/controller/product/ReleephProductEditController.php +++ b/src/applications/releeph/controller/product/ReleephProductEditController.php @@ -15,7 +15,6 @@ $product = id(new ReleephProductQuery()) ->setViewer($viewer) ->withIDs(array($this->productID)) - ->needArcanistProjects(true) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, @@ -48,8 +47,6 @@ $test_paths = $product->getDetail('testPaths', array()); } - $arc_project_id = $product->getArcanistProjectID(); - if ($request->isFormPost()) { $pusher_phids = $request->getArr('pushers'); @@ -93,7 +90,7 @@ ->setDetail('testPaths', $test_paths); $fake_commit_handle = - ReleephBranchTemplate::getFakeCommitHandleFor($arc_project_id, $viewer); + ReleephBranchTemplate::getFakeCommitHandleFor(null, $viewer); if ($branch_template) { list($branch_name, $template_errors) = id(new ReleephBranchTemplate()) @@ -135,16 +132,6 @@ ->setValue( $product->getRepository()->getName())) ->appendChild( - id(new AphrontFormStaticControl()) - ->setLabel(pht('Arc Project')) - ->setValue( - $product->getArcanistProject()->getName())) - ->appendChild( - id(new AphrontFormStaticControl()) - ->setLabel(pht('Releeph Project PHID')) - ->setValue( - $product->getPHID())) - ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Trunk')) ->setValue($trunk_branch) @@ -179,7 +166,6 @@ $branch_template_preview = id(new ReleephBranchPreviewView()) ->setLabel(pht('Preview')) ->addControl('template', $branch_template_input) - ->addStatic('arcProjectID', $arc_project_id) ->addStatic('isSymbolic', false) ->addStatic('projectName', $product->getName()); diff --git a/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php b/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php --- a/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php +++ b/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php @@ -25,29 +25,15 @@ } $this->revision = $diff_rev; - $arc_project = id(new PhabricatorRepositoryArcanistProject()) - ->loadOneWhere('phid = %s', $this->revision->getArcanistProjectPHID()); - - $projects = id(new ReleephProject())->loadAllWhere( - 'arcanistProjectID = %d AND isActive = 1', - $arc_project->getID()); - if (!$projects) { - throw new Exception(sprintf( - "D%d belongs to the '%s' Arcanist project, ". - "which is not part of any Releeph project!", - $this->revision->getID(), - $arc_project->getName())); - } - $branches = id(new ReleephBranch())->loadAllWhere( 'releephProjectID IN (%Ld) AND isActive = 1', - mpull($projects, 'getID')); + array()); if (!$branches) { throw new Exception(sprintf( 'D%d could be in the Releeph project(s) %s, '. 'but this project / none of these projects have open branches.', $this->revision->getID(), - implode(', ', mpull($projects, 'getName')))); + implode(', ', array()))); } if (count($branches) === 1) { diff --git a/src/applications/releeph/query/ReleephProductQuery.php b/src/applications/releeph/query/ReleephProductQuery.php --- a/src/applications/releeph/query/ReleephProductQuery.php +++ b/src/applications/releeph/query/ReleephProductQuery.php @@ -8,8 +8,6 @@ private $phids; private $repositoryPHIDs; - private $needArcanistProjects; - const ORDER_ID = 'order-id'; const ORDER_NAME = 'order-name'; @@ -47,11 +45,6 @@ return $this; } - public function needArcanistProjects($need) { - $this->needArcanistProjects = $need; - return $this; - } - protected function loadPage() { $table = new ReleephProject(); $conn_r = $table->establishConnection('r'); @@ -91,23 +84,6 @@ } protected function didFilterPage(array $products) { - if ($this->needArcanistProjects) { - $project_ids = array_filter(mpull($products, 'getArcanistProjectID')); - if ($project_ids) { - $projects = id(new PhabricatorRepositoryArcanistProject()) - ->loadAllWhere('id IN (%Ld)', $project_ids); - $projects = mpull($projects, null, 'getID'); - } else { - $projects = array(); - } - - foreach ($products as $product) { - $project_id = $product->getArcanistProjectID(); - $project = idx($projects, $project_id); - $product->attachArcanistProject($project); - } - } - return $products; } diff --git a/src/applications/releeph/query/ReleephProductSearchEngine.php b/src/applications/releeph/query/ReleephProductSearchEngine.php --- a/src/applications/releeph/query/ReleephProductSearchEngine.php +++ b/src/applications/releeph/query/ReleephProductSearchEngine.php @@ -21,8 +21,7 @@ public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { $query = id(new ReleephProductQuery()) - ->setOrder(ReleephProductQuery::ORDER_NAME) - ->needArcanistProjects(true); + ->setOrder(ReleephProductQuery::ORDER_NAME); $active = $saved->getParameter('active'); $value = idx($this->getActiveValues(), $active); @@ -119,11 +118,6 @@ ), 'r'.$repo->getCallsign())); - $arc = $product->getArcanistProject(); - if ($arc) { - $item->addAttribute($arc->getName()); - } - $list->addItem($item); } diff --git a/src/applications/releeph/storage/ReleephProject.php b/src/applications/releeph/storage/ReleephProject.php --- a/src/applications/releeph/storage/ReleephProject.php +++ b/src/applications/releeph/storage/ReleephProject.php @@ -18,12 +18,10 @@ protected $repositoryPHID; protected $isActive; protected $createdByUserPHID; - protected $arcanistProjectID; protected $details = array(); private $repository = self::ATTACHABLE; - private $arcanistProject = self::ATTACHABLE; protected function getConfiguration() { return array( @@ -67,16 +65,6 @@ return $this; } - public function getArcanistProject() { - return $this->assertAttached($this->arcanistProject); - } - - public function attachArcanistProject( - PhabricatorRepositoryArcanistProject $arcanist_project = null) { - $this->arcanistProject = $arcanist_project; - return $this; - } - public function getPushers() { return $this->getDetail('pushers', array()); } diff --git a/src/applications/releeph/view/branch/ReleephBranchTemplate.php b/src/applications/releeph/view/branch/ReleephBranchTemplate.php --- a/src/applications/releeph/view/branch/ReleephBranchTemplate.php +++ b/src/applications/releeph/view/branch/ReleephBranchTemplate.php @@ -19,32 +19,6 @@ return $template; } - public static function getFakeCommitHandleFor( - $arc_project_id, - PhabricatorUser $viewer) { - - $arc_project = id(new PhabricatorRepositoryArcanistProject()) - ->load($arc_project_id); - if (!$arc_project) { - throw new Exception( - "No Arc project found with id '{$arc_project_id}'!"); - } - - $repository = null; - if ($arc_project->getRepositoryID()) { - $repository = id(new PhabricatorRepositoryQuery()) - ->setViewer($viewer) - ->withIDs(array($arc_project->getRepositoryID())) - ->executeOne(); - } - $fake_handle = 'SOFAKE'; - if ($repository) { - $fake_handle = id(new PhabricatorObjectHandle()) - ->setName($repository->formatCommitName('100000000000')); - } - return $fake_handle; - } - private $commitHandle; private $branchDate = null; private $projectName; diff --git a/src/applications/repository/application/PhabricatorRepositoriesApplication.php b/src/applications/repository/application/PhabricatorRepositoriesApplication.php --- a/src/applications/repository/application/PhabricatorRepositoriesApplication.php +++ b/src/applications/repository/application/PhabricatorRepositoriesApplication.php @@ -30,10 +30,6 @@ return array( '/repository/' => array( '' => 'PhabricatorRepositoryListController', - 'project/edit/(?P[1-9]\d*)/' - => 'PhabricatorRepositoryArcanistProjectEditController', - 'project/delete/(?P[1-9]\d*)/' - => 'PhabricatorRepositoryArcanistProjectDeleteController', ), ); } diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php deleted file mode 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php +++ /dev/null @@ -1,41 +0,0 @@ -id = $data['id']; - } - - public function processRequest() { - - $arc_project = - id(new PhabricatorRepositoryArcanistProject())->load($this->id); - if (!$arc_project) { - return new Aphront404Response(); - } - - $request = $this->getRequest(); - - if ($request->isDialogFormPost()) { - $arc_project->delete(); - return id(new AphrontRedirectResponse())->setURI('/repository/'); - } - - $dialog = new AphrontDialogView(); - $dialog - ->setUser($request->getUser()) - ->setTitle(pht('Really delete this arcanist project?')) - ->appendChild(pht( - 'Really delete the "%s" arcanist project? '. - 'This operation can not be undone.', - $arc_project->getName())) - ->setSubmitURI('/repository/project/delete/'.$this->id.'/') - ->addSubmitButton(pht('Delete Arcanist Project')) - ->addCancelButton('/repository/'); - - return id(new AphrontDialogResponse())->setDialog($dialog); - } -} diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php deleted file mode 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php +++ /dev/null @@ -1,92 +0,0 @@ -id = $data['id']; - } - - public function processRequest() { - - $request = $this->getRequest(); - $user = $request->getUser(); - - $project = id(new PhabricatorRepositoryArcanistProject())->load($this->id); - if (!$project) { - return new Aphront404Response(); - } - - $repositories = id(new PhabricatorRepositoryQuery()) - ->setViewer($user) - ->execute(); - $repos = array( - 0 => 'None', - ); - foreach ($repositories as $repository) { - $callsign = $repository->getCallsign(); - $name = $repository->getname(); - $repos[$repository->getID()] = "r{$callsign} ({$name})"; - } - // note "None" will still be first thanks to 'r' prefix - asort($repos); - - if ($request->isFormPost()) { - - $indexed = $request->getStrList('symbolIndexLanguages'); - $indexed = array_map('strtolower', $indexed); - $project->setSymbolIndexLanguages($indexed); - - $project->setSymbolIndexProjects($request->getArr('symbolIndexProjects')); - - $repo_id = $request->getInt('repository', 0); - if (isset($repos[$repo_id])) { - $project->setRepositoryID($repo_id); - $project->save(); - - return id(new AphrontRedirectResponse()) - ->setURI('/repository/'); - } - } - - $form = id(new AphrontFormView()) - ->setUser($user) - ->appendChild( - id(new AphrontFormStaticControl()) - ->setLabel(pht('Name')) - ->setValue($project->getName())) - ->appendChild( - id(new AphrontFormStaticControl()) - ->setLabel('PHID') - ->setValue($project->getPHID())) - ->appendChild( - id(new AphrontFormSelectControl()) - ->setLabel(pht('Repository')) - ->setOptions($repos) - ->setName('repository') - ->setValue($project->getRepositoryID())) - ->appendChild( - id(new AphrontFormSubmitControl()) - ->addCancelButton('/repository/') - ->setValue('Save')); - - $panel = new PHUIObjectBoxView(); - $panel->setHeaderText(pht('Edit Arcanist Project')); - $panel->setForm($form); - - $crumbs = $this->buildApplicationCrumbs(); - $crumbs->addTextCrumb(pht('Edit Project')); - - return $this->buildApplicationPage( - array( - $crumbs, - $panel, - ), - array( - 'title' => pht('Edit Project'), - )); - } - -} diff --git a/src/applications/repository/controller/PhabricatorRepositoryListController.php b/src/applications/repository/controller/PhabricatorRepositoryListController.php --- a/src/applications/repository/controller/PhabricatorRepositoryListController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryListController.php @@ -85,68 +85,6 @@ $panel->setHeader($header); $panel->appendChild($table); - $projects = id(new PhabricatorRepositoryArcanistProject())->loadAll(); - - $rows = array(); - foreach ($projects as $project) { - $repo = idx($repos, $project->getRepositoryID()); - if ($repo) { - $repo_name = $repo->getName(); - } else { - $repo_name = '-'; - } - - $rows[] = array( - $project->getName(), - $repo_name, - phutil_tag( - 'a', - array( - 'href' => '/repository/project/edit/'.$project->getID().'/', - 'class' => 'button grey small', - ), - pht('Edit')), - javelin_tag( - 'a', - array( - 'href' => '/repository/project/delete/'.$project->getID().'/', - 'class' => 'button grey small', - 'sigil' => 'workflow', - ), - pht('Delete')), - ); - - } - - $project_table = new AphrontTableView($rows); - $project_table->setNoDataString(pht('No Arcanist Projects')); - $project_table->setHeaders( - array( - pht('Project ID'), - pht('Repository'), - '', - '', - )); - $project_table->setColumnClasses( - array( - '', - 'wide', - 'action', - 'action', - )); - - $project_table->setColumnVisibility( - array( - true, - true, - $is_admin, - $is_admin, - )); - - $project_panel = new PHUIObjectBoxView(); - $project_panel->setHeaderText(pht('Arcanist Projects')); - $project_panel->appendChild($project_table); - $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('Repository List')); @@ -154,7 +92,6 @@ array( $crumbs, $panel, - $project_panel, ), array( 'title' => pht('Repository List'), diff --git a/src/applications/repository/phid/PhabricatorRepositoryArcanistProjectPHIDType.php b/src/applications/repository/phid/PhabricatorRepositoryArcanistProjectPHIDType.php deleted file mode 100644 --- a/src/applications/repository/phid/PhabricatorRepositoryArcanistProjectPHIDType.php +++ /dev/null @@ -1,35 +0,0 @@ -withPHIDs($phids); - } - - public function loadHandles( - PhabricatorHandleQuery $query, - array $handles, - array $objects) { - - foreach ($handles as $phid => $handle) { - $project = $objects[$phid]; - $handle->setName($project->getName()); - } - } - -} diff --git a/src/applications/repository/query/PhabricatorRepositoryArcanistProjectQuery.php b/src/applications/repository/query/PhabricatorRepositoryArcanistProjectQuery.php deleted file mode 100644 --- a/src/applications/repository/query/PhabricatorRepositoryArcanistProjectQuery.php +++ /dev/null @@ -1,87 +0,0 @@ -ids = $ids; - return $this; - } - - public function withPHIDs(array $phids) { - $this->phids = $phids; - return $this; - } - - public function needRepositories($need_repositories) { - $this->needRepositories = $need_repositories; - return $this; - } - - protected function loadPage() { - $table = new PhabricatorRepositoryArcanistProject(); - $conn_r = $table->establishConnection('r'); - - $data = queryfx_all( - $conn_r, - 'SELECT * FROM %T %Q %Q %Q', - $table->getTableName(), - $this->buildWhereClause($conn_r), - $this->buildOrderClause($conn_r), - $this->buildLimitClause($conn_r)); - - return $table->loadAllFromArray($data); - } - - protected function willFilterPage(array $projects) { - assert_instances_of($projects, 'PhabricatorRepositoryArcanistProject'); - - if ($this->needRepositories) { - $repository_ids = mpull($projects, 'getRepositoryID'); - $repositories = id(new PhabricatorRepositoryQuery()) - ->setViewer($this->getViewer()) - ->withIDs($repository_ids) - ->execute(); - foreach ($projects as $project) { - $repo = idx($repositories, $project->getRepositoryID()); - $project->attachRepository($repo); - } - } - - return $projects; - } - - protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { - $where = array(); - - if ($this->ids) { - $where[] = qsprintf( - $conn_r, - 'id IN (%Ld)', - $this->ids); - } - - if ($this->phids) { - $where[] = qsprintf( - $conn_r, - 'phid IN (%Ls)', - $this->phids); - } - - $where[] = $this->buildPagingClause($conn_r); - - return $this->formatWhereClause($where); - } - - - public function getQueryApplicationClass() { - // TODO: Diffusion? Differential? - return null; - } - -} diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -1160,12 +1160,6 @@ $path->delete(); } - $projects = id(new PhabricatorRepositoryArcanistProject()) - ->loadAllWhere('repositoryID = %d', $this->getID()); - foreach ($projects as $project) { - $project->delete(); - } - queryfx( $this->establishConnection('w'), 'DELETE FROM %T WHERE repositoryPHID = %s', diff --git a/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php b/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php deleted file mode 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php +++ /dev/null @@ -1,89 +0,0 @@ - true, - self::CONFIG_TIMESTAMPS => false, - self::CONFIG_COLUMN_SCHEMA => array( - 'name' => 'text128', - 'repositoryID' => 'id?', - ), - self::CONFIG_KEY_SCHEMA => array( - 'key_phid' => null, - 'phid' => array( - 'columns' => array('phid'), - 'unique' => true, - ), - 'name' => array( - 'columns' => array('name'), - 'unique' => true, - ), - ), - ) + parent::getConfiguration(); - } - - public function generatePHID() { - return PhabricatorPHID::generateNewPHID( - PhabricatorRepositoryArcanistProjectPHIDType::TYPECONST); - } - - public function getRepository() { - return $this->assertAttached($this->repository); - } - - public function attachRepository(PhabricatorRepository $repository = null) { - $this->repository = $repository; - return $this; - } - - - -/* -( PhabricatorPolicyInterface )----------------------------------------- */ - - public function getCapabilities() { - return array( - PhabricatorPolicyCapability::CAN_VIEW, - PhabricatorPolicyCapability::CAN_EDIT, - ); - } - - public function getPolicy($capability) { - switch ($capability) { - case PhabricatorPolicyCapability::CAN_VIEW: - return PhabricatorPolicies::POLICY_USER; - case PhabricatorPolicyCapability::CAN_EDIT: - return PhabricatorPolicies::POLICY_ADMIN; - } - } - - public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { - return false; - } - - public function describeAutomaticCapability($capability) { - return null; - } - - -/* -( PhabricatorDestructibleInterface )----------------------------------- */ - - public function destroyObjectPermanently( - PhabricatorDestructionEngine $engine) { - - $this->openTransaction(); - $this->delete(); - $this->saveTransaction(); - } - -} diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php --- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php +++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php @@ -321,14 +321,6 @@ $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, diff --git a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js --- a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js +++ b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js @@ -220,7 +220,6 @@ case 'buildplan': case 'taskpriority': case 'taskstatus': - case 'arcanistprojects': case 'legaldocuments': case 'applicationemail': var tokenizer = this._newTokenizer(type);