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

Add an "--ignore-locality" flag to "bin/repository pull"

Summary:
Ref T13600. When migrating observed repositories between cluster services, impact can be better controlled by fetching a copy of the repository on the target host before clusterizing it.

In particular, in the Phacility cluster, migrations are generally from one shared shard to one dedicated shard. It's helpful to perform these migrations synchronously without waiting for the cluster to sync in the background (helpful in the sense that there are fewer steps and fewer commands to run).

This supports an "--observe" mode to the internal "bin/services load-repository" workflow, which transfers repository data by refetching it from the remote rather than by getting it from the older host. This fetch occurs before cluster configuration is adjusted.

Test Plan: Ran locally as a sanity check, will apply in production.

Maniphest Tasks: T13600

Differential Revision: https://secure.phabricator.com/D21544

+14 -2
+8 -1
src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php
··· 15 15 'help' => pht('Show additional debugging information.'), 16 16 ), 17 17 array( 18 + 'name' => 'ignore-locality', 19 + 'help' => pht( 20 + 'Pull even if the repository should not be present on this '. 21 + 'host according to repository cluster configuration.'), 22 + ), 23 + array( 18 24 'name' => 'repos', 19 25 'wildcard' => true, 20 26 ), ··· 22 28 } 23 29 24 30 public function execute(PhutilArgumentParser $args) { 25 - $repos = $this->loadLocalRepositories($args, 'repos'); 31 + $ignore_locality = (bool)$args->getArg('ignore-locality'); 26 32 33 + $repos = $this->loadLocalRepositories($args, 'repos', $ignore_locality); 27 34 if (!$repos) { 28 35 throw new PhutilArgumentUsageException( 29 36 pht('Specify one or more repositories to pull.'));
+6 -1
src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
··· 35 35 36 36 protected function loadLocalRepositories( 37 37 PhutilArgumentParser $args, 38 - $param) { 38 + $param, 39 + $ignore_locality = false) { 39 40 40 41 $repositories = $this->loadRepositories($args, $param); 41 42 if (!$repositories) { 43 + return $repositories; 44 + } 45 + 46 + if ($ignore_locality) { 42 47 return $repositories; 43 48 } 44 49