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)
Apr 5 2024, 6:24 PM
Unknown Object (File)
Apr 1 2024, 3:35 PM
Unknown Object (File)
Mar 29 2024, 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
Branch
dxdoc12
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 12118
Build 15278: Run Core Tests
Build 15277: arc lint + arc unit

Unit TestsFailed

TimeTest
81 msPhabricatorChangeParserTestCase::Unknown Unit Message ("")
EXCEPTION (PhutilAggregateException): Multiple exceptions were raised during test execution. - Execution: LiskEphemeralObjectException: - Shutdown: Exception: Process exited with an open transaction! The transaction will be implicitly rolled back. Calls to openTransaction() must always be paired with a call to saveTransaction() or killTransaction().
0 msAlmanacNamesTestCase::Unknown Unit Message ("")
30 assertions passed.
0 msAlmanacServiceTypeTestCase::Unknown Unit Message ("")
1 assertion passed.
0 msAphrontHTTPSinkTestCase::Unknown Unit Message ("")
2 assertions passed.
0 msAphrontHTTPSinkTestCase::Unknown Unit Message ("")
3 assertions passed.
View Full Test Results (1 Failed · 335 Passed)

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.