Differential D18176 Diff 43724 src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php
| Show All 17 Lines | $uri = id(new PhabricatorRepositoryURIQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withIDs(array($id)) | ->withIDs(array($id)) | ||||
| ->withRepositories(array($repository)) | ->withRepositories(array($repository)) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| if (!$uri) { | if (!$uri) { | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| } | } | ||||
| // For display, reload the URI by loading it through the repository. This | |||||
| // may adjust builtin URIs for repository configuration, so we may end up | |||||
| // with a different view of builtin URIs than we'd see if we loaded them | |||||
| // directly from the database. See T12884. | |||||
| $repository_with_uris = id(new PhabricatorRepositoryQuery()) | |||||
jmeador: @epriestley I believe this query is resulting in 10 second page loads for us. I haven't tested… | |||||
| ->setViewer($viewer) | |||||
| ->needURIs(true) | |||||
| ->execute(); | |||||
| $repository_uris = $repository->getURIs(); | |||||
| $repository_uris = mpull($repository_uris, null, 'getID'); | |||||
| $uri = idx($repository_uris, $uri->getID()); | |||||
| if (!$uri) { | |||||
| return new Aphront404Response(); | |||||
| } | |||||
| $title = array( | $title = array( | ||||
| pht('URI'), | pht('URI'), | ||||
| $repository->getDisplayName(), | $repository->getDisplayName(), | ||||
| ); | ); | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb( | $crumbs->addTextCrumb( | ||||
| $repository->getDisplayName(), | $repository->getDisplayName(), | ||||
| ▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines | |||||
@epriestley I believe this query is resulting in 10 second page loads for us. I haven't tested it, though so I can't be sure. It does look like it is loading every URI for every repository though. Is this intentional? would a constraint on this query break how this fix works?