refactor: server no longer depends directly on git crate
All checks were successful
Rust / build (push) Successful in 1m10s
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
ci/woodpecker/cron/cron-docker-builder Pipeline was successful
ci/woodpecker/cron/push-next Pipeline was successful
ci/woodpecker/cron/tag-created Pipeline was successful

This commit is contained in:
Paul Campbell 2024-07-03 07:42:11 +01:00
parent 3dec12de20
commit 12849d5a69
5 changed files with 7 additions and 7 deletions

View file

@ -409,7 +409,6 @@ stateDiagram-v2
repo_actor --> actor_macros
server --> config
server --> git
server --> file_watcher_actor
server --> server_actor

View file

@ -29,7 +29,7 @@ enum Server {
fn main() {
let fs = fs::new(PathBuf::default());
let net = Network::new_real();
let repo = git_next_server::repo();
let repository_factory = git_next_server::repository_factory();
let commands = Commands::parse();
match commands.command {
@ -42,7 +42,7 @@ fn main() {
}
Server::Start => {
let sleep_duration = std::time::Duration::from_secs(10);
git_next_server::start(fs, net, repo, sleep_duration);
git_next_server::start(fs, net, repository_factory, sleep_duration);
}
},
}

View file

@ -5,7 +5,7 @@ use git_next_config as config;
use git_next_config::server::{ServerConfig, ServerStorage, Webhook};
use git_next_config::{ForgeAlias, ForgeConfig, GitDir, RepoAlias, ServerRepoConfig};
use git_next_file_watcher_actor::FileUpdated;
use git_next_git::{repository::RepositoryFactory, Generation, RepoDetails};
use git_next_git::{Generation, RepoDetails};
use git_next_repo_actor::{messages::CloneRepo, RepoActor};
use git_next_webhook_actor as webhook;
use kxio::{fs::FileSystem, network::Network};
@ -13,6 +13,9 @@ use std::path::PathBuf;
use tracing::{error, info, warn};
use webhook::{AddWebhookRecipient, ShutdownWebhook, WebhookActor, WebhookRouter};
pub use git::repository::{real as repository_factory, RepositoryFactory};
use git_next_git as git;
message!(ReceiveServerConfig: ServerConfig: "Notification of newly loaded server configuration.
This message will prompt the `git-next` server to stop and restart all repo-actors.

View file

@ -5,7 +5,6 @@ edition = { workspace = true }
[dependencies]
git-next-config = { workspace = true }
git-next-git = { workspace = true }
git-next-file-watcher-actor = { workspace = true }
git-next-server-actor = { workspace = true }

View file

@ -1,14 +1,13 @@
//
use actix::prelude::*;
use git_next_file_watcher_actor::{FileUpdated, FileWatcher};
use git_next_git::repository::RepositoryFactory;
use git_next_server_actor::Server;
use kxio::{fs::FileSystem, network::Network};
use std::path::PathBuf;
use tracing::{error, info};
use tracing_subscriber::EnvFilter;
pub use git_next_git::repository::real as repo;
pub use git_next_server_actor::{repository_factory, RepositoryFactory};
pub fn init(fs: FileSystem) {
let file_name = "git-next-server.toml";