From 9e37c073c2564e0d2c8de7068beb9707cd7f6a94 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 23 May 2024 17:56:47 +0100 Subject: [PATCH] refactor(repo_actor): consitent use of config crate --- crates/repo-actor/src/branch.rs | 6 +++--- crates/repo-actor/src/lib.rs | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/repo-actor/src/branch.rs b/crates/repo-actor/src/branch.rs index 21f80ab8..5939fe0e 100644 --- a/crates/repo-actor/src/branch.rs +++ b/crates/repo-actor/src/branch.rs @@ -2,7 +2,7 @@ use std::time::Duration; use actix::prelude::*; -use git_next_config::RepoConfig; +use git_next_config as config; use git_next_forge as forge; use git_next_git as git; use tracing::{info, warn}; @@ -14,7 +14,7 @@ use crate::{MessageToken, ValidateRepo}; pub async fn advance_next( next: git::Commit, dev_commit_history: Vec, - repo_config: RepoConfig, + repo_config: config::RepoConfig, forge: forge::Forge, repository: git::OpenRepository, addr: Addr, @@ -78,7 +78,7 @@ pub fn find_next_commit_on_dev( #[tracing::instrument(fields(next), skip_all)] pub async fn advance_main( next: git::Commit, - repo_config: &RepoConfig, + repo_config: &config::RepoConfig, forge: &forge::Forge, repository: &git::OpenRepository, ) { diff --git a/crates/repo-actor/src/lib.rs b/crates/repo-actor/src/lib.rs index 4e8577a0..79f889bc 100644 --- a/crates/repo-actor/src/lib.rs +++ b/crates/repo-actor/src/lib.rs @@ -11,6 +11,7 @@ use std::time::Duration; use actix::prelude::*; use crate as repo_actor; +use git_next_config as config; use git_next_forge as forge; use git_next_git as git; @@ -23,7 +24,7 @@ pub struct RepoActor { generation: git::Generation, message_token: MessageToken, details: git::RepoDetails, - webhook: git_next_config::server::Webhook, + webhook: config::server::Webhook, webhook_id: Option, // INFO: if [None] then no webhook is configured webhook_auth: Option, // INFO: if [None] then no webhook is configured last_main_commit: Option, @@ -36,17 +37,17 @@ pub struct RepoActor { impl RepoActor { pub fn new( details: git::RepoDetails, - webhook: git_next_config::server::Webhook, + webhook: config::server::Webhook, generation: git::Generation, net: Network, repo: git::Repository, ) -> Self { let forge = match details.forge.forge_type() { #[cfg(feature = "forgejo")] - git_next_config::ForgeType::ForgeJo => { + config::ForgeType::ForgeJo => { forge::Forge::new_forgejo(details.clone(), net.clone(), repo) } - git_next_config::ForgeType::MockForge => forge::Forge::new_mock(), + config::ForgeType::MockForge => forge::Forge::new_mock(), }; debug!(?forge, "new"); Self {