diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 09a3cf4195..d1b0cfaafe 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -35729,6 +35729,14 @@ components: type: string resource_type: type: string + required: + type: boolean + default: true + description: >- + Whether an importer has to fill this in for the project to run. False + for a stub minted from an item's `resource-` input, which is + created so a standalone run has something to pick but which nothing in + the project reads. Omitted means true. required: - path - resource_type diff --git a/frontend/src/lib/components/workspaceSettings/projectBundle.test.ts b/frontend/src/lib/components/workspaceSettings/projectBundle.test.ts index 669c0a43de..809dd56067 100644 --- a/frontend/src/lib/components/workspaceSettings/projectBundle.test.ts +++ b/frontend/src/lib/components/workspaceSettings/projectBundle.test.ts @@ -16,6 +16,7 @@ import { collectExportVarPaths, extractTriggerConfigResourceRefs, extractVarRefsFromValue, + isRequiredResource, type ProjectExport, type FetchedItem, type ItemRef @@ -867,3 +868,14 @@ describe('flow_env and preprocessor_module', () => { expect(out.flow_env.PLAIN).toBe('not-a-ref') }) }) + +describe('isRequiredResource', () => { + // Projects published before the Hub stored the flag carry no `required` key. + // Reading that as "not required" would silently stop asking for credentials + // every one of them genuinely needs. + it('treats an absent flag as required', () => { + expect(isRequiredResource({ path: 'f/p/db', resource_type: 'postgresql' })).toBe(true) + expect(isRequiredResource({ path: 'f/p/db', required: true })).toBe(true) + expect(isRequiredResource({ path: 'f/p/postgresql', required: false })).toBe(false) + }) +}) diff --git a/frontend/src/routes/(root)/(logged)/projects/import/+page@(root).svelte b/frontend/src/routes/(root)/(logged)/projects/import/+page@(root).svelte index a1bc2ab970..a3bd932e1c 100644 --- a/frontend/src/routes/(root)/(logged)/projects/import/+page@(root).svelte +++ b/frontend/src/routes/(root)/(logged)/projects/import/+page@(root).svelte @@ -261,9 +261,9 @@ setupUndecided = false return } - // Every resource the project ships arrives as an empty stub, so any project with - // resources has something to fill in. The step itself re-checks and shows only - // what is genuinely outstanding, which is what makes a re-import quiet. + // Every required resource arrives as an empty stub, so a project with one has + // something to fill in. The step itself re-checks and shows only what is + // genuinely outstanding, which is what makes a re-import quiet. if (execution.resourceCount > 0) { setupNeeded = true setupUndecided = false