From 0776de6b2173075f533fd59a49efb111000da5df Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 28 Feb 2026 07:39:27 +0000 Subject: [PATCH] fix: copy deps and remove user auto-add on workspace fork (#8142) * fix: copy deps and remove user auto-add on workspace fork Clone workspace_dependencies to forked workspaces and remove automatic workspace_invite creation for parent workspace users. Co-Authored-By: Claude Opus 4.6 * chore: update sqlx offline cache Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- ...f5928a3c7eba2983431844581fd2393312a2e.json | 15 --------------- .../windmill-api-workspaces/src/workspaces.rs | 19 +++---------------- 2 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 backend/.sqlx/query-cd399a3a797d1733fb9071ebca3f5928a3c7eba2983431844581fd2393312a2e.json diff --git a/backend/.sqlx/query-cd399a3a797d1733fb9071ebca3f5928a3c7eba2983431844581fd2393312a2e.json b/backend/.sqlx/query-cd399a3a797d1733fb9071ebca3f5928a3c7eba2983431844581fd2393312a2e.json deleted file mode 100644 index 0b33e98f7c..0000000000 --- a/backend/.sqlx/query-cd399a3a797d1733fb9071ebca3f5928a3c7eba2983431844581fd2393312a2e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO workspace_invite (workspace_id, email, is_admin, operator)\n SELECT $1, email, is_admin, operator\n FROM usr\n WHERE workspace_id = $2", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Text" - ] - }, - "nullable": [] - }, - "hash": "cd399a3a797d1733fb9071ebca3f5928a3c7eba2983431844581fd2393312a2e" -} diff --git a/backend/windmill-api-workspaces/src/workspaces.rs b/backend/windmill-api-workspaces/src/workspaces.rs index 9b135aebc3..8f3311978a 100644 --- a/backend/windmill-api-workspaces/src/workspaces.rs +++ b/backend/windmill-api-workspaces/src/workspaces.rs @@ -2863,9 +2863,8 @@ async fn clone_workspace_data( // Clone workspace runnable dependencies and dependency map clone_workspace_runnable_dependencies(tx, source_workspace_id, target_workspace_id).await?; - // TODO: Enable when git sync is implemented for workspace dependencies. - // // Clone workspace dependencies - // clone_workspace_dependencies(tx, source_workspace_id, target_workspace_id).await?; + // Clone workspace dependencies + clone_workspace_dependencies(tx, source_workspace_id, target_workspace_id).await?; Ok(()) } @@ -3362,13 +3361,12 @@ async fn clone_workspace_runnable_dependencies( Ok(()) } -#[allow(dead_code)] async fn clone_workspace_dependencies( tx: &mut Transaction<'_, Postgres>, source_workspace_id: &str, target_workspace_id: &str, ) -> Result<()> { - // Clone workspace_runnable_dependencies + // Clone workspace_dependencies sqlx::query!( "INSERT INTO workspace_dependencies (workspace_id, language, name, description, content, archived, created_at) SELECT $1, language, name, description, content, archived, created_at @@ -3502,17 +3500,6 @@ async fn create_workspace_fork( // Clone all data from the parent workspace using Rust implementation clone_workspace_data(&mut tx, &parent_workspace_id, &forked_id).await?; - sqlx::query!( - "INSERT INTO workspace_invite (workspace_id, email, is_admin, operator) - SELECT $1, email, is_admin, operator - FROM usr - WHERE workspace_id = $2", - &forked_id, - &parent_workspace_id - ) - .execute(&mut *tx) - .await?; - audit_log( &mut *tx, &authed,