diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b21f02d5d..29f5b49b55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.507.1](https://github.com/windmill-labs/windmill/compare/v1.507.0...v1.507.1) (2025-07-16) + + +### Bug Fixes + +* nested delete after use in flows ([#6194](https://github.com/windmill-labs/windmill/issues/6194)) ([8247a6c](https://github.com/windmill-labs/windmill/commit/8247a6c684ef57ea417771b3e34794c81c4b904a)) + ## [1.507.0](https://github.com/windmill-labs/windmill/compare/v1.506.0...v1.507.0) (2025-07-15) diff --git a/backend/.sqlx/query-4d66f509815a8af4b43abae7119ed377312a80ec08ca9a65cbb71a96ce5959b8.json b/backend/.sqlx/query-4d66f509815a8af4b43abae7119ed377312a80ec08ca9a65cbb71a96ce5959b8.json new file mode 100644 index 0000000000..1aa0e2a27b --- /dev/null +++ b/backend/.sqlx/query-4d66f509815a8af4b43abae7119ed377312a80ec08ca9a65cbb71a96ce5959b8.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE v2_job_status\n SET flow_status = JSONB_SET(flow_status, ARRAY['cleanup_module', 'flow_jobs_to_clean'], COALESCE(flow_status->'cleanup_module'->'flow_jobs_to_clean', '[]'::jsonb) || $1)\n WHERE id = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Jsonb", + "Uuid" + ] + }, + "nullable": [] + }, + "hash": "4d66f509815a8af4b43abae7119ed377312a80ec08ca9a65cbb71a96ce5959b8" +} diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 5c78cefddc..e95a7b9d82 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -746,9 +746,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-config" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c18d005c70d2b9c0c1ea8876c039db0ec7fb71164d25c73ccea21bf41fd02171" +checksum = "ebd9b83179adf8998576317ce47785948bcff399ec5b15f4dfbdedd44ddf5b92" dependencies = [ "aws-credential-types", "aws-runtime", @@ -811,9 +811,9 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.5.8" +version = "1.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f6c68419d8ba16d9a7463671593c54f81ba58cab466e9b759418da606dcc2e2" +checksum = "b2090e664216c78e766b6bac10fe74d2f451c02441d43484cd76ac9a295075f7" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -835,9 +835,9 @@ dependencies = [ [[package]] name = "aws-sdk-sqs" -version = "1.74.0" +version = "1.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256b8f7caffe3240a543f60409be9bba23038ceef5933da63e09d89197fc2333" +checksum = "7c27b0a5c8f9f8db35929bde0612d738d8c872ab887232579c61d73dba7a5d17" dependencies = [ "aws-credential-types", "aws-runtime", @@ -857,9 +857,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.74.0" +version = "1.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a69de9c1b9272da2872af60c7402683e7f45c06267735b4332deacb203239b" +checksum = "36d2a4d2753a2304cc0a86cff15581179c420c7b3054c0cbc884a2e497e79ae5" dependencies = [ "aws-credential-types", "aws-runtime", @@ -879,9 +879,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.75.0" +version = "1.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b161d836fac72bdd5ac1a4cd1cdc38ab888c7af26cfd95f661be4409505e63" +checksum = "719f007d6914388e2f14943c663447cfc44bb9d0478bb96df891258ba5145f82" dependencies = [ "aws-credential-types", "aws-runtime", @@ -901,9 +901,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.76.0" +version = "1.77.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb1cd79a3412751a341a28e2cd0d6fa4345241976da427b075a0c0cd5409f886" +checksum = "2efcc3dbb630f3e0d16a4f79fcd4b3fb1c59cb89f1031c46e44976f640b5de27" dependencies = [ "aws-credential-types", "aws-runtime", @@ -12721,9 +12721,9 @@ dependencies = [ [[package]] name = "systemstat" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668a4db78b439df482c238f559e4ea869017f9e62ef0a059c8bfcd841a4df544" +checksum = "5021f5184d44b26fb184acd689671bbe1e4bbd24bbdaa6bc7ec383fad32d2033" dependencies = [ "bytesize", "lazy_static", @@ -14676,7 +14676,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "axum", @@ -14728,7 +14728,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "argon2", @@ -14839,7 +14839,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.507.0" +version = "1.507.1" dependencies = [ "base64 0.22.1", "chrono", @@ -14854,7 +14854,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.507.0" +version = "1.507.1" dependencies = [ "chrono", "serde", @@ -14867,7 +14867,7 @@ dependencies = [ [[package]] name = "windmill-autoscaling" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "serde", @@ -14881,7 +14881,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "async-stream", @@ -14959,7 +14959,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.507.0" +version = "1.507.1" dependencies = [ "regex", "serde", @@ -14973,7 +14973,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "bytes", @@ -14996,7 +14996,7 @@ dependencies = [ [[package]] name = "windmill-macros" -version = "1.507.0" +version = "1.507.1" dependencies = [ "itertools 0.14.0", "lazy_static", @@ -15008,7 +15008,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.507.0" +version = "1.507.1" dependencies = [ "convert_case 0.6.0", "serde", @@ -15017,7 +15017,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "lazy_static", @@ -15029,7 +15029,7 @@ dependencies = [ [[package]] name = "windmill-parser-csharp" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "serde_json", @@ -15041,7 +15041,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "gosyn", @@ -15053,7 +15053,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "lazy_static", @@ -15065,7 +15065,7 @@ dependencies = [ [[package]] name = "windmill-parser-java" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "serde_json", @@ -15077,7 +15077,7 @@ dependencies = [ [[package]] name = "windmill-parser-nu" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "nu-parser", @@ -15088,7 +15088,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "itertools 0.14.0", @@ -15099,7 +15099,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "itertools 0.14.0", @@ -15111,7 +15111,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "async-recursion", @@ -15134,7 +15134,7 @@ dependencies = [ [[package]] name = "windmill-parser-rust" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -15151,7 +15151,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "lazy_static", @@ -15165,7 +15165,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "lazy_static", @@ -15183,7 +15183,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "getrandom 0.2.16", @@ -15207,7 +15207,7 @@ dependencies = [ [[package]] name = "windmill-parser-yaml" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "serde_json", @@ -15217,7 +15217,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "async-recursion", @@ -15250,7 +15250,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.507.0" +version = "1.507.1" dependencies = [ "wasm-bindgen", "wasm-bindgen-test", @@ -15260,7 +15260,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.507.0" +version = "1.507.1" dependencies = [ "anyhow", "async-recursion", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 7804c9b065..a0a79b8385 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.507.0" +version = "1.507.1" authors.workspace = true edition.workspace = true @@ -32,7 +32,7 @@ members = [ ] [workspace.package] -version = "1.507.0" +version = "1.507.1" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index a134b1bc9f..9e794fa7f0 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.507.0 + version: 1.507.1 title: Windmill API contact: diff --git a/backend/windmill-worker/src/worker_flow.rs b/backend/windmill-worker/src/worker_flow.rs index 9f25006ecc..c3228e2696 100644 --- a/backend/windmill-worker/src/worker_flow.rs +++ b/backend/windmill-worker/src/worker_flow.rs @@ -15,7 +15,8 @@ use crate::common::{cached_result_path, save_in_cache}; use crate::js_eval::{eval_timeout, IdContext}; use crate::worker_utils::get_tag_and_concurrency; use crate::{ - JobCompletedSender, PreviousResult, SameWorkerSender, SendResultPayload, UpdateFlow, KEEP_JOB_DIR + JobCompletedSender, PreviousResult, SameWorkerSender, SendResultPayload, UpdateFlow, + KEEP_JOB_DIR, }; use anyhow::Context; @@ -1191,7 +1192,25 @@ pub async fn update_flow_status_after_job_completion_internal( append_logs(&flow_job.id, w_id, logs, &db.into()).await; } #[cfg(feature = "enterprise")] - if flow_job.parent_job.is_none() { + if let Some(parent_job) = flow_job.parent_job { + // if has parent job, append flow cleanup modules to parent job + if !_cleanup_module.flow_jobs_to_clean.is_empty() { + let uuids_json = serde_json::to_value(&_cleanup_module.flow_jobs_to_clean) + .map_err(|e| { + error::Error::internal_err(format!("Unable to serialize uuids: {e:#}")) + })?; + sqlx::query!( + "UPDATE v2_job_status + SET flow_status = JSONB_SET(flow_status, ARRAY['cleanup_module', 'flow_jobs_to_clean'], COALESCE(flow_status->'cleanup_module'->'flow_jobs_to_clean', '[]'::jsonb) || $1) + WHERE id = $2", + uuids_json, + parent_job + ) + .execute(db) + .warn_after_seconds(3) + .await?; + } + } else { // run the cleanup step only when the root job is complete if !_cleanup_module.flow_jobs_to_clean.is_empty() { tracing::debug!( diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index b481a55c1d..bf488b171f 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.507.0"; +export const VERSION = "v1.507.1"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/cli/main.ts b/cli/main.ts index 2f78cb6c48..aae8ea4653 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -65,7 +65,7 @@ export { // } // }); -export const VERSION = "1.507.0"; +export const VERSION = "1.507.1"; const command = new Command() .name("wmill") diff --git a/cli/sync.ts b/cli/sync.ts index 6b8a0d12f4..8ac9306a11 100644 --- a/cli/sync.ts +++ b/cli/sync.ts @@ -81,9 +81,15 @@ function mergeCliWithEffectiveOptions { + dfs(flowStore.val.value.modules, async (mod) => { if (mod.id == selectedIdStore) { if ( mod.value.type == 'rawscript' || @@ -579,6 +579,7 @@ untrack(() => initializeMode()) }) $effect(() => { + readFieldsRecursively(flowStore.val) flowStore.val && untrack(() => updateFlow(flowStore.val)) }) $effect(() => { diff --git a/frontend/src/lib/components/Editor.svelte b/frontend/src/lib/components/Editor.svelte index bd1eba2a80..450f26f583 100644 --- a/frontend/src/lib/components/Editor.svelte +++ b/frontend/src/lib/components/Editor.svelte @@ -1273,11 +1273,14 @@ editor?.onDidFocusEditorText(() => { dispatch('focus') - editor?.addCommand(KeyCode.Escape, function () { - if (showInlineAIChat) { - closeAIInlineWidget() + // for escape we use onkeydown instead of addCommand because addCommand on escape specifically prevents default behavior (like autocomplete cancellation) + editor?.onKeyDown((e) => { + if (e.keyCode === KeyCode.Escape) { + if (showInlineAIChat) { + closeAIInlineWidget() + } + aiChatEditorHandler?.rejectAll() } - aiChatEditorHandler?.rejectAll() }) editor?.addCommand(KeyMod.CtrlCmd | KeyCode.DownArrow, function () { diff --git a/frontend/src/lib/components/copilot/autocomplete/Autocompletor.ts b/frontend/src/lib/components/copilot/autocomplete/Autocompletor.ts index 3000271a5b..729c003691 100644 --- a/frontend/src/lib/components/copilot/autocomplete/Autocompletor.ts +++ b/frontend/src/lib/components/copilot/autocomplete/Autocompletor.ts @@ -11,14 +11,27 @@ type CacheCompletion = { column: number } -function filterCompletion(completion: string, suffix: string): string | undefined { +function filterCompletion( + completion: string, + suffix: string, + shouldReturnMultiline: boolean +): string | undefined { const trimmedCompletion = completion.replaceAll('\n', '') const trimmedSuffix = suffix.slice(0, FIM_MAX_TOKENS).replaceAll('\n', '') if (trimmedSuffix.startsWith(trimmedCompletion)) { - console.log('suffix starts with completion', suffix, completion) return } + + if (!shouldReturnMultiline) { + if (completion.startsWith('\n')) { + // TODO improve cache for this case so that we can use cache when accepting the first line of a multiline completion which starts with \n + return completion.split('\n').slice(0, 2).join('\n') + } else { + return completion.split('\n').slice(0, 1).join('\n') + } + } + return completion } @@ -48,10 +61,17 @@ export class Autocompletor { ) { return { items: [] } } + + const shouldReturnMultiline = this.#shouldReturnMultiline(model, position) + const result = await this.#autocomplete(model, position) if (result) { - const completion = filterCompletion(result.completion, result.suffix) + const completion = filterCompletion( + result.completion, + result.suffix, + shouldReturnMultiline + ) if (!completion) { return { items: [] } @@ -112,6 +132,19 @@ export class Autocompletor { this.#cursorDisposable.dispose() } + #shouldReturnMultiline(model: meditor.ITextModel, position: Position) { + if (position.column === model.getLineMaxColumn(position.lineNumber)) { + const cachedCompletion = this.#cache.get(position.lineNumber) + if (cachedCompletion) { + const firstCachedLine = + cachedCompletion.linePrefix + cachedCompletion.completion.split('\n')[0] + const lineContent = model.getLineContent(position.lineNumber) + return firstCachedLine === lineContent + } + } + return false + } + async #autocomplete( model: meditor.ITextModel, position: Position @@ -155,14 +188,12 @@ export class Autocompletor { const modifiedCompletion = cachedCompletion.completion.slice( position.column - cachedCompletion.column ) - console.debug('autocomplete partial cache hit', modifiedCompletion) return { completion: modifiedCompletion, suffix } } } else if ( position.column === cachedCompletion.column && cachedCompletion.linePrefix === linePrefix ) { - console.debug('autocomplete exact cache hit', cachedCompletion.completion) return { completion: cachedCompletion.completion, suffix } } } diff --git a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte index be50aa1cce..a27f7c3c19 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte @@ -12,6 +12,7 @@ import Markdown from 'svelte-exmarkdown' import { aiChatManager, AIMode } from './AIChatManager.svelte' import AIChatInput from './AIChatInput.svelte' + import { getModifierKey } from '$lib/utils' let { messages, @@ -160,6 +161,13 @@ {@render headerRight?.()} + {#if messages.length === 0} + You can use {getModifierKey()}L to open or close this chat, and {getModifierKey()}K in the + script editor to modify selected lines. + {/if} + {#if messages.length > 0}
1) { + lines = lines.slice(0, -1) + } else { + lines = [] + } } + + lines = lines.slice(0, FIM_MAX_LINES) + + return lines.join('\n') } else { return undefined } diff --git a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte index cfd666661e..63fc2c88ab 100644 --- a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte +++ b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte @@ -482,6 +482,7 @@ outline-[1px] outline dark:outline-gray-500 outline-gray-300 bg-surface duration onclick={stopPropagation( preventDefault((event) => dispatch('delete', { id, type: modType })) )} + onpointerdown={stopPropagation(preventDefault(() => {}))} > diff --git a/lsp/Pipfile b/lsp/Pipfile index 5cb7938d52..fc372bb3a5 100644 --- a/lsp/Pipfile +++ b/lsp/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -wmill = ">=1.507.0" -wmill_pg = ">=1.507.0" +wmill = ">=1.507.1" +wmill_pg = ">=1.507.1" sendgrid = "*" mysql-connector-python = "*" pymongo = "*" diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index 5a0a7a8c19..3eb17a5326 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.507.0 + version: 1.507.1 title: OpenFlow Spec contact: name: Ruben Fiszel diff --git a/powershell-client/WindmillClient/WindmillClient.psd1 b/powershell-client/WindmillClient/WindmillClient.psd1 index ece41e2e64..c5033eb071 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.507.0' + ModuleVersion = '1.507.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index 27478df074..a5760b2f56 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill" -version = "1.507.0" +version = "1.507.1" 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 f24614da2e..987e5ec3a9 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.507.0" +version = "1.507.1" 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 18241268b6..6f071b168b 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,6 +1,6 @@ { "name": "@windmill/windmill", - "version": "1.507.0", + "version": "1.507.1", "exports": "./src/index.ts", "publish": { "exclude": ["!src", "./s3Types.ts", "./client.ts"] diff --git a/typescript-client/package.json b/typescript-client/package.json index 28372b1880..1417a4f461 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.507.0", + "version": "1.507.1", "author": "Ruben Fiszel", "license": "Apache 2.0", "devDependencies": { diff --git a/version.txt b/version.txt index 3e9f5d6e13..0f5f07a749 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.507.0 +1.507.1