From abc2439ec49d2ec3048aa010441c33a0a3d74cd4 Mon Sep 17 00:00:00 2001 From: Lucas Manchine Date: Fri, 28 Aug 2026 14:43:18 -0300 Subject: [PATCH 1/4] fix: apply watch path negations as a pattern set --- .../__test__/deploy/should-deploy.test.ts | 24 +++++++++++++++++++ .../src/utils/watch-paths/should-deploy.ts | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/__test__/deploy/should-deploy.test.ts b/apps/dokploy/__test__/deploy/should-deploy.test.ts index d9a1c0244..8b0da4428 100644 --- a/apps/dokploy/__test__/deploy/should-deploy.test.ts +++ b/apps/dokploy/__test__/deploy/should-deploy.test.ts @@ -16,6 +16,30 @@ describe("shouldDeploy", () => { expect(shouldDeploy(["src/**"], ["docs/readme.md"])).toBe(false); }); + it("should apply multiple negated watch paths as one pattern set", () => { + const watchPaths = ["!CHANGELOG.md", "!VERSION", "!tests/**"]; + + expect(shouldDeploy(watchPaths, ["CHANGELOG.md"])).toBe(false); + expect(shouldDeploy(watchPaths, ["VERSION"])).toBe(false); + expect(shouldDeploy(watchPaths, ["tests/unit/example.test.ts"])).toBe( + false, + ); + }); + + it("should deploy when a changed file remains after exclusions", () => { + const watchPaths = ["!CHANGELOG.md", "!VERSION", "!tests/**"]; + + expect(shouldDeploy(watchPaths, ["VERSION", "src/index.ts"])).toBe(true); + }); + + it("should combine positive and negated watch paths", () => { + const watchPaths = ["src/**", "!src/**/*.test.ts"]; + + expect(shouldDeploy(watchPaths, ["src/index.ts"])).toBe(true); + expect(shouldDeploy(watchPaths, ["src/index.test.ts"])).toBe(false); + expect(shouldDeploy(watchPaths, ["docs/readme.md"])).toBe(false); + }); + it("should not throw when modified files contain non-string values", () => { expect(() => shouldDeploy(["src/**"], ["src/index.ts", undefined, null] as any), diff --git a/packages/server/src/utils/watch-paths/should-deploy.ts b/packages/server/src/utils/watch-paths/should-deploy.ts index c3e7677fe..84e335c1a 100644 --- a/packages/server/src/utils/watch-paths/should-deploy.ts +++ b/packages/server/src/utils/watch-paths/should-deploy.ts @@ -8,5 +8,5 @@ export const shouldDeploy = ( const files = (modifiedFiles ?? []).filter( (file): file is string => typeof file === "string", ); - return micromatch.some(files, watchPaths); + return micromatch(files, watchPaths).length > 0; }; From a66684a78453a5e0fb741dff383dee6b59c5b7a7 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2026 17:43:56 +0000 Subject: [PATCH 2/4] [autofix.ci] apply automated fixes --- .../dokploy/__test__/traefik/write-app-traefik-config.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts b/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts index 2f80e811b..47142f2f9 100644 --- a/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts +++ b/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts @@ -10,7 +10,9 @@ const mocks = vi.hoisted(() => ({ vi.mock("@dokploy/server/utils/process/execAsync", async (importOriginal) => { const actual = - await importOriginal(); + await importOriginal< + typeof import("@dokploy/server/utils/process/execAsync") + >(); return { ...actual, execAsyncRemote: mocks.execAsyncRemote, From bdf33750a3b84758f704105ade6bf9c3c4e5278d Mon Sep 17 00:00:00 2001 From: Lucas Manchine Date: Fri, 28 Aug 2026 14:46:36 -0300 Subject: [PATCH 3/4] Revert "[autofix.ci] apply automated fixes" This reverts commit a66684a78453a5e0fb741dff383dee6b59c5b7a7. --- .../dokploy/__test__/traefik/write-app-traefik-config.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts b/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts index 47142f2f9..2f80e811b 100644 --- a/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts +++ b/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts @@ -10,9 +10,7 @@ const mocks = vi.hoisted(() => ({ vi.mock("@dokploy/server/utils/process/execAsync", async (importOriginal) => { const actual = - await importOriginal< - typeof import("@dokploy/server/utils/process/execAsync") - >(); + await importOriginal(); return { ...actual, execAsyncRemote: mocks.execAsyncRemote, From 9d9b41c1e55ddeefe579fec777ed3e25e3aebdd6 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2026 17:47:28 +0000 Subject: [PATCH 4/4] [autofix.ci] apply automated fixes --- .../dokploy/__test__/traefik/write-app-traefik-config.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts b/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts index 2f80e811b..47142f2f9 100644 --- a/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts +++ b/apps/dokploy/__test__/traefik/write-app-traefik-config.test.ts @@ -10,7 +10,9 @@ const mocks = vi.hoisted(() => ({ vi.mock("@dokploy/server/utils/process/execAsync", async (importOriginal) => { const actual = - await importOriginal(); + await importOriginal< + typeof import("@dokploy/server/utils/process/execAsync") + >(); return { ...actual, execAsyncRemote: mocks.execAsyncRemote,