fix: error on flow/app folder suffix format mismatch during sync push/pull (#8775)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-04-09 13:30:59 -04:00
committed by GitHub
parent c57c769dea
commit 1deb31f1e0
3 changed files with 72 additions and 1 deletions

View File

@@ -41,6 +41,7 @@ import {
isFlowInlineScriptPath,
isRawAppBackendPath,
getModuleFolderSuffix,
hasWrongFormatSuffix,
} from "../src/utils/resource_folders.ts";
import { newPathAssigner } from "../windmill-utils-internal/src/path-utils/path-assigner.ts";
@@ -1240,6 +1241,32 @@ test("setNonDottedPaths and getNonDottedPaths work correctly", () => {
expect(getNonDottedPaths()).toEqual(false);
});
test("hasWrongFormatSuffix detects mismatched folder suffixes", () => {
// In dotted mode (default), non-dotted dirs are wrong
setNonDottedPaths(false);
expect(hasWrongFormatSuffix("my_flow__flow")).toEqual("flow");
expect(hasWrongFormatSuffix("my_app__app")).toEqual("app");
expect(hasWrongFormatSuffix("my_raw_app__raw_app")).toEqual("raw_app");
// Correct format should return null
expect(hasWrongFormatSuffix("my_flow.flow")).toBeNull();
expect(hasWrongFormatSuffix("my_app.app")).toBeNull();
expect(hasWrongFormatSuffix("my_raw_app.raw_app")).toBeNull();
// Non-resource dirs return null
expect(hasWrongFormatSuffix("some_folder")).toBeNull();
expect(hasWrongFormatSuffix("node_modules")).toBeNull();
// In non-dotted mode, dotted dirs are wrong
setNonDottedPaths(true);
expect(hasWrongFormatSuffix("my_flow.flow")).toEqual("flow");
expect(hasWrongFormatSuffix("my_app.app")).toEqual("app");
expect(hasWrongFormatSuffix("my_raw_app.raw_app")).toEqual("raw_app");
// Correct format should return null
expect(hasWrongFormatSuffix("my_flow__flow")).toBeNull();
expect(hasWrongFormatSuffix("my_app__app")).toBeNull();
expect(hasWrongFormatSuffix("my_raw_app__raw_app")).toBeNull();
setNonDottedPaths(false); // Reset
});
// =============================================================================
// nonDottedPaths Fixture Functions
// =============================================================================