1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-03 20:22:46 +01:00
phorge-phorge/src/applications/repository/engine
epriestley 20892ae502 Simplify "git fetch" behavior in the Pull daemon
Summary:
Ref T12392. The logic currently goes like this:

  - Try a fetch.
  - If that fails, try repairing the origin URI.
  - Then try again.

This is pretty complicated, and we can use this simpler logic instead:

  - Set the origin URI to the right value.
  - Try a fetch.

Setting the origin URI is very fast. This can normally only get us in any trouble in very obscure situations which haven't occurred for many years:

  - Pretty much all of this is already covered by `verifyGitOrigin()`, which we run earlier.
  - Origins could be configured to have multiple URIs for some reason, but shouldn't be.
  - Years ago, you could configure Phabricator to point at a local repository it didn't own and that could conceivably have a different "origin" that you might not want us to delete. If you did this, the daemons have been spewing errors for 3-4 years without you fixing it. The cost of fixing the remote URI is very small even if anyone is affected by this (just set it back to the old value) and there's zero reason to do this and the scenario is ridiculous.

Test Plan: Ran `bin/repository update PHABX --trace --verbose`, saw fetches go through cleanly after URI adjustment.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12392

Differential Revision: https://secure.phabricator.com/D17498
2017-03-17 16:43:37 -07:00
..
__tests__ Only load refs that are actual commits 2016-07-08 22:34:25 +00:00
PhabricatorRepositoryCommitRef.php Extend from Phobject 2015-06-15 18:02:27 +10:00
PhabricatorRepositoryDiscoveryEngine.php Increase the size of the Diffusion commit cache 2017-02-24 10:54:19 -08:00
PhabricatorRepositoryEngine.php Make repository daemon locks more granular and forgiving 2016-05-13 05:17:27 -07:00
PhabricatorRepositoryMirrorEngine.php Fix errors found by PHPStan 2017-02-18 09:24:56 +00:00
PhabricatorRepositoryPullEngine.php Simplify "git fetch" behavior in the Pull daemon 2017-03-17 16:43:37 -07:00
PhabricatorRepositoryRefEngine.php When a ref is moved or deleted, put it on a list; later, check for reachability 2016-06-16 11:21:38 -07:00