mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 10:42:41 +01:00
a6951a0a5a
Summary: Ref T12164. Defines a new manual activity that suggests rebuilding repository identities before Phabricator begins to rely on them. Test Plan: - Ran migration, observed expected setup issue: {F5788217} - Ran `bin/config done identities` and observed setup issue get marked as done. - Ran `/bin/storage upgrade --apply phabricator:20170912.ferret.01.activity.php` to make sure I didn't break the reindex migration; observed reindex setup issue appear as expected. - Ran `./bin/config done reindex` and observed reindex issue cleared as expected. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T12164 Differential Revision: https://secure.phabricator.com/D19497
20 lines
573 B
PHP
20 lines
573 B
PHP
<?php
|
|
|
|
// Advise installs to rebuild the repository identities.
|
|
|
|
// If the install has no commits (or no commits that lack an
|
|
// authorIdentityPHID), don't require a rebuild.
|
|
$commits = id(new PhabricatorRepositoryCommit())
|
|
->loadAllWhere('authorIdentityPHID IS NULL LIMIT 1');
|
|
|
|
if (!$commits) {
|
|
return;
|
|
}
|
|
|
|
try {
|
|
id(new PhabricatorConfigManualActivity())
|
|
->setActivityType(PhabricatorConfigManualActivity::TYPE_IDENTITIES)
|
|
->save();
|
|
} catch (AphrontDuplicateKeyQueryException $ex) {
|
|
// If we've already noted that this activity is required, just move on.
|
|
}
|