feat(server): add stub for branch::advance_main
All checks were successful
All checks were successful
This commit is contained in:
parent
0b5c91fedb
commit
7ed30fc382
1 changed files with 28 additions and 10 deletions
|
@ -1,18 +1,21 @@
|
||||||
|
use actix::prelude::*;
|
||||||
|
|
||||||
|
use kxio::network;
|
||||||
use tracing::{error, warn};
|
use tracing::{error, warn};
|
||||||
|
|
||||||
use crate::server::forge;
|
use crate::server::{config, forge};
|
||||||
|
|
||||||
use super::StartMonitoring;
|
use super::{RepoActor, StartMonitoring, StartRepo};
|
||||||
|
|
||||||
#[tracing::instrument(fields(forge_name = %repo_details.forge.name, repo_name = %repo_details.name))]
|
#[tracing::instrument(fields(forge_name = %repo_details.forge.name, repo_name = %repo_details.name))]
|
||||||
pub async fn validate_positions(
|
pub async fn validate_positions(
|
||||||
repo_details: crate::server::config::RepoDetails,
|
repo_details: config::RepoDetails,
|
||||||
config: crate::server::config::RepoConfig,
|
config: config::RepoConfig,
|
||||||
addr: actix::prelude::Addr<super::RepoActor>,
|
addr: Addr<RepoActor>,
|
||||||
net: kxio::network::Network,
|
net: network::Network,
|
||||||
) {
|
) {
|
||||||
let commit_histories = match repo_details.forge.forge_type {
|
let commit_histories = match repo_details.forge.forge_type {
|
||||||
crate::server::config::ForgeType::ForgeJo => {
|
config::ForgeType::ForgeJo => {
|
||||||
forge::forgejo::get_commit_histories(&repo_details, &config, &net).await
|
forge::forgejo::get_commit_histories(&repo_details, &config, &net).await
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -67,11 +70,26 @@ pub async fn validate_positions(
|
||||||
addr.do_send(StartMonitoring { main, next, dev });
|
addr.do_send(StartMonitoring { main, next, dev });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// advance next to the next commit towards the head of the dev branch
|
||||||
|
#[allow(dead_code)]
|
||||||
pub async fn advance_next(
|
pub async fn advance_next(
|
||||||
_next: forge::Commit,
|
_next: forge::Commit,
|
||||||
_repo_details: crate::server::config::RepoDetails,
|
_repo_details: config::RepoDetails,
|
||||||
_addr: actix::prelude::Addr<super::RepoActor>,
|
addr: Addr<RepoActor>,
|
||||||
_net: kxio::network::Network,
|
_net: network::Network,
|
||||||
) {
|
) {
|
||||||
// TODO: (#14) advance next one commit towards dev
|
// TODO: (#14) advance next one commit towards dev
|
||||||
|
addr.do_send(StartRepo);
|
||||||
|
}
|
||||||
|
|
||||||
|
// advance main branch to the commit 'next'
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub async fn advance_main(
|
||||||
|
_next: forge::Commit,
|
||||||
|
_repo_details: config::RepoDetails,
|
||||||
|
addr: Addr<RepoActor>,
|
||||||
|
_net: network::Network,
|
||||||
|
) {
|
||||||
|
// TODO: (#19) advance main to next
|
||||||
|
addr.do_send(StartRepo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue