diff --git a/.gitignore b/.gitignore index 2b3a40717..d49f1f2d9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,10 @@ dist .env .env.development .DS_Store +.idea /frontend/build /lib/ts_client/build creds.toml -.dev \ No newline at end of file +.dev diff --git a/bin/core/src/monitor/mod.rs b/bin/core/src/monitor/mod.rs index 00fcb139e..db9fc8052 100644 --- a/bin/core/src/monitor/mod.rs +++ b/bin/core/src/monitor/mod.rs @@ -8,6 +8,7 @@ use komodo_client::entities::{ network::NetworkListItem, volume::VolumeListItem, }, komodo_timestamp, + optional_string, server::{Server, ServerHealth, ServerState}, stack::{ComposeProject, StackService, StackState}, stats::SystemStats, @@ -264,6 +265,7 @@ pub async fn update_cache_for_server(server: &Server) { let (latest_hash, latest_message) = periphery .request(GetLatestCommit { name: repo.name.clone(), + path: optional_string(&repo.config.path), }) .await .map(|r| (r.hash, r.message)) diff --git a/bin/periphery/src/api/git.rs b/bin/periphery/src/api/git.rs index 50fab64c6..023a2d45a 100644 --- a/bin/periphery/src/api/git.rs +++ b/bin/periphery/src/api/git.rs @@ -1,3 +1,4 @@ +use std::path::PathBuf; use anyhow::{anyhow, Context}; use git::GitRes; use komodo_client::entities::{update::Log, CloneArgs, LatestCommit}; @@ -16,10 +17,13 @@ impl Resolve for GetLatestCommit { self, _: &super::Args, ) -> serror::Result { - let repo_path = periphery_config().repo_dir.join(self.name); + let repo_path = match self.path { + Some(p) => PathBuf::from(p), + None => periphery_config().repo_dir.join(self.name) + }; if !repo_path.is_dir() { return Err( - anyhow!("Repo path is not directory. is it cloned?").into(), + anyhow!("Repo path {} is not directory. is it cloned?", repo_path.display()).into(), ); } Ok(git::get_commit_hash_info(&repo_path).await?) diff --git a/client/periphery/rs/src/api/git.rs b/client/periphery/rs/src/api/git.rs index 6eb29f19e..5edccf31b 100644 --- a/client/periphery/rs/src/api/git.rs +++ b/client/periphery/rs/src/api/git.rs @@ -11,6 +11,7 @@ use serde::{Deserialize, Serialize}; #[error(serror::Error)] pub struct GetLatestCommit { pub name: String, + pub path: Option, } #[derive(Serialize, Deserialize, Debug, Clone, Resolve)]