1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-27 07:50:57 +01:00
phorge-phorge/src/applications/diffusion
epriestley f6915a7975 Add a heursitic for initial pushes which are really imports
Summary:
Fixes T7298. There are two ways to import a repository that you want to host, today:

  - Create it as "hosted", then push everything to it.
  - Create it as "imported", let it import, then switch it to "hosted".
  - (Neither of these work with SVN.)

We don't specifically recommend one or the other, although I believe both should work, and most users seem to go with the first one.

In the first workflow, the new empty repository imports completely and gets marked "imported", so our default behavior is then to publish commits. This can generate a lot of email/notification/feed spam.

If you're a fancy expert you might turn off "publish" before pushing, but normal users will frequently miss this.

Instead, when we receive an "import-like" push to an empty repository, put the repository back into "importing" after we accept the changes.

This has to be heuristic since we can't know for sure if a push is an import or new commits, but here's a simple rule that should do pretty well. We can refine it if necessary.

Test Plan:
  - Created a new empty repository.
  - Added some debugging code; verified the "commit count" and "empty" rules were calculated properly.
  - Pushed 8+ commits and saw the repo go into "importing", import, and leave "importing".
  - Pushed 8+ commits again and saw them publish.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7298

Differential Revision: https://secure.phabricator.com/D11827
2015-02-19 10:38:16 -08:00
..
application Remove getIconName from all applications 2015-01-30 12:11:21 -08:00
capability Simplify the implementation of PhabricatorPolicyCapability subclasses 2014-07-25 08:25:42 +10:00
conduit Diffusion - be sure to properly unserialize result from conduit query 2015-02-17 13:54:59 -08:00
config Allow a different SSH host to be set in Diffusion 2015-02-18 10:51:14 -08:00
controller Improve visibility of repository credential errors 2015-02-19 10:32:25 -08:00
data Fix text lint issues 2015-02-12 07:00:13 +11:00
doorkeeper Partially modernize Doorkeeper/Asana bridge 2014-10-01 07:09:34 -07:00
edge Use PhabricatorAuditEditor to write revert edges 2015-01-06 07:30:38 +11:00
engine Add a heursitic for initial pushes which are really imports 2015-02-19 10:38:16 -08:00
events Migrate Differential revision edges to use modern EdgeType subclasses 2015-01-01 15:07:03 +11:00
exception Apply some autofix linter rules 2014-09-10 06:55:05 +10:00
herald Allow pre-commit adapter to use custom actions 2014-08-28 10:59:30 +10:00
panel PHUIErrorView 2015-02-01 20:14:56 -08:00
protocol Applied various linter fixes. 2014-06-09 16:04:12 -07:00
query Policy - lock down DiffusionSymbolQuery repo-loading code 2015-01-31 18:36:36 -08:00
remarkup make repo callsigns optional 2015-01-01 08:07:26 -08:00
request Fix lookup of commits in Subversion 2015-02-03 09:54:17 -08:00
response Allow Phabricator to serve Mercurial repositories over HTTP 2013-11-06 18:00:42 -08:00
ssh Proxy VCS SSH requests 2015-01-28 14:41:24 -08:00
typeahead Policy - lock down DiffusionSymbolQuery repo-loading code 2015-01-31 18:36:36 -08:00
view PHUIErrorView 2015-02-01 20:14:56 -08:00
DiffusionLintSaveRunner.php Remove 'initFromConduit' option from Diffusion 2015-01-23 13:31:45 -08:00