@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<?php
2
3// Advise installs to rebuild the repository identities.
4
5// If the install has no commits (or no commits that lack an
6// authorIdentityPHID), don't require a rebuild.
7$commits = id(new PhabricatorRepositoryCommit())
8 ->loadAllWhere('authorIdentityPHID IS NULL LIMIT 1');
9
10if (!$commits) {
11 return;
12}
13
14try {
15 id(new PhabricatorConfigManualActivity())
16 ->setActivityType(PhabricatorConfigManualActivity::TYPE_IDENTITIES)
17 ->save();
18} catch (AphrontDuplicateKeyQueryException $ex) {
19 // If we've already noted that this activity is required, just move on.
20}