From 77aad42540bbffc444b60c4bcf512d2f611552ed Mon Sep 17 00:00:00 2001 From: centdix <40307056+centdix@users.noreply.github.com> Date: Wed, 18 Feb 2026 15:50:27 +0100 Subject: [PATCH] fix: handle raw app folder deletion in sync push without yaml parse error (#7994) * fix: handle raw app folder deletion in sync push without yaml parse error Co-Authored-By: Claude Opus 4.5 * chore: update ee-repo-ref to 592848d59ca2304926fb2bd85d000668a7f46a77 This commit updates the EE repository reference after PR #420 was merged in windmill-ee-private. Previous ee-repo-ref: 931813b75b8260faa13ddc07f36a11607b7e3bf6 New ee-repo-ref: 592848d59ca2304926fb2bd85d000668a7f46a77 Automated by sync-ee-ref workflow. --------- Co-authored-by: Claude Opus 4.5 Co-authored-by: windmill-internal-app[bot] --- backend/ee-repo-ref.txt | 2 +- cli/src/commands/sync/sync.ts | 47 ++++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 2c3170d5f3..79d825bcf3 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -0eccae6a9a9ecde09816cd4d88ca9ab305659e4c +0eccae6a9a9ecde09816cd4d88ca9ab305659e4c \ No newline at end of file diff --git a/cli/src/commands/sync/sync.ts b/cli/src/commands/sync/sync.ts index b7ceb86f75..b1b6142ce5 100644 --- a/cli/src/commands/sync/sync.ts +++ b/cli/src/commands/sync/sync.ts @@ -88,6 +88,7 @@ import { isAppPath, isRawAppPath, extractFolderPath, + extractResourceName, isFlowMetadataFile, isAppMetadataFile, isRawAppMetadataFile, @@ -2730,18 +2731,40 @@ export async function push( path: removeSuffix(target, getDeleteSuffix("raw_app", "json")), }); } else { - // For individual file deletions within a raw app, - // re-push the entire raw app so the backend gets the updated file list - // (the deleted file won't be included in the push) - await pushObj( - workspaceId, - target, - undefined, - undefined, - opts.plainSecrets ?? false, - alreadySynced, - opts.message, - ); + const rawAppFolder = extractFolderPath(target, "raw_app"); + let folderExists = false; + if (rawAppFolder) { + try { + await Deno.stat(rawAppFolder); + folderExists = true; + } catch { + // folder doesn't exist + } + } + if (folderExists) { + // For individual file deletions within a raw app, + // re-push the entire raw app so the backend gets the updated file list + // (the deleted file won't be included in the push) + await pushObj( + workspaceId, + target, + undefined, + undefined, + opts.plainSecrets ?? false, + alreadySynced, + opts.message, + ); + } else { + // The entire raw app folder was deleted locally, + // delete the raw app on the server + const remotePath = extractResourceName(target, "raw_app"); + if (remotePath) { + await wmill.deleteApp({ + workspace: workspaceId, + path: remotePath, + }); + } + } } break; case "schedule":