From 8ef7d3e4c38fbf92ff9b3630fe79017e95a496ec Mon Sep 17 00:00:00 2001 From: nathan Date: Sun, 28 Jul 2024 13:46:30 +0800 Subject: [PATCH] ci: update ci test --- .github/workflows/macos_test.yaml | 5 +++-- appflowy-plugin/src/core/plugin.rs | 13 ++++--------- appflowy-plugin/src/core/rpc_object.rs | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/macos_test.yaml b/.github/workflows/macos_test.yaml index 12764ce..f8ebda6 100644 --- a/.github/workflows/macos_test.yaml +++ b/.github/workflows/macos_test.yaml @@ -28,14 +28,15 @@ jobs: aws s3 cp s3://appflowy-local-ai-test/macos-latest/AppFlowyLLM_debug.zip AppFlowyLLM_macos-latest_debug.zip unzip AppFlowyLLM_macos-latest_debug.zip -d AppFlowyLLM cd AppFlowyLLM + ls shell: bash - name: Prepare env run: | ls ABS_PATH=$(pwd) - chat_bin_path=$ABS_PATH/AppFlowyLLM/appflowy_ai_plugin - embedding_bin_path=$ABS_PATH/AppFlowyLLM/appflowy_embedding_plugin + chat_bin_path=$ABS_PATH/AppFlowyLLM/AppFlowyLLM.app/Contents/MacOS/appflowy_ai_plugin + embedding_bin_path=$ABS_PATH/AppFlowyLLM/AppFlowyLLM.app/Contents/MacOS/appflowy_embedding_plugin cp dev.env .env sed -i '' 's|RUST_LOG=.*|RUST_LOG=trace|' .env diff --git a/appflowy-plugin/src/core/plugin.rs b/appflowy-plugin/src/core/plugin.rs index d1802a3..eee520b 100644 --- a/appflowy-plugin/src/core/plugin.rs +++ b/appflowy-plugin/src/core/plugin.rs @@ -202,20 +202,14 @@ pub(crate) async fn start_plugin_process( running_state: RunningStateSender, ) -> Result<(), anyhow::Error> { trace!("start plugin process: {:?}, {:?}", id, plugin_info); - #[cfg(unix)] - { - trace!("ensure executable: {:?}", plugin_info.exec_path); - ensure_executable(&plugin_info.exec_path).await?; - } - let (tx, ret) = tokio::sync::oneshot::channel(); let spawn_result = thread::Builder::new() .name(format!("<{}> core host thread", &plugin_info.name)) .spawn(move || { info!("Load {} plugin", &plugin_info.name); - #[cfg(target_os = "macos")] - handle_macos_security_check(&plugin_info); + // #[cfg(target_os = "macos")] + // handle_macos_security_check(&plugin_info); let child = std::process::Command::new(&plugin_info.exec_path) .stdin(Stdio::piped()) @@ -275,6 +269,7 @@ pub(crate) async fn start_plugin_process( Ok(()) } +#[allow(dead_code)] #[cfg(unix)] async fn ensure_executable(exec_path: &std::path::Path) -> Result<(), anyhow::Error> { use std::os::unix::fs::PermissionsExt; @@ -286,13 +281,13 @@ async fn ensure_executable(exec_path: &std::path::Path) -> Result<(), anyhow::Er Ok(()) } +#[allow(dead_code)] #[cfg(target_os = "macos")] pub fn handle_macos_security_check(plugin_info: &PluginInfo) { trace!("macos security check: {:?}", plugin_info.exec_path); let mut open_manually = false; match xattr::list(&plugin_info.exec_path) { Ok(list) => { - let mut has_quarantine = false; let mut has_lastuseddate = false; // https://eclecticlight.co/2023/03/16/what-is-macos-ventura-doing-tracking-provenance/ diff --git a/appflowy-plugin/src/core/rpc_object.rs b/appflowy-plugin/src/core/rpc_object.rs index 7f4e468..1ac64c1 100644 --- a/appflowy-plugin/src/core/rpc_object.rs +++ b/appflowy-plugin/src/core/rpc_object.rs @@ -46,7 +46,7 @@ impl RpcObject { /// - `Ok(Ok(ResponsePayload::Streaming(data)))`: If the response contains streaming data of type "streaming". /// - `Ok(Ok(ResponsePayload::StreamEnd(json!({}))))`: If the response contains streaming data of type "end". /// - `Err(String)`: If any validation or parsing errors occur. - ///. + /// pub fn into_response(mut self) -> Result { // Ensure 'id' field is present self