Show open setup issue keys in "title" attribute of setup issues warning
Summary: Ref T7184. I managed to write a phantom setup issue which fails normally and succeeds when looked at carefully, so clicking "you have open issues..." always cleared them. This made it very difficult to figure out what the problem was. Show issue keys in the "title" attribute to make this sort of thing easier to deal with. Test Plan: Moused over "You have issues..." text, saw issue key, quickly fixed issue with new information. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7184 Differential Revision: https://secure.phabricator.com/D11743
This commit is contained in:
@@ -40,25 +40,25 @@ abstract class PhabricatorSetupCheck {
|
||||
$this->executeChecks();
|
||||
}
|
||||
|
||||
final public static function getOpenSetupIssueCount() {
|
||||
final public static function getOpenSetupIssueKeys() {
|
||||
$cache = PhabricatorCaches::getSetupCache();
|
||||
return $cache->getKey('phabricator.setup.issues');
|
||||
return $cache->getKey('phabricator.setup.issue-keys');
|
||||
}
|
||||
|
||||
final public static function setOpenSetupIssueCount($count) {
|
||||
final public static function setOpenSetupIssueKeys(array $keys) {
|
||||
$cache = PhabricatorCaches::getSetupCache();
|
||||
$cache->setKey('phabricator.setup.issues', $count);
|
||||
$cache->setKey('phabricator.setup.issue-keys', $keys);
|
||||
}
|
||||
|
||||
final public static function countUnignoredIssues(array $all_issues) {
|
||||
final public static function getUnignoredIssueKeys(array $all_issues) {
|
||||
assert_instances_of($all_issues, 'PhabricatorSetupIssue');
|
||||
$count = 0;
|
||||
$keys = array();
|
||||
foreach ($all_issues as $issue) {
|
||||
if (!$issue->getIsIgnored()) {
|
||||
$count++;
|
||||
$keys[] = $issue->getIssueKey();
|
||||
}
|
||||
}
|
||||
return $count;
|
||||
return $keys;
|
||||
}
|
||||
|
||||
final public static function getConfigNeedsRepair() {
|
||||
@@ -76,13 +76,13 @@ abstract class PhabricatorSetupCheck {
|
||||
$cache->deleteKeys(
|
||||
array(
|
||||
'phabricator.setup.needs-repair',
|
||||
'phabricator.setup.issues',
|
||||
'phabricator.setup.issue-keys',
|
||||
));
|
||||
}
|
||||
|
||||
final public static function willProcessRequest() {
|
||||
$issue_count = self::getOpenSetupIssueCount();
|
||||
if ($issue_count === null) {
|
||||
$issue_keys = self::getOpenSetupIssueKeys();
|
||||
if ($issue_keys === null) {
|
||||
$issues = self::runAllChecks();
|
||||
foreach ($issues as $issue) {
|
||||
if ($issue->getIsFatal()) {
|
||||
@@ -92,7 +92,7 @@ abstract class PhabricatorSetupCheck {
|
||||
->setView($view);
|
||||
}
|
||||
}
|
||||
self::setOpenSetupIssueCount(self::countUnignoredIssues($issues));
|
||||
self::setOpenSetupIssueKeys(self::getUnignoredIssueKeys($issues));
|
||||
}
|
||||
|
||||
// Try to repair configuration unless we have a clean bill of health on it.
|
||||
|
||||
@@ -11,8 +11,8 @@ final class PhabricatorConfigIssueListController
|
||||
$nav->selectFilter('issue/');
|
||||
|
||||
$issues = PhabricatorSetupCheck::runAllChecks();
|
||||
PhabricatorSetupCheck::setOpenSetupIssueCount(
|
||||
PhabricatorSetupCheck::countUnignoredIssues($issues));
|
||||
PhabricatorSetupCheck::setOpenSetupIssueKeys(
|
||||
PhabricatorSetupCheck::getUnignoredIssueKeys($issues));
|
||||
|
||||
$important = $this->buildIssueList(
|
||||
$issues, PhabricatorSetupCheck::GROUP_IMPORTANT);
|
||||
|
||||
@@ -14,8 +14,8 @@ final class PhabricatorConfigIssueViewController
|
||||
$user = $request->getUser();
|
||||
|
||||
$issues = PhabricatorSetupCheck::runAllChecks();
|
||||
PhabricatorSetupCheck::setOpenSetupIssueCount(
|
||||
PhabricatorSetupCheck::countUnignoredIssues($issues));
|
||||
PhabricatorSetupCheck::setOpenSetupIssueKeys(
|
||||
PhabricatorSetupCheck::getUnignoredIssueKeys($issues));
|
||||
|
||||
if (empty($issues[$this->issueKey])) {
|
||||
$content = id(new PHUIErrorView())
|
||||
|
||||
@@ -46,7 +46,7 @@ final class PhabricatorConfigWelcomeController
|
||||
true,
|
||||
$content);
|
||||
|
||||
$issues_resolved = !PhabricatorSetupCheck::getOpenSetupIssueCount();
|
||||
$issues_resolved = !PhabricatorSetupCheck::getOpenSetupIssueKeys();
|
||||
|
||||
$setup_href = PhabricatorEnv::getURI('/config/issue/');
|
||||
if ($issues_resolved) {
|
||||
|
||||
Reference in New Issue
Block a user