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

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

+20 -19
+12 -12
src/applications/config/check/PhabricatorSetupCheck.php
··· 40 40 $this->executeChecks(); 41 41 } 42 42 43 - final public static function getOpenSetupIssueCount() { 43 + final public static function getOpenSetupIssueKeys() { 44 44 $cache = PhabricatorCaches::getSetupCache(); 45 - return $cache->getKey('phabricator.setup.issues'); 45 + return $cache->getKey('phabricator.setup.issue-keys'); 46 46 } 47 47 48 - final public static function setOpenSetupIssueCount($count) { 48 + final public static function setOpenSetupIssueKeys(array $keys) { 49 49 $cache = PhabricatorCaches::getSetupCache(); 50 - $cache->setKey('phabricator.setup.issues', $count); 50 + $cache->setKey('phabricator.setup.issue-keys', $keys); 51 51 } 52 52 53 - final public static function countUnignoredIssues(array $all_issues) { 53 + final public static function getUnignoredIssueKeys(array $all_issues) { 54 54 assert_instances_of($all_issues, 'PhabricatorSetupIssue'); 55 - $count = 0; 55 + $keys = array(); 56 56 foreach ($all_issues as $issue) { 57 57 if (!$issue->getIsIgnored()) { 58 - $count++; 58 + $keys[] = $issue->getIssueKey(); 59 59 } 60 60 } 61 - return $count; 61 + return $keys; 62 62 } 63 63 64 64 final public static function getConfigNeedsRepair() { ··· 76 76 $cache->deleteKeys( 77 77 array( 78 78 'phabricator.setup.needs-repair', 79 - 'phabricator.setup.issues', 79 + 'phabricator.setup.issue-keys', 80 80 )); 81 81 } 82 82 83 83 final public static function willProcessRequest() { 84 - $issue_count = self::getOpenSetupIssueCount(); 85 - if ($issue_count === null) { 84 + $issue_keys = self::getOpenSetupIssueKeys(); 85 + if ($issue_keys === null) { 86 86 $issues = self::runAllChecks(); 87 87 foreach ($issues as $issue) { 88 88 if ($issue->getIsFatal()) { ··· 92 92 ->setView($view); 93 93 } 94 94 } 95 - self::setOpenSetupIssueCount(self::countUnignoredIssues($issues)); 95 + self::setOpenSetupIssueKeys(self::getUnignoredIssueKeys($issues)); 96 96 } 97 97 98 98 // Try to repair configuration unless we have a clean bill of health on it.
+2 -2
src/applications/config/controller/PhabricatorConfigIssueListController.php
··· 11 11 $nav->selectFilter('issue/'); 12 12 13 13 $issues = PhabricatorSetupCheck::runAllChecks(); 14 - PhabricatorSetupCheck::setOpenSetupIssueCount( 15 - PhabricatorSetupCheck::countUnignoredIssues($issues)); 14 + PhabricatorSetupCheck::setOpenSetupIssueKeys( 15 + PhabricatorSetupCheck::getUnignoredIssueKeys($issues)); 16 16 17 17 $important = $this->buildIssueList( 18 18 $issues, PhabricatorSetupCheck::GROUP_IMPORTANT);
+2 -2
src/applications/config/controller/PhabricatorConfigIssueViewController.php
··· 14 14 $user = $request->getUser(); 15 15 16 16 $issues = PhabricatorSetupCheck::runAllChecks(); 17 - PhabricatorSetupCheck::setOpenSetupIssueCount( 18 - PhabricatorSetupCheck::countUnignoredIssues($issues)); 17 + PhabricatorSetupCheck::setOpenSetupIssueKeys( 18 + PhabricatorSetupCheck::getUnignoredIssueKeys($issues)); 19 19 20 20 if (empty($issues[$this->issueKey])) { 21 21 $content = id(new PHUIErrorView())
+1 -1
src/applications/config/controller/PhabricatorConfigWelcomeController.php
··· 46 46 true, 47 47 $content); 48 48 49 - $issues_resolved = !PhabricatorSetupCheck::getOpenSetupIssueCount(); 49 + $issues_resolved = !PhabricatorSetupCheck::getOpenSetupIssueKeys(); 50 50 51 51 $setup_href = PhabricatorEnv::getURI('/config/issue/'); 52 52 if ($issues_resolved) {
+3 -2
src/view/page/PhabricatorStandardPageView.php
··· 335 335 // Render the "you have unresolved setup issues..." warning. 336 336 $setup_warning = null; 337 337 if ($user && $user->getIsAdmin()) { 338 - $open = PhabricatorSetupCheck::getOpenSetupIssueCount(); 338 + $open = PhabricatorSetupCheck::getOpenSetupIssueKeys(); 339 339 if ($open) { 340 340 $setup_warning = phutil_tag_div( 341 341 'setup-warning-callout', ··· 343 343 'a', 344 344 array( 345 345 'href' => '/config/issue/', 346 + 'title' => implode(', ', $open), 346 347 ), 347 - pht('You have %d unresolved setup issue(s)...', $open))); 348 + pht('You have %d unresolved setup issue(s)...', count($open)))); 348 349 } 349 350 } 350 351