From e951c896b865df48d331968953c9e44848236516 Mon Sep 17 00:00:00 2001 From: centdix <40307056+centdix@users.noreply.github.com> Date: Mon, 25 Aug 2025 11:47:02 +0200 Subject: [PATCH 01/14] fix(aichat): fix wrong current model logic (#6451) * fix model selection * fix for context window * cleaning * fix lint * fix --- .../copilot/chat/AIChatManager.svelte.ts | 6 ++--- .../components/copilot/chat/script/core.ts | 5 ++-- .../src/lib/components/copilot/chat/shared.ts | 6 ++--- frontend/src/lib/components/copilot/lib.ts | 25 +++++++++---------- frontend/src/lib/stores.ts | 21 ++++++++++++---- 5 files changed, 37 insertions(+), 26 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts index 452a19ffef..b1f02f00b4 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts +++ b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts @@ -40,13 +40,12 @@ import { getStringError } from './utils' import type { FlowModuleState, FlowState } from '$lib/components/flows/flowState' import type { CurrentEditor, ExtendedOpenFlow } from '$lib/components/flows/types' import { untrack } from 'svelte' -import { copilotSessionModel, type DBSchemas } from '$lib/stores' +import { getCurrentModel, type DBSchemas } from '$lib/stores' import { askTools, prepareAskSystemMessage, prepareAskUserMessage } from './ask/core' import { chatState, DEFAULT_SIZE, triggerablesByAi } from './sharedChatState.svelte' import type { ContextElement } from './context' import type { Selection } from 'monaco-editor' import type AIChatInput from './AIChatInput.svelte' -import { get } from 'svelte/store' import { prepareApiSystemMessage, prepareApiUserMessage } from './api/core' // If the estimated token usage is greater than the model context window - the threshold, we delete the oldest message @@ -124,7 +123,8 @@ class AIChatManager { } return acc }, 0) - const modelContextWindow = getModelContextWindow(get(copilotSessionModel)?.model ?? '') + const model = getCurrentModel() + const modelContextWindow = getModelContextWindow(model.model) return ( estimatedTokens > modelContextWindow - diff --git a/frontend/src/lib/components/copilot/chat/script/core.ts b/frontend/src/lib/components/copilot/chat/script/core.ts index ee6b364ecf..1154623f3a 100644 --- a/frontend/src/lib/components/copilot/chat/script/core.ts +++ b/frontend/src/lib/components/copilot/chat/script/core.ts @@ -8,7 +8,7 @@ import type { ChatCompletionTool, ChatCompletionUserMessageParam } from 'openai/resources/index.mjs' -import { copilotSessionModel, type DBSchema, dbSchemas } from '$lib/stores' +import { type DBSchema, dbSchemas, getCurrentModel } from '$lib/stores' import { getDbSchemas } from '$lib/components/apps/components/display/dbtable/utils' import type { ContextElement } from '../context' import { PYTHON_PREPROCESSOR_MODULE_CODE, TS_PREPROCESSOR_MODULE_CODE } from '$lib/script_helpers' @@ -655,7 +655,8 @@ export async function searchExternalIntegrationResources(args: { query: string } (r: PackageSearchQuery) => r.searchScore >= SCORE_THRESHOLD ) - const modelContextWindow = getModelContextWindow(get(copilotSessionModel)?.model ?? '') + const model = getCurrentModel() + const modelContextWindow = getModelContextWindow(model.model) const results: PackageSearchResult[] = await Promise.all( filtered.map(async (r: PackageSearchQuery) => { let documentation = '' diff --git a/frontend/src/lib/components/copilot/chat/shared.ts b/frontend/src/lib/components/copilot/chat/shared.ts index 7c7fb071e8..d3589df323 100644 --- a/frontend/src/lib/components/copilot/chat/shared.ts +++ b/frontend/src/lib/components/copilot/chat/shared.ts @@ -5,7 +5,7 @@ import type { } from 'openai/resources/chat/completions.mjs' import { get } from 'svelte/store' import type { CodePieceElement, ContextElement, FlowModuleCodePieceElement } from './context' -import { copilotSessionModel, workspaceStore } from '$lib/stores' +import { workspaceStore, getCurrentModel } from '$lib/stores' import type { ExtendedOpenFlow } from '$lib/components/flows/types' import type { FunctionParameters } from 'openai/resources/shared.mjs' import { zodToJsonSchema } from 'zod-to-json-schema' @@ -455,8 +455,8 @@ export async function buildSchemaForTool( toolDef.function.parameters = { ...schema, additionalProperties: false } // OPEN AI models don't support strict mode well with schema with complex properties, so we disable it - const model = get(copilotSessionModel)?.provider - if (model === 'openai' || model === 'azure_openai') { + const model = getCurrentModel() + if (model.provider === 'openai' || model.provider === 'azure_openai') { toolDef.function.strict = false } return true diff --git a/frontend/src/lib/components/copilot/lib.ts b/frontend/src/lib/components/copilot/lib.ts index 99175891a5..45e2f6982d 100644 --- a/frontend/src/lib/components/copilot/lib.ts +++ b/frontend/src/lib/components/copilot/lib.ts @@ -1,7 +1,6 @@ import type { AIProvider, AIProviderModel } from '$lib/gen' import { - copilotInfo, - copilotSessionModel, + getCurrentModel, workspaceStore, type DBSchema, type GraphqlSchema, @@ -23,7 +22,16 @@ import { z } from 'zod' export const SUPPORTED_LANGUAGES = new Set(Object.keys(GEN_CONFIG.prompts)) -const OPENAI_MODELS = ['gpt-5', 'gpt-5-mini', 'gpt-5-nano', 'gpt-4o', 'gpt-4o-mini', 'o4-mini', 'o3', 'o3-mini'] +const OPENAI_MODELS = [ + 'gpt-5', + 'gpt-5-mini', + 'gpt-5-nano', + 'gpt-4o', + 'gpt-4o-mini', + 'o4-mini', + 'o3', + 'o3-mini' +] // need at least one model for each provider except customai export const AI_DEFAULT_MODELS: Record = { @@ -468,18 +476,9 @@ function getProviderAndCompletionConfig({ ? ChatCompletionCreateParamsStreaming : ChatCompletionCreateParamsNonStreaming } { - let info = get(copilotInfo) - const modelProvider = - forceModelProvider ?? get(copilotSessionModel) ?? info.defaultModel ?? info.aiModels[0] - - if (!modelProvider) { - throw new Error('No model selected') - } - + const modelProvider = forceModelProvider ?? getCurrentModel() const providerConfig = PROVIDER_COMPLETION_CONFIG_MAP[modelProvider.provider] - const processedMessages = prepareMessages(modelProvider.provider, messages) - return { provider: modelProvider.provider, config: { diff --git a/frontend/src/lib/stores.ts b/frontend/src/lib/stores.ts index 20a44ac882..5d414811e3 100644 --- a/frontend/src/lib/stores.ts +++ b/frontend/src/lib/stores.ts @@ -1,5 +1,5 @@ import { BROWSER } from 'esm-env' -import { derived, type Readable, writable } from 'svelte/store' +import { derived, get, type Readable, writable } from 'svelte/store' import type { IntrospectionQuery } from 'graphql' import { @@ -153,6 +153,15 @@ export function setCopilotInfo(aiConfig: AIConfig) { } } +export function getCurrentModel() { + const model = + get(copilotSessionModel) ?? get(copilotInfo).defaultModel ?? get(copilotInfo).aiModels[0] + if (!model) { + throw new Error('No model selected') + } + return model +} + export const codeCompletionLoading = writable(false) export const metadataCompletionEnabled = writable(true) export const stepInputCompletionEnabled = writable(true) @@ -166,7 +175,9 @@ export const formatOnSave = writable( getLocalSetting(FORMAT_ON_SAVE_SETTING_NAME) != 'false' ) export const vimMode = writable(getLocalSetting(VIM_MODE_SETTING_NAME) == 'true') -export const relativeLineNumbers = writable(getLocalSetting(RELATIVE_LINE_NUMBERS_SETTING_NAME) == 'true') +export const relativeLineNumbers = writable( + getLocalSetting(RELATIVE_LINE_NUMBERS_SETTING_NAME) == 'true' +) export const codeCompletionSessionEnabled = writable( getLocalSetting(CODE_COMPLETION_SETTING_NAME) != 'false' ) @@ -176,9 +187,9 @@ const sessionProvider = getLocalSetting(COPILOT_SESSION_PROVIDER_SETTING_NAME) export const copilotSessionModel = writable( sessionModel && sessionProvider ? { - model: sessionModel, - provider: sessionProvider as AIProvider - } + model: sessionModel, + provider: sessionProvider as AIProvider + } : undefined ) export const usedTriggerKinds = writable([]) From 1073eb0e682e7bd253c6d62225361b487d7f6d2f Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 25 Aug 2025 12:12:12 +0000 Subject: [PATCH 02/14] fix(flow): test this step preload step input evaluation --- .../lib/components/ModulePreviewForm.svelte | 132 ++++++++++-------- .../lib/components/flows/testSteps.svelte.ts | 2 +- frontend/src/lib/components/flows/utils.ts | 12 +- 3 files changed, 78 insertions(+), 68 deletions(-) diff --git a/frontend/src/lib/components/ModulePreviewForm.svelte b/frontend/src/lib/components/ModulePreviewForm.svelte index 531fd9f24e..4c8c78e4e6 100644 --- a/frontend/src/lib/components/ModulePreviewForm.svelte +++ b/frontend/src/lib/components/ModulePreviewForm.svelte @@ -1,11 +1,11 @@
- {#if keys.length > 0} - {#each keys as argName, i (argName)} - {#if Object.keys(schema.properties ?? {}).includes(argName)} -
- {#if schema?.properties?.[argName]} - testSteps?.getStepInputArgs(mod.id, argName), - (v) => testSteps?.setStepInputArgs(mod.id, argName, v) - } - type={schema.properties[argName].type} - oneOf={schema.properties[argName].oneOf} - required={schema?.required?.includes(argName)} - pattern={schema.properties[argName].pattern} - bind:editor={editor[argName]} - bind:valid={inputCheck[argName]} - defaultValue={schema.properties[argName].default} - enum_={schema.properties[argName].enum} - format={schema.properties[argName].format} - contentEncoding={schema.properties[argName].contentEncoding} - properties={schema.properties[argName].properties} - nestedRequired={schema.properties[argName].required} - itemsType={schema.properties[argName].items} - extra={schema.properties[argName]} - nullable={schema.properties[argName].nullable} - title={schema.properties[argName].title} - placeholder={schema.properties[argName].placeholder} - /> - {/if} - {#if testSteps?.isArgManuallySet(mod.id, argName)} -
- -
- {/if} -
- {/if} - {/each} + {#if initialized} + {#if keys.length > 0} + {#each keys as argName, i (argName)} + {#if Object.keys(schema.properties ?? {}).includes(argName)} +
+ {#if schema?.properties?.[argName]} + testSteps?.getStepInputArgs(mod.id, argName), + (v) => testSteps?.setStepInputArgs(mod.id, argName, v) + } + type={schema.properties[argName].type} + oneOf={schema.properties[argName].oneOf} + required={schema?.required?.includes(argName)} + pattern={schema.properties[argName].pattern} + bind:editor={editor[argName]} + bind:valid={inputCheck[argName]} + defaultValue={schema.properties[argName].default} + enum_={schema.properties[argName].enum} + format={schema.properties[argName].format} + contentEncoding={schema.properties[argName].contentEncoding} + properties={schema.properties[argName].properties} + nestedRequired={schema.properties[argName].required} + itemsType={schema.properties[argName].items} + extra={schema.properties[argName]} + nullable={schema.properties[argName].nullable} + title={schema.properties[argName].title} + placeholder={schema.properties[argName].placeholder} + /> + {/if} + {#if testSteps?.isArgManuallySet(mod.id, argName)} +
+ +
+ {/if} +
+ {/if} + {/each} + {/if} + {:else} +
Loading test step arguments...
{/if}
diff --git a/frontend/src/lib/components/flows/testSteps.svelte.ts b/frontend/src/lib/components/flows/testSteps.svelte.ts index 71336cfe8f..a7e8263aad 100644 --- a/frontend/src/lib/components/flows/testSteps.svelte.ts +++ b/frontend/src/lib/components/flows/testSteps.svelte.ts @@ -12,7 +12,7 @@ export class TestSteps { #stepsEvaluated = $state>>({}) #steps = $state>>({}) - constructor() {} + constructor() { } setStepArgsManually(moduleId: string, args: Record) { this.#steps[moduleId] = args diff --git a/frontend/src/lib/components/flows/utils.ts b/frontend/src/lib/components/flows/utils.ts index d7b5e1db90..2e04c2a17e 100644 --- a/frontend/src/lib/components/flows/utils.ts +++ b/frontend/src/lib/components/flows/utils.ts @@ -22,11 +22,10 @@ function create_context_function_template(eval_string: string, context: Record 0 - ? `let ${Object.keys(context).map((key) => ` ${key} = context['${key}']`)};` - : `` -} +${Object.keys(context).length > 0 + ? `let ${Object.keys(context).map((key) => ` ${key} = context['${key}']`)};` + : `` + } return ${eval_string} }` } @@ -63,6 +62,9 @@ export function evalValue( v = undefined } } + if (v === NEVER_TESTED_THIS_FAR) { + v = undefined + } return v } From 38457444923848a1c5c2adcfcc7052f1ba9b2f16 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 25 Aug 2025 12:35:04 +0000 Subject: [PATCH 03/14] nit --- .../src/lib/components/flows/content/FlowModuleComponent.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/components/flows/content/FlowModuleComponent.svelte b/frontend/src/lib/components/flows/content/FlowModuleComponent.svelte index f30dd02ca2..db05f0b222 100644 --- a/frontend/src/lib/components/flows/content/FlowModuleComponent.svelte +++ b/frontend/src/lib/components/flows/content/FlowModuleComponent.svelte @@ -872,7 +872,7 @@ {#if selected === 'test'} - {#if stepHistoryLoader?.stepStates[flowModule.id]?.initial && !flowModule.mock?.enabled} + {#if stepHistoryLoader?.stepStates[flowModule.id]?.initial && lastJob && !flowModule.mock?.enabled}
Date: Mon, 25 Aug 2025 14:38:35 +0200 Subject: [PATCH 04/14] tooling: dev docker db script and readme nits (#6456) * tooling: dev docker db script and readme nits * nits * nits --- README.md | 99 ++++++++++++++++++++---------------------- frontend/README_DEV.md | 25 ++++++----- start-dev-db.sh | 13 ++++++ 3 files changed, 75 insertions(+), 62 deletions(-) create mode 100755 start-dev-db.sh diff --git a/README.md b/README.md index 27784d4922..5bfad3e7bf 100644 --- a/README.md +++ b/README.md @@ -332,40 +332,40 @@ you to have it being synced automatically everyday. ## Environment Variables -| Environment Variable name | Default | Description | Api Server/Worker/All | -| ----------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | -| DATABASE_URL | | The Postgres database url. | All | -| WORKER_GROUP | default | The worker group the worker belongs to and get its configuration pulled from | Worker | -| MODE | standalone | The mode if the binary. Possible values: standalone, worker, server, agent | All | -| METRICS_ADDR | None | (ee only) The socket addr at which to expose Prometheus metrics at the /metrics path. Set to "true" to expose it on port 8001 | All | -| JSON_FMT | false | Output the logs in json format instead of logfmt | All | -| BASE_URL | http://localhost:8000 | The base url that is exposed publicly to access your instance. Is overriden by the instance settings if any. | Server | -| ZOMBIE_JOB_TIMEOUT | 30 | The timeout after which a job is considered to be zombie if the worker did not send pings about processing the job (every server check for zombie jobs every 30s) | Server | -| RESTART_ZOMBIE_JOBS | true | If true then a zombie job is restarted (in-place with the same uuid and some logs), if false the zombie job is failed | Server | -| SLEEP_QUEUE | 50 | The number of ms to sleep in between the last check for new jobs in the DB. It is multiplied by NUM_WORKERS such that in average, for one worker instance, there is one pull every SLEEP_QUEUE ms. | Worker | -| KEEP_JOB_DIR | false | Keep the job directory after the job is done. Useful for debugging. | Worker | -| LICENSE_KEY (EE only) | None | License key checked at startup for the Enterprise Edition of Windmill | Worker | -| SLACK_SIGNING_SECRET | None | The signing secret of your Slack app. See [Slack documentation](https://api.slack.com/authentication/verifying-requests-from-slack) | Server | -| COOKIE_DOMAIN | None | The domain of the cookie. If not set, the cookie will be set by the browser based on the full origin | Server | -| DENO_PATH | /usr/bin/deno | The path to the deno binary. | Worker | -| PYTHON_PATH | | The path to the python binary if wanting to not have it managed by uv. | Worker | -| GO_PATH | /usr/bin/go | The path to the go binary. | Worker | -| GOPRIVATE | | The GOPRIVATE env variable to use private go modules | Worker | -| GOPROXY | | The GOPROXY env variable to use | Worker | -| NETRC | | The netrc content to use a private go registry | Worker | -| PY_CONCURRENT_DOWNLOADS | 20 | Sets the maximum number of in-flight concurrent python downloads that windmill will perform at any given time. | Worker | -| PATH | None | The path environment variable, usually inherited | Worker | -| HOME | None | The home directory to use for Go and Bash , usually inherited | Worker | -| DATABASE_CONNECTIONS | 50 (Server)/3 (Worker) | The max number of connections in the database connection pool | All | -| SUPERADMIN_SECRET | None | A token that would let the caller act as a virtual superadmin superadmin@windmill.dev | Server | -| TIMEOUT_WAIT_RESULT | 20 | The number of seconds to wait before timeout on the 'run_wait_result' endpoint | Worker | -| QUEUE_LIMIT_WAIT_RESULT | None | The number of max jobs in the queue before rejecting immediately the request in 'run_wait_result' endpoint. Takes precedence on the query arg. If none is specified, there are no limit. | Worker | -| DENO_AUTH_TOKENS | None | Custom DENO_AUTH_TOKENS to pass to worker to allow the use of private modules | Worker | -| DISABLE_RESPONSE_LOGS | false | Disable response logs | Server | -| CREATE_WORKSPACE_REQUIRE_SUPERADMIN | true | If true, only superadmins can create new workspaces | Server | -| MIN_FREE_DISK_SPACE_MB | 15000 | Minimum amount of free space on worker. Sends critical alert if worker has less free space. | Worker | -| RUN_UPDATE_CA_CERTIFICATE_AT_START | false | If true, runs CA certificate update command at startup before other initialization | All | -| RUN_UPDATE_CA_CERTIFICATE_PATH | /usr/sbin/update-ca-certificates | Path to the CA certificate update command/script to run when RUN_UPDATE_CA_CERTIFICATE_AT_START is true | All | +| Environment Variable name | Default | Description | Api Server/Worker/All | +| ----------------------------------- | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | +| DATABASE_URL | | The Postgres database url. | All | +| WORKER_GROUP | default | The worker group the worker belongs to and get its configuration pulled from | Worker | +| MODE | standalone | The mode if the binary. Possible values: standalone, worker, server, agent | All | +| METRICS_ADDR | None | (ee only) The socket addr at which to expose Prometheus metrics at the /metrics path. Set to "true" to expose it on port 8001 | All | +| JSON_FMT | false | Output the logs in json format instead of logfmt | All | +| BASE_URL | http://localhost:8000 | The base url that is exposed publicly to access your instance. Is overriden by the instance settings if any. | Server | +| ZOMBIE_JOB_TIMEOUT | 30 | The timeout after which a job is considered to be zombie if the worker did not send pings about processing the job (every server check for zombie jobs every 30s) | Server | +| RESTART_ZOMBIE_JOBS | true | If true then a zombie job is restarted (in-place with the same uuid and some logs), if false the zombie job is failed | Server | +| SLEEP_QUEUE | 50 | The number of ms to sleep in between the last check for new jobs in the DB. It is multiplied by NUM_WORKERS such that in average, for one worker instance, there is one pull every SLEEP_QUEUE ms. | Worker | +| KEEP_JOB_DIR | false | Keep the job directory after the job is done. Useful for debugging. | Worker | +| LICENSE_KEY (EE only) | None | License key checked at startup for the Enterprise Edition of Windmill | Worker | +| SLACK_SIGNING_SECRET | None | The signing secret of your Slack app. See [Slack documentation](https://api.slack.com/authentication/verifying-requests-from-slack) | Server | +| COOKIE_DOMAIN | None | The domain of the cookie. If not set, the cookie will be set by the browser based on the full origin | Server | +| DENO_PATH | /usr/bin/deno | The path to the deno binary. | Worker | +| PYTHON_PATH | | The path to the python binary if wanting to not have it managed by uv. | Worker | +| GO_PATH | /usr/bin/go | The path to the go binary. | Worker | +| GOPRIVATE | | The GOPRIVATE env variable to use private go modules | Worker | +| GOPROXY | | The GOPROXY env variable to use | Worker | +| NETRC | | The netrc content to use a private go registry | Worker | +| PY_CONCURRENT_DOWNLOADS | 20 | Sets the maximum number of in-flight concurrent python downloads that windmill will perform at any given time. | Worker | +| PATH | None | The path environment variable, usually inherited | Worker | +| HOME | None | The home directory to use for Go and Bash , usually inherited | Worker | +| DATABASE_CONNECTIONS | 50 (Server)/3 (Worker) | The max number of connections in the database connection pool | All | +| SUPERADMIN_SECRET | None | A token that would let the caller act as a virtual superadmin superadmin@windmill.dev | Server | +| TIMEOUT_WAIT_RESULT | 20 | The number of seconds to wait before timeout on the 'run_wait_result' endpoint | Worker | +| QUEUE_LIMIT_WAIT_RESULT | None | The number of max jobs in the queue before rejecting immediately the request in 'run_wait_result' endpoint. Takes precedence on the query arg. If none is specified, there are no limit. | Worker | +| DENO_AUTH_TOKENS | None | Custom DENO_AUTH_TOKENS to pass to worker to allow the use of private modules | Worker | +| DISABLE_RESPONSE_LOGS | false | Disable response logs | Server | +| CREATE_WORKSPACE_REQUIRE_SUPERADMIN | true | If true, only superadmins can create new workspaces | Server | +| MIN_FREE_DISK_SPACE_MB | 15000 | Minimum amount of free space on worker. Sends critical alert if worker has less free space. | Worker | +| RUN_UPDATE_CA_CERTIFICATE_AT_START | false | If true, runs CA certificate update command at startup before other initialization | All | +| RUN_UPDATE_CA_CERTIFICATE_PATH | /usr/sbin/update-ca-certificates | Path to the CA certificate update command/script to run when RUN_UPDATE_CA_CERTIFICATE_AT_START is true | All | ## Run a local dev setup @@ -374,7 +374,6 @@ Using [Nix](./frontend/README_DEV.md#nix) (Recommended). See the [./frontend/README_DEV.md](./frontend/README_DEV.md) file for all running options. - ### only Frontend This will use the backend of but your own frontend @@ -400,29 +399,27 @@ npm run generate-backend-client-mac See the [./frontend/README_DEV.md](./frontend/README_DEV.md) file for all running options. -1. Create a Postgres Database for Windmill and create an admin role inside your - Postgres setup. The easiest way to get a working db is to run +1. Start a local Postgres database using for instance the `start-dev-db.sh` script which will make a database available at `postgres://postgres:changeme@localhost:5432/windmill` + Then run the migrations using the following command: ``` cargo install sqlx-cli env DATABASE_URL= sqlx migrate run ``` - This will also avoid compile time issue with sqlx's `query!` macro -2. Install [nsjail](https://github.com/google/nsjail) and have it accessible in + This will also avoid compile time issue with sqlx's `query!` macro. +2. (optional, linux only) Install [nsjail](https://github.com/google/nsjail) and have it accessible in your PATH -3. Install deno and python3, have the bins at `/usr/bin/deno` and - `/usr/local/bin/python3` -4. Install [caddy](https://caddyserver.com) -5. Install the [lld linker](https://lld.llvm.org/) -6. Go to `frontend/`: - 1. `npm install`, `npm run generate-backend-client` then `npm run dev` +3. Install bun, deno and python3 (+ any languages you want to use), have the bins at `/usr/bin/bun`,`/usr/bin/deno`, and + `/usr/local/bin/python3` or set the corresponding environment variables. +4. (optional) Install the [lld linker](https://lld.llvm.org/) +5. Go to `frontend/`: + 1. `npm install`, `npm run generate-backend-client` then `REMOTE=http://localhost:8000 npm run dev` 2. You might need to set some extra heap space for the node runtime `export NODE_OPTIONS="--max-old-space-size=4096"` - 3. In another shell `npm run build` otherwise the backend will not find the - `frontend/build` folder and will not compile. - 4. In another shell `sudo caddy run --config Caddyfile` -7. Go to `backend/`: - `env DATABASE_URL= RUST_LOG=info cargo run` -8. Et voilĂ , windmill should be available at `http://localhost/` + 3. Create an empty `frontend/build` folder using `mkdir frontend/build` +6. Go to `backend/`: + 1. `env DATABASE_URL= RUST_LOG=info cargo run` + 2. You can specify any feature flag you want to enable, for example `cargo run --features python` to enable the python executor. +7. Et voilĂ , windmill should be available at `http://localhost:3000` ## Contributors diff --git a/frontend/README_DEV.md b/frontend/README_DEV.md index 88c18440cb..61335374e1 100644 --- a/frontend/README_DEV.md +++ b/frontend/README_DEV.md @@ -15,44 +15,45 @@ That's it! You are ready to go. > Using **direnv** is highly recommended, since it can load shell automatically based on your CWD. It also can give you hints. ### Development + ```bash # enter a dev shell containing all necessary packages. `direnv allow` if direnv is installed. -nix develop +nix develop ## or ignore if you have `direnv` # Start db (if not started already) -sudo docker compose up db -d +sudo docker compose up db -d # run the frontend. wm # In an other shell: # -nix develop +nix develop ## or ignore if you have `direnv` cd backend # You don't need to install anything extra. All dependencies are already in place! -cargo run --features all_languages +cargo run --features all_languages ``` The default proxy is setup to use the local backend: . -### wm-* Commands +### wm-\* Commands Nix shell provides you with several helper commands prefixed with `wm-` ```bash # Start minio server (implements S3) -wm-minio -# Note: You will need access to EE private repo in order to compile, don't forget "enterprise" and "parquet" freatures as well. +wm-minio +# Note: You will need access to EE private repo in order to compile, don't forget "enterprise" and "parquet" freatures as well. # Generate keys for local dev. -wm-minio-keys +wm-minio-keys # Minio data as well as generated keys are stored in `backend/.minio-data` ``` -You can read about all others commands individually in [flake.nix](../flake.nix). +You can read about all others commands individually in [flake.nix](../flake.nix). ### dev.nu @@ -106,7 +107,7 @@ REMOTE=http://localhost REMOTE_LSP=http://localhost npm run dev Sometimes it is important to build docker image for your branch locally. It is crucial part of testing, since local environment may differ from the containerized one. -That's why we provide [docker/dev.nu](../docker/dev.nu). It is helper that can build images locally and execute them. +That's why we provide [docker/dev.nu](../docker/dev.nu). It is helper that can build images locally and execute them. it can build the image and run on local repository. @@ -150,7 +151,7 @@ If you develop wasm parser for new language you can also pass `--wasm-pkg Date: Mon, 25 Aug 2025 14:39:37 +0200 Subject: [PATCH 05/14] feat(backend): support unencrypted connection to mssql (#6453) --- backend/windmill-worker/src/mssql_executor.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/windmill-worker/src/mssql_executor.rs b/backend/windmill-worker/src/mssql_executor.rs index 7f5ec7c116..7e4ccd2958 100644 --- a/backend/windmill-worker/src/mssql_executor.rs +++ b/backend/windmill-worker/src/mssql_executor.rs @@ -5,7 +5,9 @@ use regex::Regex; use serde::Deserialize; use serde_json::value::RawValue; use serde_json::{Map, Value}; -use tiberius::{AuthMethod, Client, ColumnData, Config, FromSqlOwned, Query, Row, SqlBrowser}; +use tiberius::{ + AuthMethod, Client, ColumnData, Config, EncryptionLevel, FromSqlOwned, Query, Row, SqlBrowser, +}; use tokio::net::TcpStream; use tokio_util::compat::TokioAsyncWriteCompatExt; use uuid::Uuid; @@ -39,6 +41,7 @@ struct MssqlDatabase { trust_cert: Option, #[serde(default, deserialize_with = "empty_as_none")] ca_cert: Option, + encrypt: Option, } #[derive(Debug, Deserialize)] @@ -146,6 +149,12 @@ pub async fn do_mssql( tracing::info!("MSSQL: using provided CA certificate for trust"); } + config.encryption(if database.encrypt.unwrap_or(true) { + EncryptionLevel::Required + } else { + EncryptionLevel::NotSupported + }); + let tcp = if use_instance_name { TcpStream::connect_named(&config).await.map_err(to_anyhow)? // named instance } else { From ef93e9ec8bd8b2e44759b20d9cd2f2244458ccf1 Mon Sep 17 00:00:00 2001 From: pyranota <92104930+pyranota@users.noreply.github.com> Date: Mon, 25 Aug 2025 14:45:53 +0200 Subject: [PATCH 06/14] tooling: update nix instructions on starting db (#6457) --- frontend/README_DEV.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/README_DEV.md b/frontend/README_DEV.md index 61335374e1..c17ac944c8 100644 --- a/frontend/README_DEV.md +++ b/frontend/README_DEV.md @@ -22,7 +22,7 @@ nix develop ## or ignore if you have `direnv` # Start db (if not started already) -sudo docker compose up db -d +./start-dev-db.sh # run the frontend. wm From 082312000fdede37b58728e09456fea32727088a Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 25 Aug 2025 13:46:19 +0100 Subject: [PATCH 07/14] chore(main): release 1.534.0 (#6452) * chore(main): release 1.534.0 * Apply automatic changes --------- Co-authored-by: rubenfiszel <275584+rubenfiszel@users.noreply.github.com> --- CHANGELOG.md | 13 +++ backend/Cargo.lock | 108 +++++++++--------- backend/Cargo.toml | 4 +- backend/windmill-api/openapi.yaml | 2 +- benchmarks/lib.ts | 2 +- cli/src/main.ts | 2 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- lsp/Pipfile | 4 +- openflow.openapi.yaml | 2 +- .../WindmillClient/WindmillClient.psd1 | 2 +- python-client/wmill/pyproject.toml | 2 +- python-client/wmill_pg/pyproject.toml | 2 +- typescript-client/jsr.json | 2 +- typescript-client/package.json | 2 +- version.txt | 2 +- 16 files changed, 84 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41dcce672d..590a1dc74e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [1.534.0](https://github.com/windmill-labs/windmill/compare/v1.533.1...v1.534.0) (2025-08-25) + + +### Features + +* **backend:** support unencrypted connection to mssql ([#6453](https://github.com/windmill-labs/windmill/issues/6453)) ([8d31c2a](https://github.com/windmill-labs/windmill/commit/8d31c2ab0d34036dc8057611857a5d72aad8598f)) + + +### Bug Fixes + +* **aichat:** fix wrong current model logic ([#6451](https://github.com/windmill-labs/windmill/issues/6451)) ([e951c89](https://github.com/windmill-labs/windmill/commit/e951c896b865df48d331968953c9e44848236516)) +* **flow:** test this step preload step input evaluation ([1073eb0](https://github.com/windmill-labs/windmill/commit/1073eb0e682e7bd253c6d62225361b487d7f6d2f)) + ## [1.533.1](https://github.com/windmill-labs/windmill/compare/v1.533.0...v1.533.1) (2025-08-23) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 5effd205d1..a22a1617ff 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -496,7 +496,7 @@ dependencies = [ "memchr", "num", "regex", - "regex-syntax 0.8.5", + "regex-syntax 0.8.6", ] [[package]] @@ -3132,7 +3132,7 @@ dependencies = [ "log", "recursive", "regex", - "regex-syntax 0.8.5", + "regex-syntax 0.8.6", ] [[package]] @@ -5130,8 +5130,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" dependencies = [ "bit-set 0.5.3", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-automata 0.4.10", + "regex-syntax 0.8.6", ] [[package]] @@ -5141,8 +5141,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" dependencies = [ "bit-set 0.8.0", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-automata 0.4.10", + "regex-syntax 0.8.6", ] [[package]] @@ -5929,8 +5929,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-automata 0.4.10", + "regex-syntax 0.8.6", ] [[package]] @@ -6891,7 +6891,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.9", + "regex-automata 0.4.10", "same-file", "walkdir", "winapi-util", @@ -7150,9 +7150,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ "getrandom 0.3.3", "libc", @@ -10607,14 +10607,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-automata 0.4.10", + "regex-syntax 0.8.6", ] [[package]] @@ -10628,20 +10628,20 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax 0.8.6", ] [[package]] name = "regex-lite" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" +checksum = "943f41321c63ef1c92fd763bfe054d2668f7f225a5c29f0105903dc2fc04ba30" [[package]] name = "regex-syntax" @@ -10657,9 +10657,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" [[package]] name = "rend" @@ -13263,7 +13263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d60769b80ad7953d8a7b2c70cdfe722bbcdcac6bccc8ac934c40c034d866fc18" dependencies = [ "byteorder", - "regex-syntax 0.8.5", + "regex-syntax 0.8.6", "utf8-ranges", ] @@ -14182,7 +14182,7 @@ checksum = "0203df02a3b6dd63575cc1d6e609edc2181c9a11867a271b25cfd2abff3ec5ca" dependencies = [ "cc", "regex", - "regex-syntax 0.8.5", + "regex-syntax 0.8.6", "tree-sitter-language", ] @@ -14596,9 +14596,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.6" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "137a3c834eaf7139b73688502f3f1141a0337c5d8e4d9b536f9b8c796e26a7c4" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", @@ -15129,7 +15129,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "axum", @@ -15183,7 +15183,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "argon2", @@ -15300,7 +15300,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.533.1" +version = "1.534.0" dependencies = [ "base64 0.22.1", "chrono", @@ -15315,7 +15315,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.533.1" +version = "1.534.0" dependencies = [ "chrono", "serde", @@ -15328,7 +15328,7 @@ dependencies = [ [[package]] name = "windmill-autoscaling" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "axum", @@ -15347,7 +15347,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "async-recursion", @@ -15427,7 +15427,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.533.1" +version = "1.534.0" dependencies = [ "regex", "serde", @@ -15442,7 +15442,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "bytes", @@ -15466,7 +15466,7 @@ dependencies = [ [[package]] name = "windmill-macros" -version = "1.533.1" +version = "1.534.0" dependencies = [ "itertools 0.14.0", "lazy_static", @@ -15478,7 +15478,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.533.1" +version = "1.534.0" dependencies = [ "convert_case 0.6.0", "serde", @@ -15487,7 +15487,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "lazy_static", @@ -15499,7 +15499,7 @@ dependencies = [ [[package]] name = "windmill-parser-csharp" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "serde_json", @@ -15511,7 +15511,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "gosyn", @@ -15523,7 +15523,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "lazy_static", @@ -15535,7 +15535,7 @@ dependencies = [ [[package]] name = "windmill-parser-java" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "serde_json", @@ -15547,7 +15547,7 @@ dependencies = [ [[package]] name = "windmill-parser-nu" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "nu-parser", @@ -15558,7 +15558,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -15569,7 +15569,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -15581,7 +15581,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "async-recursion", @@ -15604,7 +15604,7 @@ dependencies = [ [[package]] name = "windmill-parser-ruby" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "lazy_static", @@ -15618,7 +15618,7 @@ dependencies = [ [[package]] name = "windmill-parser-rust" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -15635,7 +15635,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "lazy_static", @@ -15649,7 +15649,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "lazy_static", @@ -15667,7 +15667,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "getrandom 0.2.16", @@ -15692,7 +15692,7 @@ dependencies = [ [[package]] name = "windmill-parser-yaml" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "serde_json", @@ -15702,7 +15702,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "async-recursion", @@ -15735,7 +15735,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.533.1" +version = "1.534.0" dependencies = [ "wasm-bindgen", "wasm-bindgen-test", @@ -15745,7 +15745,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.533.1" +version = "1.534.0" dependencies = [ "anyhow", "async-recursion", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 055eb778e5..593ca0d0bd 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.533.1" +version = "1.534.0" authors.workspace = true edition.workspace = true @@ -33,7 +33,7 @@ members = [ ] [workspace.package] -version = "1.533.1" +version = "1.534.0" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 03d1bfdd8b..94068d9f57 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.533.1 + version: 1.534.0 title: Windmill API contact: diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index 138aaa8648..599abd9366 100644 --- a/benchmarks/lib.ts +++ b/benchmarks/lib.ts @@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts"; import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts"; import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts"; -export const VERSION = "v1.533.1"; +export const VERSION = "v1.534.0"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/cli/src/main.ts b/cli/src/main.ts index 9cd029cef1..caddc0a642 100644 --- a/cli/src/main.ts +++ b/cli/src/main.ts @@ -68,7 +68,7 @@ export { // } // }); -export const VERSION = "1.533.1"; +export const VERSION = "1.534.0"; const command = new Command() .name("wmill") diff --git a/frontend/package-lock.json b/frontend/package-lock.json index aac91582fd..5c8e3b40aa 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-components", - "version": "1.533.1", + "version": "1.534.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-components", - "version": "1.533.1", + "version": "1.534.0", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/frontend/package.json b/frontend/package.json index f55500d7ce..0de77f9071 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "windmill-components", - "version": "1.533.1", + "version": "1.534.0", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/lsp/Pipfile b/lsp/Pipfile index dd7d94d3a1..c67576d284 100644 --- a/lsp/Pipfile +++ b/lsp/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -wmill = ">=1.533.1" -wmill_pg = ">=1.533.1" +wmill = ">=1.534.0" +wmill_pg = ">=1.534.0" sendgrid = "*" mysql-connector-python = "*" pymongo = "*" diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index dba9200516..c5f345b540 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.533.1 + version: 1.534.0 title: OpenFlow Spec contact: name: Ruben Fiszel diff --git a/powershell-client/WindmillClient/WindmillClient.psd1 b/powershell-client/WindmillClient/WindmillClient.psd1 index d9fb93d0a4..02063903cf 100644 --- a/powershell-client/WindmillClient/WindmillClient.psd1 +++ b/powershell-client/WindmillClient/WindmillClient.psd1 @@ -12,7 +12,7 @@ RootModule = 'WindmillClient.psm1' # Version number of this module. - ModuleVersion = '1.533.1' + ModuleVersion = '1.534.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index b1c18aaba2..80ca7c5db2 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill" -version = "1.533.1" +version = "1.534.0" description = "A client library for accessing Windmill server wrapping the Windmill client API" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/python-client/wmill_pg/pyproject.toml b/python-client/wmill_pg/pyproject.toml index 8c25d86e12..8cba2d9a75 100644 --- a/python-client/wmill_pg/pyproject.toml +++ b/python-client/wmill_pg/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill-pg" -version = "1.533.1" +version = "1.534.0" description = "An extension client for the wmill client library focused on pg" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/typescript-client/jsr.json b/typescript-client/jsr.json index 279e465485..17f3c086dc 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,6 +1,6 @@ { "name": "@windmill/windmill", - "version": "1.533.1", + "version": "1.534.0", "exports": "./src/index.ts", "publish": { "exclude": ["!src", "./s3Types.ts", "./client.ts"] diff --git a/typescript-client/package.json b/typescript-client/package.json index e573ac1119..9518627f93 100644 --- a/typescript-client/package.json +++ b/typescript-client/package.json @@ -1,7 +1,7 @@ { "name": "windmill-client", "description": "Windmill SDK client for browsers and Node.js", - "version": "1.533.1", + "version": "1.534.0", "author": "Ruben Fiszel", "license": "Apache 2.0", "devDependencies": { diff --git a/version.txt b/version.txt index e65beac975..1b82b09797 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.533.1 +1.534.0 From fc20b7bd91d33115aacb38cc46394f9c6465aa0f Mon Sep 17 00:00:00 2001 From: Guilhem Date: Mon, 25 Aug 2025 13:49:46 +0100 Subject: [PATCH 08/14] fix(frontend): fix test step behavior (#6427) * fix flowStateStore val * handle run preview multiple keyboard actions * Synchronise input args and prview args * Fix arg update one step load * fix input ste manually not reseted after preview * rename test steps to stepsInputArgs * simplify job result update * fix job preview logic * fix import * nit * clean * fix test job not displaying when data is pinned * remove job history loader display delay * nit * nit * add error handler to steps input args comparison function * prevent result node to display connection --- frontend/src/lib/components/Dev.svelte | 9 +- .../src/lib/components/FlowBuilder.svelte | 11 +- .../lib/components/FlowPreviewContent.svelte | 6 +- .../src/lib/components/ModulePreview.svelte | 5 +- .../lib/components/ModulePreviewForm.svelte | 16 +- .../ModulePreviewResultViewer.svelte | 38 +-- frontend/src/lib/components/ModuleTest.svelte | 13 +- .../lib/components/flows/FlowEditor.svelte | 5 +- .../flows/content/FlowEditorPanel.svelte | 5 +- .../components/flows/content/FlowInput.svelte | 32 +- .../flows/content/FlowModuleComponent.svelte | 56 +--- .../flows/map/FlowModuleSchemaItem.svelte | 42 +-- .../components/flows/map/VirtualItem.svelte | 2 +- .../flows/propPicker/InputPickerInner.svelte | 10 +- .../flows/propPicker/OutputPickerInner.svelte | 308 ++++++++++-------- ...eps.svelte.ts => stepsInputArgs.svelte.ts} | 24 +- frontend/src/lib/components/flows/types.ts | 57 ++-- frontend/src/routes/flows/dev/+page.svelte | 8 +- 18 files changed, 328 insertions(+), 319 deletions(-) rename frontend/src/lib/components/flows/{testSteps.svelte.ts => stepsInputArgs.svelte.ts} (88%) diff --git a/frontend/src/lib/components/Dev.svelte b/frontend/src/lib/components/Dev.svelte index 4eececb8ef..cf3b687852 100644 --- a/frontend/src/lib/components/Dev.svelte +++ b/frontend/src/lib/components/Dev.svelte @@ -48,7 +48,7 @@ import type { FlowPropPickerConfig, PropPickerContext } from './prop_picker' import type { PickableProperties } from './flows/previousResults' import { Triggers } from './triggers/triggers.svelte' - import { TestSteps } from './flows/testSteps.svelte' + import { StepsInputArgs } from './flows/stepsInputArgs.svelte' import { ModulesTestStates } from './modulesTest.svelte' import type { GraphModuleState } from './graph' @@ -457,7 +457,7 @@ const scriptEditorDrawer = writable(undefined) const moving = writable<{ id: string } | undefined>(undefined) const history = initHistory(flowStore.val) - const testSteps = new TestSteps() + const stepsInputArgs = new StepsInputArgs() const selectedIdStore = writable('settings-metadata') const triggersCount = writable(undefined) const modulesTestStates = new ModulesTestStates((moduleId) => { @@ -481,7 +481,7 @@ pathStore: writable(''), flowStateStore, flowStore, - testSteps, + stepsInputArgs, saveDraft: () => {}, initialPathStore: writable(''), fakeInitialPath: '', @@ -806,7 +806,7 @@ noEditor on:applyArgs={(ev) => { if (ev.detail.kind === 'preprocessor') { - testSteps.setStepArgs('preprocessor', ev.detail.args ?? {}) + stepsInputArgs.setStepArgs('preprocessor', ev.detail.args ?? {}) $selectedIdStore = 'preprocessor' } else { previewArgsStore.val = ev.detail.args ?? {} @@ -818,6 +818,7 @@ isOwner={flowPreviewContent?.getIsOwner()} {suspendStatus} onOpenDetails={flowPreviewButtons?.openPreview} + previewOpen={flowPreviewButtons?.getPreviewOpen()} /> {/key} diff --git a/frontend/src/lib/components/FlowBuilder.svelte b/frontend/src/lib/components/FlowBuilder.svelte index 0573c67c40..4f764065e4 100644 --- a/frontend/src/lib/components/FlowBuilder.svelte +++ b/frontend/src/lib/components/FlowBuilder.svelte @@ -77,7 +77,7 @@ } from './triggers/utils' import DraftTriggersConfirmationModal from './common/confirmationModal/DraftTriggersConfirmationModal.svelte' import { Triggers } from './triggers/triggers.svelte' - import { TestSteps } from './flows/testSteps.svelte' + import { StepsInputArgs } from './flows/stepsInputArgs.svelte' import { aiChatManager } from './copilot/chat/AIChatManager.svelte' import type { GraphModuleState } from './graph' import { @@ -571,7 +571,7 @@ payloadData: undefined }) - const testSteps = new TestSteps() + const stepsInputArgs = new StepsInputArgs() function select(selectedId: string) { selectedIdStore.set(selectedId) @@ -592,7 +592,7 @@ flowStateStore, flowStore, pathStore, - testSteps, + stepsInputArgs, saveDraft, initialPathStore, fakeInitialPath, @@ -1129,6 +1129,8 @@ bind:this={flowPreviewButtons} {loading} onRunPreview={() => { + // Reset manually edited args inputs when running a preview + stepsInputArgs.resetManuallyEditedArgs() modulesTestStates.hideJobsInGraph() localModuleStates = {} showJobStatus = true @@ -1170,7 +1172,7 @@ {newFlow} on:applyArgs={(ev) => { if (ev.detail.kind === 'preprocessor') { - testSteps.setStepArgs('preprocessor', ev.detail.args ?? {}) + stepsInputArgs.setStepArgs('preprocessor', ev.detail.args ?? {}) $selectedIdStore = 'preprocessor' } }} @@ -1218,6 +1220,7 @@ delete modulesTestStates.states[id] }} {flowHasChanged} + previewOpen={flowPreviewButtons?.getPreviewOpen()} /> {:else} Loading... diff --git a/frontend/src/lib/components/FlowPreviewContent.svelte b/frontend/src/lib/components/FlowPreviewContent.svelte index 01163fa07d..77c3c17e93 100644 --- a/frontend/src/lib/components/FlowPreviewContent.svelte +++ b/frontend/src/lib/components/FlowPreviewContent.svelte @@ -140,7 +140,7 @@ jobId = await runFlowPreview(args, newFlow, $pathStore, restartedFrom) isRunning = true if (inputSelected) { - savedArgs = previewArgs.val + savedArgs = $state.snapshot(previewArgs.val) inputSelected = undefined } onRunPreview?.() @@ -166,7 +166,7 @@ if (preventEscape) { selectInput(undefined) event.preventDefault() - event.stopPropagation + event.stopPropagation() } break } @@ -506,7 +506,7 @@ schema={flowStore.val.schema} bind:args={previewArgs.val} on:change={() => { - savedArgs = previewArgs.val + savedArgs = $state.snapshot(previewArgs.val) }} bind:isValid helperScript={flowStore.val.schema?.['x-windmill-dyn-select-code'] && diff --git a/frontend/src/lib/components/ModulePreview.svelte b/frontend/src/lib/components/ModulePreview.svelte index 93ea296ec6..ebee88985f 100644 --- a/frontend/src/lib/components/ModulePreview.svelte +++ b/frontend/src/lib/components/ModulePreview.svelte @@ -18,6 +18,7 @@ noEditor?: boolean scriptProgress?: any focusArg?: string + onJobDone?: () => void } let { @@ -28,7 +29,8 @@ testIsLoading = $bindable(false), noEditor = false, scriptProgress = $bindable(undefined), - focusArg = undefined + focusArg = undefined, + onJobDone }: Props = $props() const { flowStore } = getContext('FlowEditorContext') @@ -46,6 +48,7 @@ bind:testIsLoading bind:scriptProgress bind:this={moduleTest} + {onJobDone} />
diff --git a/frontend/src/lib/components/ModulePreviewForm.svelte b/frontend/src/lib/components/ModulePreviewForm.svelte index 4c8c78e4e6..9c21d1e173 100644 --- a/frontend/src/lib/components/ModulePreviewForm.svelte +++ b/frontend/src/lib/components/ModulePreviewForm.svelte @@ -32,7 +32,7 @@ focusArg = undefined }: Props = $props() - const { testSteps, flowStateStore, flowStore, previewArgs } = + const { stepsInputArgs, flowStateStore, flowStore, previewArgs } = getContext('FlowEditorContext') let inputCheck: { [id: string]: boolean } = $state({}) @@ -45,12 +45,12 @@ let lkeys = Object.keys(schema?.properties ?? {}) if (schema?.properties && JSON.stringify(lkeys) != JSON.stringify(keys)) { keys = lkeys - untrack(() => testSteps?.removeExtraKey(mod.id, keys)) + untrack(() => stepsInputArgs?.removeExtraKey(mod.id, keys)) } }) function plugIt(argName: string) { - testSteps?.setEvaluatedStepArg( + stepsInputArgs?.setEvaluatedStepArg( mod.id, argName, $state.snapshot(evalValue(argName, mod, pickableProperties, true)) @@ -102,8 +102,8 @@ $effect.pre(() => { if (!initialized) { - if (testSteps) { - testSteps?.updateStepArgs(mod.id, flowStateStore.val, flowStore?.val, previewArgs?.val) + if (stepsInputArgs) { + stepsInputArgs?.updateStepArgs(mod.id, flowStateStore.val, flowStore?.val, previewArgs?.val) initialized = true } } @@ -130,8 +130,8 @@ label={argName} description={schema.properties[argName].description} bind:value={ - () => testSteps?.getStepInputArgs(mod.id, argName), - (v) => testSteps?.setStepInputArgs(mod.id, argName, v) + () => stepsInputArgs?.getStepInputArgs(mod.id, argName), + (v) => stepsInputArgs?.setStepInputArgs(mod.id, argName, v) } type={schema.properties[argName].type} oneOf={schema.properties[argName].oneOf} @@ -152,7 +152,7 @@ placeholder={schema.properties[argName].placeholder} /> {/if} - {#if testSteps?.isArgManuallySet(mod.id, argName)} + {#if stepsInputArgs?.isArgManuallySet(mod.id, argName)}
{:else if connectingData !== undefined || simpleViewer} + {:else if jsonView} + {#await import('$lib/components/JsonEditor.svelte')} {:then Module} @@ -653,12 +634,12 @@ class="h-full" /> {/await} - {:else if (mock?.enabled || preview == 'mock') && preview != 'job'} + {:else if (mock?.enabled || preview == 'mock') && preview != 'job' && !executingTestJob} + {#if fullResult}
{/if} {:else if selectedJob != undefined && (selectedJob.result_stream || selectedJob.type == 'CompletedJob')} + {#if fullResult}
{#key selectedJob} {/if} - {:else if !job} + {:else if !lastJob}

{customEmptyJobMessage ?? 'Test this step to see results'}{#if !disableMock} @@ -753,6 +734,47 @@ {/snippet} +{#snippet historyPicker()} + + {#snippet trigger()} +