From aa3a3543045f1e07762a856eedb9983cf027dcc3 Mon Sep 17 00:00:00 2001 From: Kai Jellinghaus Date: Sun, 4 Dec 2022 13:24:31 +0100 Subject: [PATCH] fix(cli): Fix cli pull push (#985) * Fix workspace tar * Ignore dotfolders --- backend/windmill-api/src/workspaces.rs | 15 ++++++++++----- backend/windmill-common/src/variables.rs | 1 - cli/push.ts | 2 ++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/backend/windmill-api/src/workspaces.rs b/backend/windmill-api/src/workspaces.rs index 4a204aaa74..094128f604 100644 --- a/backend/windmill-api/src/workspaces.rs +++ b/backend/windmill-api/src/workspaces.rs @@ -587,7 +587,7 @@ async fn tarball_workspace( let metadata_str = serde_json::to_string_pretty(&metadata).unwrap(); write_to_archive( metadata_str, - format!("scripts/{}.json", script.path), + format!("scripts/{}.script.json", script.path), &mut a, ) .await?; @@ -607,7 +607,7 @@ async fn tarball_workspace( let resource_str = serde_json::to_string_pretty(&resource).unwrap(); write_to_archive( resource_str, - format!("resources/{}.json", resource.path), + format!("resources/{}.resource.json", resource.path), &mut a, ) .await?; @@ -627,7 +627,7 @@ async fn tarball_workspace( let resource_str = serde_json::to_string_pretty(&resource_type).unwrap(); write_to_archive( resource_str, - format!("resource_types/{}.json", resource_type.name), + format!("resource_types/{}.resource-type.json", resource_type.name), &mut a, ) .await?; @@ -644,7 +644,7 @@ async fn tarball_workspace( for flow in flows { let flow_str = serde_json::to_string_pretty(&flow).unwrap(); - write_to_archive(flow_str, format!("flows/{}.json", flow.path), &mut a).await?; + write_to_archive(flow_str, format!("flows/{}.flow.json", flow.path), &mut a).await?; } } @@ -658,7 +658,12 @@ async fn tarball_workspace( for var in variables { let flow_str = serde_json::to_string_pretty(&var).unwrap(); - write_to_archive(flow_str, format!("variables/{}.json", var.path), &mut a).await?; + write_to_archive( + flow_str, + format!("variables/{}.variable.json", var.path), + &mut a, + ) + .await?; } } a.into_inner().await?; diff --git a/backend/windmill-common/src/variables.rs b/backend/windmill-common/src/variables.rs index b320b3814f..653615149f 100644 --- a/backend/windmill-common/src/variables.rs +++ b/backend/windmill-common/src/variables.rs @@ -46,7 +46,6 @@ pub struct ExportableListableVariable { pub account: Option, pub is_oauth: Option, pub is_expired: Option, - pub is_linked: Option, } #[derive(Deserialize)] diff --git a/cli/push.ts b/cli/push.ts index d1aa9e0939..371bc95593 100644 --- a/cli/push.ts +++ b/cli/push.ts @@ -17,12 +17,14 @@ type Candidate = { }; async function findCandidateFiles(dir: string): Promise { const candidates: Candidate[] = []; + if (dir.startsWith(".")) return []; for await (const e of Deno.readDir(dir)) { if (e.isDirectory) { if (e.name == "u" || e.name == "g") { const newDir = dir + (dir.endsWith("/") ? "" : "/") + e.name; for await (const e2 of Deno.readDir(newDir)) { if (e2.isDirectory) { + if (e2.name.startsWith(".")) return []; const groupOrUserName = e2.name; const stack: string[] = []; stack.push(newDir + "/" + groupOrUserName + "/");