@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.

Raise a setup warning for missing or invalid local repository directory

Summary: I'm planning to add more detailed info to Diffusion itself, but catch the big issue here.

Test Plan: Hit config issue locally, then resolved it.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+49 -9
+2
src/__phutil_library_map__.php
··· 1740 1740 'PhabricatorSetupCheckPHPConfig' => 'applications/config/check/PhabricatorSetupCheckPHPConfig.php', 1741 1741 'PhabricatorSetupCheckPath' => 'applications/config/check/PhabricatorSetupCheckPath.php', 1742 1742 'PhabricatorSetupCheckPygment' => 'applications/config/check/PhabricatorSetupCheckPygment.php', 1743 + 'PhabricatorSetupCheckRepositories' => 'applications/config/check/PhabricatorSetupCheckRepositories.php', 1743 1744 'PhabricatorSetupCheckStorage' => 'applications/config/check/PhabricatorSetupCheckStorage.php', 1744 1745 'PhabricatorSetupCheckTimezone' => 'applications/config/check/PhabricatorSetupCheckTimezone.php', 1745 1746 'PhabricatorSetupIssue' => 'applications/config/issue/PhabricatorSetupIssue.php', ··· 4070 4071 'PhabricatorSetupCheckPHPConfig' => 'PhabricatorSetupCheck', 4071 4072 'PhabricatorSetupCheckPath' => 'PhabricatorSetupCheck', 4072 4073 'PhabricatorSetupCheckPygment' => 'PhabricatorSetupCheck', 4074 + 'PhabricatorSetupCheckRepositories' => 'PhabricatorSetupCheck', 4073 4075 'PhabricatorSetupCheckStorage' => 'PhabricatorSetupCheck', 4074 4076 'PhabricatorSetupCheckTimezone' => 'PhabricatorSetupCheck', 4075 4077 'PhabricatorSetupIssueExample' => 'PhabricatorUIExample',
+43
src/applications/config/check/PhabricatorSetupCheckRepositories.php
··· 1 + <?php 2 + 3 + final class PhabricatorSetupCheckRepositories extends PhabricatorSetupCheck { 4 + 5 + protected function executeChecks() { 6 + $repo_path = PhabricatorEnv::getEnvConfig('repository.default-local-path'); 7 + 8 + if (!$repo_path) { 9 + $summary = pht( 10 + "The configuration option '%s' is not set.", 11 + 'repository.default-local-path'); 12 + $this->newIssue('repository.default-local-path.empty') 13 + ->setName(pht('Missing Repository Local Path')) 14 + ->setSummary($summary) 15 + ->addPhabricatorConfig('repository.default-local-path'); 16 + return; 17 + } 18 + 19 + if (!Filesystem::pathExists($repo_path)) { 20 + $summary = pht( 21 + "The path for local repositories does not exist, or is not ". 22 + "readable by the webserver."); 23 + $message = pht( 24 + "The directory for local repositories (%s) does not exist, or is not ". 25 + "readable by the webserver. Phabricator uses this directory to store ". 26 + "information about repositories. If this directory does not exist, ". 27 + "create it:\n\n". 28 + "%s\n". 29 + "If this directory exists, make it readable to the webserver. You ". 30 + "can also edit the configuration below to use some other directory.", 31 + phutil_tag('tt', array(), $repo_path), 32 + phutil_tag('pre', array(), csprintf('$ mkdir -p %s', $repo_path))); 33 + 34 + $this->newIssue('repository.default-local-path.empty') 35 + ->setName(pht('Missing Repository Local Path')) 36 + ->setSummary($summary) 37 + ->setMessage($message) 38 + ->addPhabricatorConfig('repository.default-local-path'); 39 + } 40 + 41 + } 42 + 43 + }
+4 -9
src/applications/repository/PhabricatorRepositoryConfigOptions.php
··· 21 21 pht("Default location to store local copies of repositories.")) 22 22 ->setDescription( 23 23 pht( 24 - "The default location in which to store local copies of ". 25 - "repositories. Anything stored in this directory will be assumed ". 26 - "to be under the control of Phabricator, which means that ". 27 - "Phabricator will try to do some maintenance on working copies ". 28 - "if there are problems (such as a change to the remote origin ". 29 - "url). This maintenance may include completely removing (and ". 30 - "recloning) anything in this directory.\n\n". 31 - "When set to null, this option is ignored (i.e. Phabricator will ". 32 - "not fully control any working copies).")), 24 + "The default location in which to store working copies and other ". 25 + "data about repositories. Phabricator will control and manage ". 26 + "data here, so you should **not** choose an existing directory ". 27 + "full of data you care about.")), 33 28 ); 34 29 } 35 30