1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-10 05:48:30 +01:00
phorge-phorge/src/applications/diffusion/management
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
..
DiffusionRepositoryActionsManagementPanel.php Add icons to the new repository edit nav 2016-05-03 08:01:18 -07:00
DiffusionRepositoryAutomationManagementPanel.php Hide irrelevant panels in Mercurial/Subversion, fix Subversion URIs 2016-05-10 05:16:08 -07:00
DiffusionRepositoryBasicsManagementPanel.php Put "Projects" edit field back on Basics management panel for repositories 2016-05-12 07:17:14 -07:00
DiffusionRepositoryBranchesManagementPanel.php Hide irrelevant panels in Mercurial/Subversion, fix Subversion URIs 2016-05-10 05:16:08 -07:00
DiffusionRepositoryDocumentationManagementPanel.php Provide some more context hints for repository URIs 2016-05-10 05:14:29 -07:00
DiffusionRepositoryHistoryManagementPanel.php Add icons to the new repository edit nav 2016-05-03 08:01:18 -07:00
DiffusionRepositoryManagementPanel.php Hide irrelevant panels in Mercurial/Subversion, fix Subversion URIs 2016-05-10 05:16:08 -07:00
DiffusionRepositoryPoliciesManagementPanel.php Put "Push Policy" last in Diffusion, make editing Spaces work 2016-05-09 06:34:02 -07:00
DiffusionRepositoryStagingManagementPanel.php Hide irrelevant panels in Mercurial/Subversion, fix Subversion URIs 2016-05-10 05:16:08 -07:00
DiffusionRepositoryStatusManagementPanel.php Bring old repository instructions and guidance forward to new UI 2016-05-10 05:15:43 -07:00
DiffusionRepositoryStorageManagementPanel.php Version clustered, observed repositories in a reasonable way (by largest discovered HEAD) 2016-05-30 09:53:01 -07:00
DiffusionRepositorySubversionManagementPanel.php Restore edit UI for "Import Only" in Subversion 2016-05-11 06:47:32 -07:00
DiffusionRepositorySymbolsManagementPanel.php Add icons to the new repository edit nav 2016-05-03 08:01:18 -07:00
DiffusionRepositoryURIsManagementPanel.php Provide more UI guidance when creating repositories 2016-05-11 06:35:35 -07:00