1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Skip some repository checks in cluster enviornments

Summary:
Ref T2783. Currently, the repository edit page does some checks agaisnt the local system to look for binaries and files on disk. These checks don't make sense in a cluster environment.

Ideally, we could make a Conduit call to the host (e.g., add something like `diffusion.querysetupstatus`) to do these checks, but since they're pretty basic config things and cluster installs are advanced, it doesn't seem super worthwhile for now.

Test Plan: Saw fewer checks in a cluster repo.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T2783

Differential Revision: https://secure.phabricator.com/D11102
This commit is contained in:
epriestley 2014-12-31 11:50:35 -08:00
parent 376729b44c
commit 8c4f3edd8a
2 changed files with 66 additions and 47 deletions

View file

@ -683,6 +683,7 @@ final class DiffusionRepositoryEditMainController
PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser();
$is_cluster = $repository->getAlmanacServicePHID();
$view = new PHUIStatusListView();
@ -756,6 +757,12 @@ final class DiffusionRepositoryEditMainController
}
$binaries = array_unique($binaries);
if (!$is_cluster) {
// We're only checking for binaries if we aren't running with a cluster
// configuration. In theory, we could check for binaries on the
// repository host machine, but we'd need to make this more complicated
// to do that.
foreach ($binaries as $binary) {
$where = Filesystem::resolveBinary($binary);
if (!$where) {
@ -807,6 +814,7 @@ final class DiffusionRepositoryEditMainController
}
}
}
}
$doc_href = PhabricatorEnv::getDocLink('Managing Daemons with phd');
@ -829,6 +837,12 @@ final class DiffusionRepositoryEditMainController
->execute();
if ($pull_daemon) {
// TODO: In a cluster environment, we need a daemon on this repository's
// host, specifically, and we aren't checking for that right now. This
// is a reasonable proxy for things being more-or-less correctly set up,
// though.
$view->addItem(
id(new PHUIStatusItemView())
->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green')
@ -861,7 +875,12 @@ final class DiffusionRepositoryEditMainController
->setNote($daemon_instructions));
}
if ($repository->usesLocalWorkingCopy()) {
if ($is_cluster) {
// Just omit this status check for now in cluster environments. We
// could make a service call and pull it from the repository host
// eventually.
} else if ($repository->usesLocalWorkingCopy()) {
$local_parent = dirname($repository->getLocalPath());
if (Filesystem::pathExists($local_parent)) {
$view->addItem(

View file

@ -55,7 +55,7 @@ final class PhabricatorWorkerArchiveTaskQuery
if ($this->ids !== null) {
$where[] = qsprintf(
$conn_r,
'ids in (%Ld)',
'id in (%Ld)',
$this->ids);
}