sapling/eden/mononoke/server
Kostia Balytskyi 75db021d70 live_commit_sync_config: make it into a trait
Summary:
The goal is to make it easier to implement unit tests, which depend on `LiveCommitSyncConfig`. Specifically, `scs` has a piece of code, which instantiates `mononoke_api::Repo` with a test version of `CommitSyncConfig`. To migrate it to `LiveCommitSyncConfig`, I need to be able to create a test version of that. It **is** possible now, but would require me to turn a supplied instance of `CommitSyncConfig` back into `json`, which is cumbersome. Using a `dyn LiveCommitSyncConfig` there, instead of a concrete struct seems like a good idea.

Note also that we are using this technique in many places: most (all?) of our DB tables are traits, which we then implement for SQL-specific structs.

Finally, this diff does not actually migrate all of the current users of `LiveCommitSyncConfig` (the struct) to be users of `LiveCommitSyncConfig` (the trait), and instead makes them use `CfgrLiveCommitSyncConfig` (the trait impl). The idea is that we can migrate bits to use traits when needed (for example, in an upcoming `scs` diff). When not needed, it's fine to use concrete structs. Again, this is already the case in a a few places: we sometimes use `SqlSyncedCommitMapping` struct directly, instead of `T: SyncedCommitMapping` or `dyn SyncedCommitMapping`.

Reviewed By: StanislavGlebik

Differential Revision: D22383859

fbshipit-source-id: 8657fa39b11101684c1baae9f26becad6f890302
2020-07-08 08:34:06 -07:00
..
context mononoke: log size of fetched undesired files 2020-07-07 06:23:01 -07:00
monitoring autocargo: regenerate 2020-05-19 16:08:40 -07:00
repo_listener live_commit_sync_config: make it into a trait 2020-07-08 08:34:06 -07:00
session_id remove the need to pass mapping to ::derive method 2020-02-12 10:22:39 -08:00
src push compat() down one level from main 2020-07-03 02:36:09 -07:00
Cargo.toml push compat() down one level from main 2020-07-03 02:36:09 -07:00