1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 15:52:41 +01:00
phorge-phorge/src/applications/diffusion
epriestley f5f784f4c1 Version clustered, observed repositories in a reasonable way (by largest discovered HEAD)
Summary:
Ref T4292. For hosted, clustered repositories we have a good way to increment the internal version of the repository: every time a user pushes something, we increment the version by 1.

We don't have a great way to do this for observed/remote repositories because when we `git fetch` we might get nothing, or we might get some changes, and we can't easily tell //what// changes we got.

For example, if we see that another node is at "version 97", and we do a fetch and see some changes, we don't know if we're in sync with them (i.e., also at "version 97") or ahead of them (at "version 98").

This implements a simple way to version an observed repository:

  - Take the head of every branch/tag.
  - Look them up.
  - Pick the biggest internal ID number.

This will work //except// when branches are deleted, which could cause the version to go backward if the "biggest commit" is the one that was deleted. This should be OK, since it's rare and the effects are minor and the repository will "self-heal" on the next actual push.

Test Plan:
  - Created an observed repository.
  - Ran `bin/repository update` and observed a sensible version number appear in the version table.
  - Pushed to the remote, did another update, saw a sensible update.
  - Did an update with no push, saw no effect on version number.
  - Toggled repository to hosted, saw the version reset.
  - Simulated read traffic to out-of-sync node, saw it do a remote fetch.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4292

Differential Revision: https://secure.phabricator.com/D15986
2016-05-30 09:53:01 -07:00
..
application Sort out EditController / ManageController / EditproController Diffusion hierarchy 2016-05-10 05:14:09 -07:00
capability Simplify the implementation of PhabricatorPolicyCapability subclasses 2014-07-25 08:25:42 +10:00
conduit Version clustered, observed repositories in a reasonable way (by largest discovered HEAD) 2016-05-30 09:53:01 -07:00
config Move FontIcon calls to Icon 2016-01-28 08:48:45 -08:00
controller Improve audit behavior for "uninteresting" auditors 2016-05-17 13:47:33 -07:00
data Provide a more consistent, mostly relaxed severity for updating non-cluster repositories on cluster devices 2016-05-12 15:51:14 -07:00
doorkeeper Partially modernize Doorkeeper/Asana bridge 2014-10-01 07:09:34 -07:00
edge Fix reverting commit language 2015-06-01 09:54:30 +10:00
editor Version clustered, observed repositories in a reasonable way (by largest discovered HEAD) 2016-05-30 09:53:01 -07:00
engine When observing a repository, switch to "importing" mode on a large discovery in an empty repository 2016-05-11 06:36:38 -07:00
engineextension Fix an issue with URI index updates from the daemons 2016-05-13 06:51:31 -07:00
exception Make repository daemon locks more granular and forgiving 2016-05-13 05:17:27 -07:00
garbagecollector Support ID-based repository URIs, and canonicalize repository URIs 2016-02-18 09:56:28 -08:00
gitlfs Implement a Git LFS link table and basic batch API 2016-03-17 17:15:20 -07:00
herald Improve audit behavior for "uninteresting" auditors 2016-05-17 13:47:33 -07:00
management Version clustered, observed repositories in a reasonable way (by largest discovered HEAD) 2016-05-30 09:53:01 -07:00
panel Add "Mailing List" users 2015-06-03 18:42:33 -07:00
protocol Version clustered, observed repositories in a reasonable way (by largest discovered HEAD) 2016-05-30 09:53:01 -07:00
query Version clustered, observed repositories in a reasonable way (by largest discovered HEAD) 2016-05-30 09:53:01 -07:00
remarkup Stop all object mentions from matching after "@" 2015-09-29 06:43:49 -07:00
request Rough sketch of new repository URI editing 2016-04-29 09:21:00 -07:00
response Implement a Git LFS server which supports no operations 2016-03-17 08:08:43 -07:00
ssh Fix improper viewer for Git SSH cluster workflows 2016-05-11 18:02:02 -07:00
symbol Extend from Phobject 2015-06-15 18:02:27 +10:00
typeahead Improve type and icon information in typeahead 2016-02-05 12:48:20 -08:00
view Clean up display of clone URIs a little bit 2016-05-11 13:14:55 -07:00
DiffusionLintSaveRunner.php Move repository URIs to a dedicated index 2016-01-13 09:34:31 -08:00