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)
Sun, Dec 22, 4:02 AM
Unknown Object (File)
Fri, Dec 20, 4:27 PM
Unknown Object (File)
Tue, Dec 17, 10:23 PM
Unknown Object (File)
Tue, Dec 10, 11:18 AM
Unknown Object (File)
Sat, Dec 7, 7:30 PM
Unknown Object (File)
Wed, Dec 4, 4:14 PM
Unknown Object (File)
Sat, Nov 30, 11:40 PM
Unknown Object (File)
Sat, Nov 30, 3:03 PM
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.