2020-06-05 16:21:37 +03:00
|
|
|
[package]
|
|
|
|
name = "mononoke_api"
|
|
|
|
edition = "2018"
|
|
|
|
version = "0.1.0"
|
|
|
|
authors = ['Facebook']
|
|
|
|
license = "GPLv2+"
|
|
|
|
include = ["src/**/*.rs"]
|
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
blame = { path = "../derived_data/blame" }
|
|
|
|
blobrepo = { path = "../blobrepo" }
|
|
|
|
blobrepo_factory = { path = "../blobrepo/factory" }
|
2020-06-22 17:20:47 +03:00
|
|
|
blobrepo_hg = { path = "../blobrepo/blobrepo_hg" }
|
2020-06-05 16:21:37 +03:00
|
|
|
blobstore = { path = "../blobstore" }
|
|
|
|
blobstore_factory = { path = "../blobstore/factory" }
|
|
|
|
bookmarks = { path = "../bookmarks" }
|
2020-08-25 19:10:07 +03:00
|
|
|
bookmarks_movement = { path = "../bookmarks/bookmarks_movement" }
|
2020-06-05 16:21:37 +03:00
|
|
|
changeset_info = { path = "../derived_data/changeset_info" }
|
|
|
|
context = { path = "../server/context" }
|
|
|
|
cross_repo_sync = { path = "../commit_rewriting/cross_repo_sync" }
|
|
|
|
derived_data = { path = "../derived_data" }
|
|
|
|
fastlog = { path = "../derived_data/fastlog" }
|
|
|
|
filestore = { path = "../filestore" }
|
|
|
|
fsnodes = { path = "../derived_data/fsnodes" }
|
2020-07-22 20:35:57 +03:00
|
|
|
getbundle_response = { path = "../repo_client/getbundle_response" }
|
2020-06-05 16:21:37 +03:00
|
|
|
hgproto = { path = "../hgproto" }
|
2020-08-25 19:10:07 +03:00
|
|
|
hook_manager_factory = { path = "../hooks/hook_manager_factory" }
|
|
|
|
hooks = { path = "../hooks" }
|
live_commit_sync_config: make scs xrepo-lookup watch live changes
Summary:
When we change `CommitSyncConfig`, we want to not have to restart `scs` servers, and instead have them pick up the new config by using `LiveCommitSyncConfig`.
This diff turned out larger than I expected, mainly due to the need to introduce various things around `TestLiveCommitSyncConfig`:
- `TestLiveCommitSyncConfig`: the trait implementer to use in `mononoke_api::Repo`
- `TestLiveCommitSyncConfigSource`: the helper struct to keep around for new values injection (very similar to how our `ConfigStore` has an inner `ConfigSource`, which can also be `TestSource`, but here injected values can be `CommitSyncConfig` instead of JSON).
- all the places in integration tests, where `setup_configerator_configs` is now needed (I plan to start setting up configerator configs always in a separate diff, as it is cheap)
Here are the explanations for a few things I think may be not immediately obvious:
- I removed the `Clone` bound from `LiveCommitSyncConfig` trait, as `Clone` traits [cannot be made into trait objects](https://doc.rust-lang.org/book/ch17-02-trait-objects.html#object-safety-is-required-for-trait-objects)
- `TestLiveCommitSyncConfigSource` vs `TestLiveCommitSyncConfigSourceInner` discrepancy is to ensure nobody should instantiate `TestLiveCommitSyncConfigSourceInner` outside of `live_commit_sync_config/src`
- I am aware of the ugly discrepancy between the main `--mononoke-config-path`, which is used to load initial configuration and can be both a file-based and a configerator-based config; and `--local-configerator-path`, used to override config sources for `Tunables` and `LiveCommitSyncConfig`. Ideally these two should just be unified somehow, but that is a little out of scope of this diff (I've already added it to the dirt doc though).
- in `mononoke_api::Repo` there are methods `new_test_xrepo` and `new_test_common`, which changed from maybe accepting just a `CommitSyncConfig` to now maybe accepting both `CommitSyncConfig` and `LiveCommitSyncConfig`. It can be made a bit cleaner: I can just query `CommitSyncConfig` from `LiveCommitSyncConfig` in `new_test_common` and avoid having two args. I was too lazy to do this, lmk if you feel strongly about it.
Reviewed By: StanislavGlebik
Differential Revision: D22443623
fbshipit-source-id: 0d6bbda2223e77b89cc59863b703db5081bcd601
2020-07-21 19:07:15 +03:00
|
|
|
live_commit_sync_config = { path = "../commit_rewriting/live_commit_sync_config" }
|
2020-06-05 16:21:37 +03:00
|
|
|
manifest = { path = "../manifest" }
|
|
|
|
mercurial_types = { path = "../mercurial/types" }
|
|
|
|
metaconfig_parser = { path = "../metaconfig/parser" }
|
|
|
|
metaconfig_types = { path = "../metaconfig/types" }
|
|
|
|
mononoke_types = { path = "../mononoke_types" }
|
2020-08-12 22:01:29 +03:00
|
|
|
mutable_counters = { path = "../mutable_counters" }
|
2020-06-05 16:21:37 +03:00
|
|
|
permission_checker = { path = "../permission_checker" }
|
|
|
|
reachabilityindex = { path = "../reachabilityindex" }
|
|
|
|
remotefilelog = { path = "../repo_client/remotefilelog" }
|
|
|
|
repo_client = { path = "../repo_client" }
|
2020-07-22 20:35:57 +03:00
|
|
|
revisionstore_types = { path = "../../scm/lib/revisionstore/types" }
|
2020-06-05 16:21:37 +03:00
|
|
|
revset = { path = "../revset" }
|
2020-06-11 20:38:38 +03:00
|
|
|
scuba_ext = { path = "../common/scuba_ext" }
|
2020-08-04 21:20:35 +03:00
|
|
|
segmented_changelog = { path = "../segmented_changelog" }
|
2020-06-05 16:21:37 +03:00
|
|
|
skiplist = { path = "../reachabilityindex/skiplist" }
|
2020-08-12 22:01:29 +03:00
|
|
|
sql_construct = { path = "../common/sql_construct" }
|
2020-06-05 16:21:37 +03:00
|
|
|
sql_ext = { path = "../common/rust/sql_ext" }
|
|
|
|
synced_commit_mapping = { path = "../commit_rewriting/synced_commit_mapping" }
|
|
|
|
unodes = { path = "../derived_data/unodes" }
|
|
|
|
warm_bookmarks_cache = { path = "../bookmarks/warm_bookmarks_cache" }
|
|
|
|
xdiff = { path = "../../scm/lib/xdiff" }
|
live_commit_sync_config: make scs xrepo-lookup watch live changes
Summary:
When we change `CommitSyncConfig`, we want to not have to restart `scs` servers, and instead have them pick up the new config by using `LiveCommitSyncConfig`.
This diff turned out larger than I expected, mainly due to the need to introduce various things around `TestLiveCommitSyncConfig`:
- `TestLiveCommitSyncConfig`: the trait implementer to use in `mononoke_api::Repo`
- `TestLiveCommitSyncConfigSource`: the helper struct to keep around for new values injection (very similar to how our `ConfigStore` has an inner `ConfigSource`, which can also be `TestSource`, but here injected values can be `CommitSyncConfig` instead of JSON).
- all the places in integration tests, where `setup_configerator_configs` is now needed (I plan to start setting up configerator configs always in a separate diff, as it is cheap)
Here are the explanations for a few things I think may be not immediately obvious:
- I removed the `Clone` bound from `LiveCommitSyncConfig` trait, as `Clone` traits [cannot be made into trait objects](https://doc.rust-lang.org/book/ch17-02-trait-objects.html#object-safety-is-required-for-trait-objects)
- `TestLiveCommitSyncConfigSource` vs `TestLiveCommitSyncConfigSourceInner` discrepancy is to ensure nobody should instantiate `TestLiveCommitSyncConfigSourceInner` outside of `live_commit_sync_config/src`
- I am aware of the ugly discrepancy between the main `--mononoke-config-path`, which is used to load initial configuration and can be both a file-based and a configerator-based config; and `--local-configerator-path`, used to override config sources for `Tunables` and `LiveCommitSyncConfig`. Ideally these two should just be unified somehow, but that is a little out of scope of this diff (I've already added it to the dirt doc though).
- in `mononoke_api::Repo` there are methods `new_test_xrepo` and `new_test_common`, which changed from maybe accepting just a `CommitSyncConfig` to now maybe accepting both `CommitSyncConfig` and `LiveCommitSyncConfig`. It can be made a bit cleaner: I can just query `CommitSyncConfig` from `LiveCommitSyncConfig` in `new_test_common` and avoid having two args. I was too lazy to do this, lmk if you feel strongly about it.
Reviewed By: StanislavGlebik
Differential Revision: D22443623
fbshipit-source-id: 0d6bbda2223e77b89cc59863b703db5081bcd601
2020-07-21 19:07:15 +03:00
|
|
|
cached_config = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
2020-06-05 16:21:37 +03:00
|
|
|
cloned = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
|
|
fbinit = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
|
|
stats = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
|
|
anyhow = "1.0"
|
|
|
|
async-trait = "0.1.29"
|
|
|
|
bytes = { version = "0.5", features = ["serde"] }
|
|
|
|
chrono = { version = "0.4", features = ["serde"] }
|
2020-07-07 06:47:39 +03:00
|
|
|
futures = { version = "0.3.5", features = ["async-await", "compat"] }
|
2020-06-05 16:21:37 +03:00
|
|
|
futures-old = { package = "futures", version = "0.1" }
|
|
|
|
itertools = "0.8"
|
|
|
|
maplit = "1.0"
|
|
|
|
slog = { version = "2.5", features = ["max_level_debug"] }
|
|
|
|
thiserror = "1.0"
|
|
|
|
|
|
|
|
[dev-dependencies]
|
|
|
|
cross_repo_sync_test_utils = { path = "../commit_rewriting/cross_repo_sync/test_utils" }
|
|
|
|
fixtures = { path = "../tests/fixtures" }
|
|
|
|
tests_utils = { path = "../tests/utils" }
|
|
|
|
assert_matches = "1.3"
|
2020-08-25 19:10:07 +03:00
|
|
|
regex = "1.3.7"
|
2020-06-05 16:21:37 +03:00
|
|
|
tokio-compat = "0.1"
|