forked from kemitix/git-next
refactor: rename forge as forge_config
This commit is contained in:
parent
17f5f62e61
commit
3dfbd44b37
2 changed files with 13 additions and 14 deletions
|
@ -335,7 +335,7 @@ impl RepoDetails {
|
||||||
name: &RepoAlias,
|
name: &RepoAlias,
|
||||||
server_repo_config: &ServerRepoConfig,
|
server_repo_config: &ServerRepoConfig,
|
||||||
forge_name: &ForgeName,
|
forge_name: &ForgeName,
|
||||||
forge: &ForgeConfig,
|
forge_config: &ForgeConfig,
|
||||||
server_storage: &ServerStorage,
|
server_storage: &ServerStorage,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
@ -351,10 +351,10 @@ impl RepoDetails {
|
||||||
),
|
),
|
||||||
forge: ForgeDetails {
|
forge: ForgeDetails {
|
||||||
forge_name: forge_name.clone(),
|
forge_name: forge_name.clone(),
|
||||||
forge_type: forge.forge_type.clone(),
|
forge_type: forge_config.forge_type.clone(),
|
||||||
hostname: forge.hostname(),
|
hostname: forge_config.hostname(),
|
||||||
user: forge.user(),
|
user: forge_config.user(),
|
||||||
token: forge.token(),
|
token: forge_config.token(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,8 +59,8 @@ pub async fn start(fs: FileSystem, net: Network) {
|
||||||
|
|
||||||
server_config
|
server_config
|
||||||
.forges()
|
.forges()
|
||||||
.flat_map(|(forge_name, forge)| {
|
.flat_map(|(forge_name, forge_config)| {
|
||||||
create_forge_repos(forge, forge_name, server_storage, webhook, &net)
|
create_forge_repos(forge_config, forge_name, server_storage, webhook, &net)
|
||||||
})
|
})
|
||||||
.map(start_actor)
|
.map(start_actor)
|
||||||
.map(|(alias, addr)| webhook::AddWebhookRecipient(alias, addr.recipient()))
|
.map(|(alias, addr)| webhook::AddWebhookRecipient(alias, addr.recipient()))
|
||||||
|
@ -72,21 +72,20 @@ pub async fn start(fs: FileSystem, net: Network) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_forge_repos(
|
fn create_forge_repos(
|
||||||
forge: &ForgeConfig,
|
forge_config: &ForgeConfig,
|
||||||
forge_name: ForgeName,
|
forge_name: ForgeName,
|
||||||
server_storage: &ServerStorage,
|
server_storage: &ServerStorage,
|
||||||
webhook: &Webhook,
|
webhook: &Webhook,
|
||||||
net: &Network,
|
net: &Network,
|
||||||
) -> Vec<(ForgeName, RepoAlias, RepoActor)> {
|
) -> Vec<(ForgeName, RepoAlias, RepoActor)> {
|
||||||
let forge = forge.clone();
|
let span = tracing::info_span!("Forge", %forge_name, %forge_config);
|
||||||
let span = tracing::info_span!("Forge", %forge_name, %forge);
|
|
||||||
let _guard = span.enter();
|
let _guard = span.enter();
|
||||||
info!("Creating Forge");
|
info!("Creating Forge");
|
||||||
forge
|
forge_config
|
||||||
.repos()
|
.repos()
|
||||||
.map(create_actor(
|
.map(create_actor(
|
||||||
forge_name,
|
forge_name,
|
||||||
forge.clone(),
|
forge_config.clone(),
|
||||||
server_storage,
|
server_storage,
|
||||||
webhook,
|
webhook,
|
||||||
net,
|
net,
|
||||||
|
@ -96,7 +95,7 @@ fn create_forge_repos(
|
||||||
|
|
||||||
fn create_actor(
|
fn create_actor(
|
||||||
forge_name: ForgeName,
|
forge_name: ForgeName,
|
||||||
forge: config::ForgeConfig,
|
forge_config: config::ForgeConfig,
|
||||||
server_storage: &ServerStorage,
|
server_storage: &ServerStorage,
|
||||||
webhook: &Webhook,
|
webhook: &Webhook,
|
||||||
net: &Network,
|
net: &Network,
|
||||||
|
@ -113,7 +112,7 @@ fn create_actor(
|
||||||
&repo_name,
|
&repo_name,
|
||||||
server_repo_config,
|
server_repo_config,
|
||||||
&forge_name,
|
&forge_name,
|
||||||
&forge,
|
&forge_config,
|
||||||
&server_storage,
|
&server_storage,
|
||||||
),
|
),
|
||||||
webhook.clone(),
|
webhook.clone(),
|
||||||
|
|
Loading…
Reference in a new issue