Page MenuHomePhabricator

When observing a repository, switch to "importing" mode on a large discovery in an empty repository
ClosedPublic

Authored by epriestley on May 10 2016, 2:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 12:41 AM
Unknown Object (File)
Fri, Apr 19, 4:39 PM
Unknown Object (File)
Tue, Apr 9, 4:01 PM
Unknown Object (File)
Fri, Apr 5, 6:24 PM
Unknown Object (File)
Mon, Apr 1, 3:35 PM
Unknown Object (File)
Fri, Mar 29, 10:29 AM
Unknown Object (File)
Mar 10 2024, 1:48 AM
Unknown Object (File)
Feb 20 2024, 5:44 AM
Subscribers
None

Details

Summary

Ref T10923. Fixes T9554.

When hosting a repository, we currently have a heuristic that tries to detect when you're doing an initial import: if you push more than 7 commits to an empty repository, it counts as an import and we disable mail/feed/etc.

Do something similar for observed repositories: if the repository is empty and we discover more than 7 commits, switch to import mode until we catch up.

This should align behavior with user expectation more often when juggling hosted vs imported repositories.

Test Plan
  • Created a new hosted repository.
  • Activated it and allowed it to fully import.
  • Added an "Observe URI".
  • Saw it automatically drop into "Importing" mode until the import completed.
  • Swapped it back to hosted mode.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to When observing a repository, switch to "importing" mode on a large discovery in an empty repository.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.May 11 2016, 2:56 AM

Ah, I think this caused the bad unit test in the rest of the series -- specifically, in the unit tests we create a repository and mark it ephemeral (to prevent anything from updating it), but this now causes it to update.

There's no real reason to mark it ephemeral (this was just a sanity check sort of thing, I believe), so I'll just remove that, which should fix this and all subsequent changes.

epriestley edited edge metadata.
  • Probable fix for unit tests.

That fix seems to work, I'll cascade it down the chain and sort things out in the morning.

This revision was automatically updated to reflect the committed changes.