Skip to content

Commit

Permalink
mononoke/hg_sync_job: make mononoke_hg_sync_job public (#37)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #37

mononoke_hg_sync_job is used in integration tests, make it public

Differential Revision: D22795881

fbshipit-source-id: a917eacb735f3f9b8391775a1f9df5c50a3f4d48
  • Loading branch information
lukaspiatkowski authored and facebook-github-bot committed Jul 29, 2020
1 parent 2431334 commit f83e607
Show file tree
Hide file tree
Showing 18 changed files with 3,337 additions and 37 deletions.
4 changes: 2 additions & 2 deletions eden/mononoke/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ mercurial_derived_data = { path = "derived_data/mercurial_derived_data" }
mercurial_revlog = { path = "mercurial/revlog" }
mercurial_types = { path = "mercurial/types" }
metaconfig_types = { path = "metaconfig/types" }
mononoke_hg_sync_job_helper_lib = { path = "mononoke_hg_sync_job_helper_lib" }
mononoke_hg_sync_job_helper_lib = { path = "mononoke_hg_sync_job" }
mononoke_types = { path = "mononoke_types" }
movers = { path = "commit_rewriting/movers" }
mutable_counters = { path = "mutable_counters" }
Expand Down Expand Up @@ -298,7 +298,7 @@ members = [
"microwave/builder",
"microwave/if",
"mononoke_api",
"mononoke_hg_sync_job_helper_lib",
"mononoke_hg_sync_job",
"mononoke_types",
"mononoke_types/if",
"mononoke_types/mocks",
Expand Down
13 changes: 11 additions & 2 deletions eden/mononoke/common/rust/sql_ext/src/oss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use crate::{facebook::*, *};

use anyhow::Error;
use fbinit::FacebookInit;
use futures_ext::BoxFuture;
use futures_ext::{BoxFuture, FutureExt};
use futures_old::future::ok;
use slog::Logger;

macro_rules! fb_unimplemented {
Expand Down Expand Up @@ -40,7 +41,15 @@ pub fn create_myrouter_connections(
fb_unimplemented!()
}

pub fn myrouter_ready(_: Option<String>, _: MysqlOptions, _: Logger) -> BoxFuture<(), Error> {
pub fn myrouter_ready(
db_addr_opt: Option<String>,
mysql_options: MysqlOptions,
_: Logger,
) -> BoxFuture<(), Error> {
if db_addr_opt.is_none() || mysql_options.myrouter_port.is_none() {
return ok(()).boxify();
};

fb_unimplemented!()
}

Expand Down
78 changes: 78 additions & 0 deletions eden/mononoke/mononoke_hg_sync_job/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[package]
name = "mononoke_hg_sync_job_helper_lib"
edition = "2018"
version = "0.1.0"
authors = ['Facebook']
license = "GPLv2+"
include = ["helper_lib/**/*.rs", "schemas/**/*.sql", "src/**/*.py", "src/**/*.rs"]

[lib]
path = "helper_lib/lib.rs"

[[bin]]
name = "mononoke_hg_sync_job"
path = "src/main.rs"

[dependencies]
blobrepo = { path = "../blobrepo" }
blobrepo_hg = { path = "../blobrepo/blobrepo_hg" }
blobstore = { path = "../blobstore" }
bookmarks = { path = "../bookmarks" }
cmdlib = { path = "../cmdlib" }
context = { path = "../server/context" }
dbbookmarks = { path = "../bookmarks/dbbookmarks" }
getbundle_response = { path = "../repo_client/getbundle_response" }
hgserver_config = { path = "../../../configerator/structs/scm/mononoke/hgserverconf" }
lfs_protocol = { path = "../lfs_protocol" }
mercurial_bundle_replay_data = { path = "../mercurial/bundle_replay_data" }
mercurial_bundles = { path = "../mercurial/bundles" }
mercurial_revlog = { path = "../mercurial/revlog" }
mercurial_types = { path = "../mercurial/types" }
metaconfig_types = { path = "../metaconfig/types" }
mononoke_types = { path = "../mononoke_types" }
mutable_counters = { path = "../mutable_counters" }
reachabilityindex = { path = "../reachabilityindex" }
repo_read_write_status = { path = "../repo_client/repo_read_write_status" }
revset = { path = "../revset" }
scuba_ext = { path = "../common/scuba_ext" }
skiplist = { path = "../reachabilityindex/skiplist" }
sql_construct = { path = "../common/sql_construct" }
sql_ext = { path = "../common/rust/sql_ext" }
cloned = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
failure_ext = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
fbinit = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
futures_ext = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
futures_stats = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
sql = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
anyhow = "1.0"
base64 = "0.11.0"
bytes = { version = "0.5", features = ["serde"] }
bytes-old = { package = "bytes", version = "0.4", features = ["serde"] }
clap = "2.33"
futures = { version = "0.3.5", features = ["async-await", "compat"] }
futures-old = { package = "futures", version = "0.1" }
http = "0.1"
hyper = "0.12"
hyper-openssl = "0.7"
itertools = "0.8"
maplit = "1.0"
parking_lot = "0.10.2"
regex = "1.3.7"
serde_json = "1.0"
slog = { version = "2.5", features = ["max_level_debug"] }
tempfile = "3.1"
thiserror = "1.0"
tokio = { version = "=0.2.13", features = ["full"] }
tokio-io = "0.1"
tokio-old = { package = "tokio", version = "0.1" }
tokio-process = "0.2"
tokio-timer = "0.2"

[dev-dependencies]
blobrepo_factory = { path = "../blobrepo/factory" }
bonsai_globalrev_mapping = { path = "../bonsai_globalrev_mapping" }
mercurial_types-mocks = { path = "../mercurial/types/mocks" }
mononoke_types-mocks = { path = "../mononoke_types/mocks" }
async_unit = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
assert_matches = "1.3"
tokio-compat = "0.1"
13 changes: 13 additions & 0 deletions eden/mononoke/mononoke_hg_sync_job/schemas/hgsql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/

CREATE TABLE `revision_references` (
`repo` VARBINARY(64) NOT NULL,
`namespace` VARBINARY(32) NOT NULL,
`name` VARBINARY(256) NULL,
`value` VARBINARY(40) NOT NULL
);
Loading

0 comments on commit f83e607

Please sign in to comment.