Add Mononoke Git Server as a sharded service

Summary: The fbcode counterpart of D55313321. This diff needs to land before the configerator one due to config hot reloading

Reviewed By: clara-9

Differential Revision: D55314515

fbshipit-source-id: 78b3398b60cdbc00a8ed89cc966143533778aa11
This commit is contained in:
Rajiv Sharma 2024-03-25 07:35:57 -07:00 committed by Facebook GitHub Bot
parent b07b7427ea
commit 4e03ade4d0
4 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
// @generated SignedSource<<a7929316d67bbc593552c40f4c75a3a7>>
// @generated SignedSource<<cf311b87e29099630c17f1d3abf08633>>
// DO NOT EDIT THIS FILE MANUALLY!
// This file is a mechanical copy of the version in the configerator repo. To
// modify it, edit the copy in the configerator repo instead and copy it over by
@ -237,6 +237,7 @@ enum RawShardedService {
DERIVED_DATA_TAILER = 12,
ALIAS_VERIFY = 13,
DRAFT_COMMIT_DELETION = 14,
MONONOKE_GIT_SERVER = 15,
}
@rust.Exhaustive

View File

@ -46,6 +46,7 @@ use gotham_ext::middleware::TlsSessionDataMiddleware;
use gotham_ext::serve;
use http::HeaderValue;
use metaconfig_types::RepoConfig;
use metaconfig_types::ShardedService;
use mononoke_app::args::RepoFilterAppExtension;
use mononoke_app::args::ShutdownTimeoutArgs;
use mononoke_app::args::TLSArgs;
@ -146,7 +147,9 @@ pub struct GitRepos {
#[allow(dead_code)]
impl GitRepos {
pub(crate) async fn new(app: &MononokeApp) -> Result<Self> {
let repos_mgr = app.open_managed_repos(None).await?;
let repos_mgr = app
.open_managed_repos(Some(ShardedService::MononokeGitServer))
.await?;
let repos = repos_mgr.repos().clone();
Ok(Self { repos })
}

View File

@ -754,6 +754,7 @@ impl Convert for RawShardedService {
RawShardedService::DERIVED_DATA_TAILER => ShardedService::DerivedDataTailer,
RawShardedService::ALIAS_VERIFY => ShardedService::AliasVerify,
RawShardedService::DRAFT_COMMIT_DELETION => ShardedService::DraftCommitDeletion,
RawShardedService::MONONOKE_GIT_SERVER => ShardedService::MononokeGitServer,
v => return Err(anyhow!("Invalid value {} for enum ShardedService", v)),
};
Ok(service)

View File

@ -274,6 +274,8 @@ pub enum ShardedService {
AliasVerify,
/// Draft Commit Deletion,
DraftCommitDeletion,
/// Mononoke Git Server
MononokeGitServer,
}
/// Indicates types of commit hashes used in a repo context.