HomePhabricator

Rearrange store-related code
f7d5add65ef0Unpublished

Unpublished Commit · Learn More

Publishing Disabled: All publishing is disabled for this repository.

Description

Rearrange store-related code

The BatchCommandRecords and BatchBackgroundRuns abstract classes move
into their own modules. Their list-based implementations move into a new
in_memory module, together with InMemoryStore, whereas DatabaseStore and
the corresponding classes move into a new database module, leaving the
store module with just the BatchStore interface and a few helper classes
shared between implementations.

This formally ties the in-memory implementations to the InMemoryStore,
abandoning the fiction that they’re independent of it or that you could
mix different kinds of command records or background runs accessors with
different store implementations. This will let us add the InMemoryStore
as a member of those accessors, just as the DatabaseStore is already a
member of its accessors, because they need it to implement some
operations; the in-memory versions will now need this as well (to append
copies of certain failures to a batch when they’re saved), which is the
motivation for this commit.

We also take this opportunity to rename some of the tests which still
had the DatabaseStore in their name even though they actually test both
store implementations (using the fixture introduced in 333d717651).
Those stay in test_store, whereas the others move to test_in_memory or
test_database according to what they test.

Details

Provenance
LucasWerkmeisterAuthored on Apr 21 2019, 5:35 PM
Parents
R2494:16748423468b: Add CommandFailure.can_retry_later()
Branches
Unknown
Tags
Unknown
ChangeId
None