From 1b4489acac3b050f0a783548bacfc9bdf33ee593 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 23 Feb 2026 21:52:19 +0000 Subject: [PATCH] fix: address code review findings for fileset feature - Use sqlb.set() instead of set_str() for boolean is_fileset field to avoid quoting (SET is_fileset = TRUE not 'TRUE') - Add JSDoc comment to isFilesetResource explaining it matches children inside .fileset/ directories, not the directory itself - Update OpenAPI spec for file_resource_type_to_file_ext_map endpoint to document the new response schema with format_extension and is_fileset fields Co-Authored-By: Claude Opus 4.6 --- backend/windmill-api/openapi.yaml | 13 +++++++++++-- backend/windmill-store/src/resources.rs | 2 +- cli/src/utils/utils.ts | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 31e85cd25d..46131043d5 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -5244,10 +5244,19 @@ paths: - $ref: "#/components/parameters/WorkspaceId" responses: "200": - description: map from resource type to file ext + description: map from resource type to file resource info content: application/json: - schema: {} + schema: + type: object + additionalProperties: + type: object + properties: + format_extension: + type: string + nullable: true + is_fileset: + type: boolean /w/{workspace}/resources/type/delete/{path}: delete: diff --git a/backend/windmill-store/src/resources.rs b/backend/windmill-store/src/resources.rs index 9fe64e4f33..a03d97c320 100644 --- a/backend/windmill-store/src/resources.rs +++ b/backend/windmill-store/src/resources.rs @@ -1517,7 +1517,7 @@ async fn update_resource_type( sqlb.set_str("description", ndesc); } if let Some(is_fileset) = ns.is_fileset { - sqlb.set_str("is_fileset", if is_fileset { "TRUE" } else { "FALSE" }); + sqlb.set("is_fileset", if is_fileset { "TRUE" } else { "FALSE" }); } sqlb.set_str("edited_at", "now()"); let sql = sqlb.sql().map_err(|e| Error::internal_err(e.to_string()))?; diff --git a/cli/src/utils/utils.ts b/cli/src/utils/utils.ts index f58d507da0..766b372a0a 100644 --- a/cli/src/utils/utils.ts +++ b/cli/src/utils/utils.ts @@ -154,6 +154,7 @@ export function isFileResource(path: string): boolean { ); } +/** Matches children inside a .fileset/ directory, not the directory itself. */ export function isFilesetResource(path: string): boolean { return path.includes(".fileset/") || path.includes(".fileset\\"); }