3 final class PhabricatorManualActivitySetupCheck
4 extends PhabricatorSetupCheck
{
6 public function getDefaultGroup() {
7 return self
::GROUP_OTHER
;
10 protected function executeChecks() {
11 $activities = id(new PhabricatorConfigManualActivity())->loadAll();
13 foreach ($activities as $activity) {
14 $type = $activity->getActivityType();
17 case PhabricatorConfigManualActivity
::TYPE_REINDEX
:
18 $this->raiseSearchReindexIssue();
21 case PhabricatorConfigManualActivity
::TYPE_IDENTITIES
:
22 $this->raiseRebuildIdentitiesIssue();
30 private function raiseSearchReindexIssue() {
31 $activity_name = pht('Rebuild Search Index');
32 $activity_summary = pht(
33 'The search index algorithm has been updated and the index needs '.
39 'The indexing algorithm for the fulltext search index has been '.
40 'updated and the index needs to be rebuilt. Until you rebuild the '.
41 'index, global search (and other fulltext search) will not '.
42 'function correctly.');
45 'You can rebuild the search index while the server is running.');
48 'To rebuild the index, run this command:');
50 $message[] = phutil_tag(
54 '$ ./bin/search index --all --force --background'));
57 'You can find more information about rebuilding the search '.
62 'href' => 'https://phurl.io/u/reindex',
65 'https://phurl.io/u/reindex'));
68 'After rebuilding the index, run this command to clear this setup '.
71 $message[] = phutil_tag(
74 '$ ./bin/config done reindex');
76 $activity_message = phutil_implode_html("\n\n", $message);
78 $this->newIssue('manual.reindex')
79 ->setName($activity_name)
80 ->setSummary($activity_summary)
81 ->setMessage($activity_message);
84 private function raiseRebuildIdentitiesIssue() {
85 $activity_name = pht('Rebuild Repository Identities');
86 $activity_summary = pht(
87 'The mapping from VCS users to %s users has changed '.
88 'and must be rebuilt.',
89 PlatformSymbols
::getPlatformServerName());
94 'The way VCS activity is attributed %s user accounts has changed.',
95 PlatformSymbols
::getPlatformServerName());
98 'There is a new indirection layer between the strings that appear as '.
99 'VCS authors and committers (such as "John Developer '.
100 '<johnd@bigcorp.com>") and the user account that gets associated '.
101 'with VCS commits.');
104 'This change supports situations where users are incorrectly '.
105 'associated with commits because the software makes a bad guess '.
106 'about how the VCS string maps to a user account. '.
107 'This also helps with situations where existing repositories are '.
108 'imported without having created accounts for all the committers to '.
109 'that repository. Until you rebuild these repository identities, you '.
110 'are likely to encounter problems with features which rely on the '.
111 'existence of these identities.');
114 'You can rebuild repository identities while the server is running.');
117 'To rebuild identities, run this command:');
119 $message[] = phutil_tag(
123 '$ ./bin/repository rebuild-identities --all-repositories'));
126 'You can find more information about this new identity mapping '.
131 'href' => 'https://phurl.io/u/repoIdentities',
132 'target' => '_blank',
134 'https://phurl.io/u/repoIdentities'));
137 'After rebuilding repository identities, run this command to clear '.
138 'this setup warning:');
140 $message[] = phutil_tag(
143 '$ ./bin/config done identities');
145 $activity_message = phutil_implode_html("\n\n", $message);
147 $this->newIssue('manual.identities')
148 ->setName($activity_name)
149 ->setSummary($activity_summary)
150 ->setMessage($activity_message);