Config option to ignore setup issues
Summary: T2381 Test Plan: Include existing setup issues in the ignore config option, reduces the number of setup issues in the status bar, moves ignored issues to the bottom of the list, and marks them as ignored. Also include a string corresponding to no setup issue, and verify that application does not break. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5072
This commit is contained in:
committed by
epriestley
parent
894cd13a41
commit
be7677f211
@@ -13,7 +13,6 @@ abstract class PhabricatorSetupCheck {
|
||||
final protected function newIssue($key) {
|
||||
$issue = id(new PhabricatorSetupIssue())
|
||||
->setIssueKey($key);
|
||||
|
||||
$this->issues[$key] = $issue;
|
||||
|
||||
return $issue;
|
||||
@@ -38,6 +37,17 @@ abstract class PhabricatorSetupCheck {
|
||||
$cache->setKey('phabricator.setup.issues', $count);
|
||||
}
|
||||
|
||||
final public static function countUnignoredIssues(array $all_issues) {
|
||||
assert_instances_of($all_issues, 'PhabricatorSetupIssue');
|
||||
$count = 0;
|
||||
foreach ($all_issues as $issue) {
|
||||
if (!$issue->getIsIgnored()) {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
final public static function getConfigNeedsRepair() {
|
||||
$cache = PhabricatorCaches::getSetupCache();
|
||||
return $cache->getKey('phabricator.setup.needs-repair');
|
||||
@@ -69,7 +79,7 @@ abstract class PhabricatorSetupCheck {
|
||||
->setView($view);
|
||||
}
|
||||
}
|
||||
self::setOpenSetupIssueCount(count($issues));
|
||||
self::setOpenSetupIssueCount(self::countUnignoredIssues($issues));
|
||||
}
|
||||
|
||||
// Try to repair configuration unless we have a clean bill of health on it.
|
||||
@@ -111,6 +121,13 @@ abstract class PhabricatorSetupCheck {
|
||||
}
|
||||
}
|
||||
|
||||
foreach (PhabricatorEnv::getEnvConfig('config.ignore-issues')
|
||||
as $ignorable => $derp) {
|
||||
if (isset($issues[$ignorable])) {
|
||||
$issues[$ignorable]->setIsIgnored(true);
|
||||
}
|
||||
}
|
||||
|
||||
return $issues;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user