mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 23:01:04 +01:00
Merge "Audit" more completely into "Diffusion"
Summary: Fixes T6630. Long ago, "Audit", "Diffusion" and "Repositories" were three totally separate applications. This separation isn't useful and the three rapidly became intertwined. Ideally, they would all be one application. This doesn't take us quite that far, but Audit no longer has any controllers and has little actual behavior. The "Audit" screen has always just been a SearchEngine view of commits with some filters on it, and this formalizes that and puts a link to it in Diffusion. (This view has other uses, too.) Test Plan: - Accessed audit from home page. - Accessed audit/commits from Diffusion. - Could no longer uninstall Audit on its own. - Grepped for `/audit/` and `AuditApplication`. Reviewers: chad Reviewed By: chad Maniphest Tasks: T6630 Differential Revision: https://secure.phabricator.com/D17186
This commit is contained in:
parent
c05cb1ba6d
commit
11861265fe
15 changed files with 65 additions and 53 deletions
|
@ -642,6 +642,7 @@ phutil_register_library_map(array(
|
||||||
'DiffusionCommitHintQuery' => 'applications/diffusion/query/DiffusionCommitHintQuery.php',
|
'DiffusionCommitHintQuery' => 'applications/diffusion/query/DiffusionCommitHintQuery.php',
|
||||||
'DiffusionCommitHookEngine' => 'applications/diffusion/engine/DiffusionCommitHookEngine.php',
|
'DiffusionCommitHookEngine' => 'applications/diffusion/engine/DiffusionCommitHookEngine.php',
|
||||||
'DiffusionCommitHookRejectException' => 'applications/diffusion/exception/DiffusionCommitHookRejectException.php',
|
'DiffusionCommitHookRejectException' => 'applications/diffusion/exception/DiffusionCommitHookRejectException.php',
|
||||||
|
'DiffusionCommitListController' => 'applications/diffusion/controller/DiffusionCommitListController.php',
|
||||||
'DiffusionCommitMergeHeraldField' => 'applications/diffusion/herald/DiffusionCommitMergeHeraldField.php',
|
'DiffusionCommitMergeHeraldField' => 'applications/diffusion/herald/DiffusionCommitMergeHeraldField.php',
|
||||||
'DiffusionCommitMessageHeraldField' => 'applications/diffusion/herald/DiffusionCommitMessageHeraldField.php',
|
'DiffusionCommitMessageHeraldField' => 'applications/diffusion/herald/DiffusionCommitMessageHeraldField.php',
|
||||||
'DiffusionCommitPackageAuditHeraldField' => 'applications/diffusion/herald/DiffusionCommitPackageAuditHeraldField.php',
|
'DiffusionCommitPackageAuditHeraldField' => 'applications/diffusion/herald/DiffusionCommitPackageAuditHeraldField.php',
|
||||||
|
@ -1873,7 +1874,6 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorAuditController' => 'applications/audit/controller/PhabricatorAuditController.php',
|
'PhabricatorAuditController' => 'applications/audit/controller/PhabricatorAuditController.php',
|
||||||
'PhabricatorAuditEditor' => 'applications/audit/editor/PhabricatorAuditEditor.php',
|
'PhabricatorAuditEditor' => 'applications/audit/editor/PhabricatorAuditEditor.php',
|
||||||
'PhabricatorAuditInlineComment' => 'applications/audit/storage/PhabricatorAuditInlineComment.php',
|
'PhabricatorAuditInlineComment' => 'applications/audit/storage/PhabricatorAuditInlineComment.php',
|
||||||
'PhabricatorAuditListController' => 'applications/audit/controller/PhabricatorAuditListController.php',
|
|
||||||
'PhabricatorAuditListView' => 'applications/audit/view/PhabricatorAuditListView.php',
|
'PhabricatorAuditListView' => 'applications/audit/view/PhabricatorAuditListView.php',
|
||||||
'PhabricatorAuditMailReceiver' => 'applications/audit/mail/PhabricatorAuditMailReceiver.php',
|
'PhabricatorAuditMailReceiver' => 'applications/audit/mail/PhabricatorAuditMailReceiver.php',
|
||||||
'PhabricatorAuditManagementDeleteWorkflow' => 'applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php',
|
'PhabricatorAuditManagementDeleteWorkflow' => 'applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php',
|
||||||
|
@ -5346,6 +5346,7 @@ phutil_register_library_map(array(
|
||||||
'DiffusionCommitHintQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
'DiffusionCommitHintQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||||
'DiffusionCommitHookEngine' => 'Phobject',
|
'DiffusionCommitHookEngine' => 'Phobject',
|
||||||
'DiffusionCommitHookRejectException' => 'Exception',
|
'DiffusionCommitHookRejectException' => 'Exception',
|
||||||
|
'DiffusionCommitListController' => 'DiffusionController',
|
||||||
'DiffusionCommitMergeHeraldField' => 'DiffusionCommitHeraldField',
|
'DiffusionCommitMergeHeraldField' => 'DiffusionCommitHeraldField',
|
||||||
'DiffusionCommitMessageHeraldField' => 'DiffusionCommitHeraldField',
|
'DiffusionCommitMessageHeraldField' => 'DiffusionCommitHeraldField',
|
||||||
'DiffusionCommitPackageAuditHeraldField' => 'DiffusionCommitHeraldField',
|
'DiffusionCommitPackageAuditHeraldField' => 'DiffusionCommitHeraldField',
|
||||||
|
@ -6764,7 +6765,6 @@ phutil_register_library_map(array(
|
||||||
'Phobject',
|
'Phobject',
|
||||||
'PhabricatorInlineCommentInterface',
|
'PhabricatorInlineCommentInterface',
|
||||||
),
|
),
|
||||||
'PhabricatorAuditListController' => 'PhabricatorAuditController',
|
|
||||||
'PhabricatorAuditListView' => 'AphrontView',
|
'PhabricatorAuditListView' => 'AphrontView',
|
||||||
'PhabricatorAuditMailReceiver' => 'PhabricatorObjectMailReceiver',
|
'PhabricatorAuditMailReceiver' => 'PhabricatorObjectMailReceiver',
|
||||||
'PhabricatorAuditManagementDeleteWorkflow' => 'PhabricatorAuditManagementWorkflow',
|
'PhabricatorAuditManagementDeleteWorkflow' => 'PhabricatorAuditManagementWorkflow',
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
final class PhabricatorAuditApplication extends PhabricatorApplication {
|
final class PhabricatorAuditApplication extends PhabricatorApplication {
|
||||||
|
|
||||||
public function getBaseURI() {
|
public function getBaseURI() {
|
||||||
return '/audit/';
|
return '/diffusion/commit/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIcon() {
|
public function getIcon() {
|
||||||
|
@ -18,25 +18,16 @@ final class PhabricatorAuditApplication extends PhabricatorApplication {
|
||||||
return pht('Browse and Audit Commits');
|
return pht('Browse and Audit Commits');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function canUninstall() {
|
||||||
|
// Audit was once a separate application, but has largely merged with
|
||||||
|
// Diffusion.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function isPinnedByDefault(PhabricatorUser $viewer) {
|
public function isPinnedByDefault(PhabricatorUser $viewer) {
|
||||||
return true;
|
return parent::isClassInstalledForViewer(
|
||||||
}
|
'PhabricatorDiffusionApplication',
|
||||||
|
$viewer);
|
||||||
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
|
|
||||||
return array(
|
|
||||||
array(
|
|
||||||
'name' => pht('Audit User Guide'),
|
|
||||||
'href' => PhabricatorEnv::getDoclink('Audit User Guide'),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getRoutes() {
|
|
||||||
return array(
|
|
||||||
'/audit/' => array(
|
|
||||||
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorAuditListController',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getApplicationOrder() {
|
public function getApplicationOrder() {
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
abstract class AuditConduitAPIMethod extends ConduitAPIMethod {
|
abstract class AuditConduitAPIMethod extends ConduitAPIMethod {
|
||||||
|
|
||||||
final public function getApplication() {
|
final public function getApplication() {
|
||||||
return PhabricatorApplication::getByClass('PhabricatorAuditApplication');
|
return PhabricatorApplication::getByClass(
|
||||||
|
'PhabricatorDiffusionApplication');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class PhabricatorAuditListController
|
|
||||||
extends PhabricatorAuditController {
|
|
||||||
|
|
||||||
public function shouldAllowPublic() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
|
||||||
$controller = id(new PhabricatorApplicationSearchController())
|
|
||||||
->setQueryKey($request->getURIData('queryKey'))
|
|
||||||
->setSearchEngine(new PhabricatorCommitSearchEngine())
|
|
||||||
->setNavigation($this->buildSideNavView());
|
|
||||||
|
|
||||||
return $this->delegateToController($controller);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -42,7 +42,7 @@ final class PhabricatorAuditEditor
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEditorApplicationClass() {
|
public function getEditorApplicationClass() {
|
||||||
return 'PhabricatorAuditApplication';
|
return 'PhabricatorDiffusionApplication';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEditorObjectsDescription() {
|
public function getEditorObjectsDescription() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ final class PhabricatorAuditMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
|
|
||||||
public function isEnabled() {
|
public function isEnabled() {
|
||||||
return PhabricatorApplication::isClassInstalled(
|
return PhabricatorApplication::isClassInstalled(
|
||||||
'PhabricatorAuditApplication');
|
'PhabricatorDiffusionApplication');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectPattern() {
|
protected function getObjectPattern() {
|
||||||
|
|
|
@ -73,7 +73,7 @@ final class PhabricatorCommitSearchEngine
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getURI($path) {
|
protected function getURI($path) {
|
||||||
return '/audit/'.$path;
|
return '/diffusion/commit/'.$path;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getBuiltinQueryNames() {
|
protected function getBuiltinQueryNames() {
|
||||||
|
|
|
@ -28,6 +28,10 @@ final class PhabricatorDiffusionApplication extends PhabricatorApplication {
|
||||||
'name' => pht('Diffusion User Guide'),
|
'name' => pht('Diffusion User Guide'),
|
||||||
'href' => PhabricatorEnv::getDoclink('Diffusion User Guide'),
|
'href' => PhabricatorEnv::getDoclink('Diffusion User Guide'),
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'name' => pht('Audit User Guide'),
|
||||||
|
'href' => PhabricatorEnv::getDoclink('Audit User Guide'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +135,8 @@ final class PhabricatorDiffusionApplication extends PhabricatorApplication {
|
||||||
'lint/' => 'DiffusionLintController',
|
'lint/' => 'DiffusionLintController',
|
||||||
|
|
||||||
'commit/' => array(
|
'commit/' => array(
|
||||||
|
$this->getQueryRoutePattern() =>
|
||||||
|
'DiffusionCommitListController',
|
||||||
$this->getEditRoutePattern('edit/') =>
|
$this->getEditRoutePattern('edit/') =>
|
||||||
'DiffusionCommitEditController',
|
'DiffusionCommitEditController',
|
||||||
),
|
),
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class DiffusionCommitListController
|
||||||
|
extends DiffusionController {
|
||||||
|
|
||||||
|
public function shouldAllowPublic() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handleRequest(AphrontRequest $request) {
|
||||||
|
return id(new PhabricatorCommitSearchEngine())
|
||||||
|
->setController($this)
|
||||||
|
->buildResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function buildApplicationCrumbs() {
|
||||||
|
$crumbs = parent::buildApplicationCrumbs();
|
||||||
|
|
||||||
|
$crumbs->addTextCrumb(
|
||||||
|
pht('Commits'),
|
||||||
|
$this->getApplicationURI('commit/'));
|
||||||
|
|
||||||
|
return $crumbs;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -7,8 +7,19 @@ final class DiffusionRepositoryListController extends DiffusionController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
|
$items = array();
|
||||||
|
|
||||||
|
$items[] = id(new PHUIListItemView())
|
||||||
|
->setType(PHUIListItemView::TYPE_LABEL)
|
||||||
|
->setName(pht('Commits'));
|
||||||
|
|
||||||
|
$items[] = id(new PHUIListItemView())
|
||||||
|
->setName('Browse Commits')
|
||||||
|
->setHref($this->getApplicationURI('commit/'));
|
||||||
|
|
||||||
return id(new PhabricatorRepositorySearchEngine())
|
return id(new PhabricatorRepositorySearchEngine())
|
||||||
->setController($this)
|
->setController($this)
|
||||||
|
->setNavigationItems($items)
|
||||||
->buildResponse();
|
->buildResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ final class PhabricatorOwnersDetailController
|
||||||
|
|
||||||
$commit_views = array();
|
$commit_views = array();
|
||||||
|
|
||||||
$commit_uri = id(new PhutilURI('/audit/'))
|
$commit_uri = id(new PhutilURI('/diffusion/commit/'))
|
||||||
->setQueryParams(
|
->setQueryParams(
|
||||||
array(
|
array(
|
||||||
'auditorPHIDs' => $package->getPHID(),
|
'auditorPHIDs' => $package->getPHID(),
|
||||||
|
|
|
@ -63,7 +63,7 @@ final class PhabricatorPeopleProfileMenuEngine
|
||||||
$viewer);
|
$viewer);
|
||||||
if ($have_diffusion) {
|
if ($have_diffusion) {
|
||||||
$uri = urisprintf(
|
$uri = urisprintf(
|
||||||
'/audit/?authors=%s#R',
|
'/diffusion/commit/?authors=%s#R',
|
||||||
$object->getPHID());
|
$object->getPHID());
|
||||||
|
|
||||||
$items[] = $this->newItem()
|
$items[] = $this->newItem()
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class PhabricatorJumpNavHandler extends Phobject {
|
||||||
$jump = trim($jump);
|
$jump = trim($jump);
|
||||||
|
|
||||||
$patterns = array(
|
$patterns = array(
|
||||||
'/^a$/i' => 'uri:/audit/',
|
'/^a$/i' => 'uri:/diffusion/commit/',
|
||||||
'/^f$/i' => 'uri:/feed/',
|
'/^f$/i' => 'uri:/feed/',
|
||||||
'/^d$/i' => 'uri:/differential/',
|
'/^d$/i' => 'uri:/differential/',
|
||||||
'/^r$/i' => 'uri:/diffusion/',
|
'/^r$/i' => 'uri:/diffusion/',
|
||||||
|
|
|
@ -37,10 +37,6 @@
|
||||||
"name": "Arcanist Integration",
|
"name": "Arcanist Integration",
|
||||||
"include": "(^src/applications/arcanist/)"
|
"include": "(^src/applications/arcanist/)"
|
||||||
},
|
},
|
||||||
"audit": {
|
|
||||||
"name": "Audit",
|
|
||||||
"include": "(^src/applications/audit/)"
|
|
||||||
},
|
|
||||||
"auth": {
|
"auth": {
|
||||||
"name": "Auth",
|
"name": "Auth",
|
||||||
"include": "(^src/applications/auth/)"
|
"include": "(^src/applications/auth/)"
|
||||||
|
|
|
@ -23,8 +23,8 @@ track of two things:
|
||||||
- **Audit Requests** which ask a user (or some other entity) to audit a
|
- **Audit Requests** which ask a user (or some other entity) to audit a
|
||||||
commit. These can be triggered in a number of ways (see below).
|
commit. These can be triggered in a number of ways (see below).
|
||||||
|
|
||||||
In the Audit tool's home screen (at `/audit/`) and on the homepage you can see
|
In the Audit tool's home screen and on the homepage you can see commits and
|
||||||
commits and requests that require your action:
|
requests that require your action:
|
||||||
|
|
||||||
- **Required Audits** are open audit requests that require you, a project
|
- **Required Audits** are open audit requests that require you, a project
|
||||||
you are a member of, or a package you own to audit a commit. An audit
|
you are a member of, or a package you own to audit a commit. An audit
|
||||||
|
|
Loading…
Reference in a new issue