From e3ff8bee3d1e36c5ed1ea4982e8c6e02e24f7b50 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 10 Nov 2026 09:23:10 +0000 Subject: [PATCH 01/10] fix: never break running flows when their flow is deleted (#12306) * fix: report the real error when a flow's stored version cannot be loaded A flow step that completes on a worker without the flow version cached looked it up, failed (e.g. the flow was deleted, cascading its versions), then fell back to the preview path, whose 'Job isn't a flow job' error replaced the real one. Keep the stored lookup's error when the job has no inline flow. Co-Authored-By: Claude Opus 5.5 * fix: keep a flow's nodes when it is renamed Renaming a flow moved its versions to the new path but left its flow nodes on the old one, so deleting the old flow row cascaded them away. Runs in flight inside a loop or branch then failed loading their body. Co-Authored-By: Claude Opus 5.5 * fix: keep a deleted flow's versions until its runs are done Deleting a flow cascaded its flow_version and flow_node rows away, so runs in flight failed at their next step. The cascade is dropped; the rows are purged when the flow leaves the trash, unless a run of it is still queued, in which case they are kept. Workspace deletion deletes them explicitly, and the version history only lists the current flow's versions. Co-Authored-By: Claude Opus 5.5 * fix: scope moves, reads and the purge to a flow's own versions A deleted flow's versions now survive at its path, so rename, user rename, offboarding, fork cloning, version reads, history and the trash purge only act on the ids the live flow lists. Renames skip nodes already present at the destination with the same content, nodes are no longer purged (they are shared by content and referenced by id), and dependency relocks skip flows that no longer exist. Co-Authored-By: Claude Opus 5.5 * fix: resolve a flow's latest version among the live flow's own The relock checks and the dependents trigger picked the newest version at the path, which can now be a deleted flow's. Restore the shared query's cache entry under its new text. Co-Authored-By: Claude Opus 5.5 * fix: set a deleted flow's versions aside instead of scoping every lookup Deleting a flow moves its versions to __deleted/; restoring moves them back. Jobs load versions by id so runs in flight keep working, while every lookup by path (history, relocks, versioned runs, renames) stops seeing a deleted flow without special-casing. The purge keeps a set-aside version any queued job references by id, whatever path or kind it was queued under. The per-lookup scoping is reverted. Co-Authored-By: Claude Opus 5.5 * style: rustfmt Co-Authored-By: Claude Opus 5.5 * fix: set versions aside only after an authorized delete, find flow_env by id Row-level security can let a caller read a flow it may not delete; the delete then removes nothing and must not trash it or move its versions. fetch_root_flow_env matched a run's version by path too, so runs of a deleted (or renamed) flow lost their inherited flow_env: match by id for the kinds whose runnable_id is a flow version. Co-Authored-By: Claude Opus 5.5 * docs: state the authorization contract of the version set-aside helpers Co-Authored-By: Claude Opus 5.5 * perf: read the queue once when purging a deleted flow's versions Co-Authored-By: Claude Opus 5.5 * fix: serialize flow version writes with a concurrent flow delete Co-Authored-By: Claude Opus 5.5 * fix: make the relock copy wait for a concurrent flow rename Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- ...0eb31e21c1f7b23210bc65595a86b53c2908d.json | 24 +++++ ...7d51895cc0f1294be9e5ad106ea4de8cbb2b5.json | 16 --- ...5a9108b6f32490cb61b14de71102bb305f71d.json | 24 ----- ...6fdeb22714af38162e87c02b052a5b8ec2645.json | 15 --- ...28e8d181651d7a4324c5b42c34de5b747ab95.json | 14 +++ ...3d6cdd6a5a399a3a026ade25ac1bdb8a8c9b.json} | 4 +- ...01741955502c9345e82a9b7fbbf3d3c7ab517.json | 12 --- ...8493a674bcad0f0a4900323475f68d549c79c.json | 24 +++++ ...43f8c19ba123fab9abccba5be75b0e677964.json} | 4 +- ...54c7ce282621ef23ae0b8427b98474b41fef.json} | 4 +- ...c0442e976e96f13721ffdd63f0739fce516cd.json | 16 +++ ...052fcd350bd47ee4f63832448b6e6f0f472f0.json | 24 ----- ...40ad9224be03c4033f0bab943fb78e92ff57.json} | 4 +- ...keep_flow_versions_on_flow_delete.down.sql | 6 ++ ...7_keep_flow_versions_on_flow_delete.up.sql | 5 + backend/windmill-api-flows/src/flows.rs | 33 +++++-- .../windmill-api-workspaces/src/workspaces.rs | 1 + .../src/workspaces_extra.rs | 6 ++ backend/windmill-api/src/offboarding.rs | 2 +- backend/windmill-api/src/trash.rs | 2 + backend/windmill-api/src/users.rs | 2 +- backend/windmill-common/src/trashbin.rs | 98 +++++++++++++++---- .../tests/deleted_flow_versions.rs | 58 +++++++++++ backend/windmill-queue/src/jobs.rs | 41 +++++--- backend/windmill-worker/src/worker_flow.rs | 10 +- 25 files changed, 301 insertions(+), 148 deletions(-) create mode 100644 backend/.sqlx/query-0deba337ceb95584bfd4fa280310eb31e21c1f7b23210bc65595a86b53c2908d.json delete mode 100644 backend/.sqlx/query-120756fe619d9497cb2cf0a40687d51895cc0f1294be9e5ad106ea4de8cbb2b5.json delete mode 100644 backend/.sqlx/query-14c2784a68f06e7349941671abe5a9108b6f32490cb61b14de71102bb305f71d.json delete mode 100644 backend/.sqlx/query-1d995dd5a094631ae96c16d68026fdeb22714af38162e87c02b052a5b8ec2645.json create mode 100644 backend/.sqlx/query-29fba245ac4b45d904ee50f424828e8d181651d7a4324c5b42c34de5b747ab95.json rename backend/.sqlx/{query-bae31609123da68d16bea8e0f1c4624403b6f97e13f13f056501fe2f4efb0f06.json => query-2d2a3beec12407c9a7ff29ad83a03d6cdd6a5a399a3a026ade25ac1bdb8a8c9b.json} (53%) delete mode 100644 backend/.sqlx/query-3453c0b7dd3c4d2c9bc639f379901741955502c9345e82a9b7fbbf3d3c7ab517.json create mode 100644 backend/.sqlx/query-5e312a063a660a1d4da462b8d6e8493a674bcad0f0a4900323475f68d549c79c.json rename backend/.sqlx/{query-ed12d54e9cdc18672bbb34d2500adc18b72323e06a1f32e7a1a7589649888927.json => query-6842391724392d3244f98c8fb8d443f8c19ba123fab9abccba5be75b0e677964.json} (50%) rename backend/.sqlx/{query-d1a33665e47e10c4f992e018e234496935fc3415c7aa00642626494a2940cdf2.json => query-6cdd377dc2987bd46604b187ce7a54c7ce282621ef23ae0b8427b98474b41fef.json} (51%) create mode 100644 backend/.sqlx/query-72597c62d560fcb8604eb5307bbc0442e976e96f13721ffdd63f0739fce516cd.json delete mode 100644 backend/.sqlx/query-a6a973dcd92d2e40fd9a1c1be42052fcd350bd47ee4f63832448b6e6f0f472f0.json rename backend/.sqlx/{query-c98a28cdeced035b21b8893041c4f94e2564a609eb5b8b9c562a0dbded4d5b96.json => query-b840d72656c29477d2c4554d24aa40ad9224be03c4033f0bab943fb78e92ff57.json} (85%) create mode 100644 backend/migrations/20261109211607_keep_flow_versions_on_flow_delete.down.sql create mode 100644 backend/migrations/20261109211607_keep_flow_versions_on_flow_delete.up.sql create mode 100644 backend/windmill-common/tests/deleted_flow_versions.rs diff --git a/backend/.sqlx/query-0deba337ceb95584bfd4fa280310eb31e21c1f7b23210bc65595a86b53c2908d.json b/backend/.sqlx/query-0deba337ceb95584bfd4fa280310eb31e21c1f7b23210bc65595a86b53c2908d.json new file mode 100644 index 0000000000..a86c4392ef --- /dev/null +++ b/backend/.sqlx/query-0deba337ceb95584bfd4fa280310eb31e21c1f7b23210bc65595a86b53c2908d.json @@ -0,0 +1,24 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO flow_version\n (workspace_id, path, value, schema, created_by)\n\n SELECT v.workspace_id, v.path, v.value, v.schema, v.created_by\n FROM flow_version v\n JOIN flow f ON f.workspace_id = v.workspace_id AND f.path = v.path\n WHERE v.path = $1 AND v.workspace_id = $2 AND v.id = $3\n FOR SHARE OF f\n\n RETURNING id\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Text", + "Text", + "Int8" + ] + }, + "nullable": [ + false + ] + }, + "hash": "0deba337ceb95584bfd4fa280310eb31e21c1f7b23210bc65595a86b53c2908d" +} diff --git a/backend/.sqlx/query-120756fe619d9497cb2cf0a40687d51895cc0f1294be9e5ad106ea4de8cbb2b5.json b/backend/.sqlx/query-120756fe619d9497cb2cf0a40687d51895cc0f1294be9e5ad106ea4de8cbb2b5.json deleted file mode 100644 index 0c15cfc5f9..0000000000 --- a/backend/.sqlx/query-120756fe619d9497cb2cf0a40687d51895cc0f1294be9e5ad106ea4de8cbb2b5.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "UPDATE flow_node SET path = $1 WHERE path = $2 AND workspace_id = $3", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "120756fe619d9497cb2cf0a40687d51895cc0f1294be9e5ad106ea4de8cbb2b5" -} diff --git a/backend/.sqlx/query-14c2784a68f06e7349941671abe5a9108b6f32490cb61b14de71102bb305f71d.json b/backend/.sqlx/query-14c2784a68f06e7349941671abe5a9108b6f32490cb61b14de71102bb305f71d.json deleted file mode 100644 index d7ef4e04e0..0000000000 --- a/backend/.sqlx/query-14c2784a68f06e7349941671abe5a9108b6f32490cb61b14de71102bb305f71d.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH RECURSIVE chain(id, parent_job, flow_innermost_root_job, runnable_id, runnable_path, raw_flow, depth) AS (\n SELECT id, parent_job, flow_innermost_root_job, runnable_id, runnable_path, raw_flow, 0\n FROM v2_job\n WHERE id = $1 AND workspace_id = $2\n UNION ALL\n SELECT j.id, j.parent_job, j.flow_innermost_root_job, j.runnable_id, j.runnable_path, j.raw_flow, c.depth + 1\n FROM v2_job j\n JOIN chain c\n ON j.id = COALESCE(c.flow_innermost_root_job, c.parent_job)\n WHERE j.workspace_id = $2 AND c.depth < $3\n )\n SELECT\n CASE\n WHEN flow_version.id IS NOT NULL THEN\n flow_version.value -> 'flow_env'\n ELSE\n chain.raw_flow -> 'flow_env'\n END AS \"flow_env: Json>>\"\n FROM chain\n LEFT JOIN flow_version\n ON flow_version.id = chain.runnable_id\n AND flow_version.path = chain.runnable_path\n AND flow_version.workspace_id = $2\n WHERE (CASE\n WHEN flow_version.id IS NOT NULL THEN flow_version.value -> 'flow_env'\n ELSE chain.raw_flow -> 'flow_env'\n END) IS NOT NULL\n ORDER BY chain.depth ASC\n LIMIT 1", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "flow_env: Json>>", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Text", - "Int4" - ] - }, - "nullable": [ - null - ] - }, - "hash": "14c2784a68f06e7349941671abe5a9108b6f32490cb61b14de71102bb305f71d" -} diff --git a/backend/.sqlx/query-1d995dd5a094631ae96c16d68026fdeb22714af38162e87c02b052a5b8ec2645.json b/backend/.sqlx/query-1d995dd5a094631ae96c16d68026fdeb22714af38162e87c02b052a5b8ec2645.json deleted file mode 100644 index 4ae3cea3ff..0000000000 --- a/backend/.sqlx/query-1d995dd5a094631ae96c16d68026fdeb22714af38162e87c02b052a5b8ec2645.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM trashbin WHERE workspace_id = $1 AND id = $2", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Int8" - ] - }, - "nullable": [] - }, - "hash": "1d995dd5a094631ae96c16d68026fdeb22714af38162e87c02b052a5b8ec2645" -} diff --git a/backend/.sqlx/query-29fba245ac4b45d904ee50f424828e8d181651d7a4324c5b42c34de5b747ab95.json b/backend/.sqlx/query-29fba245ac4b45d904ee50f424828e8d181651d7a4324c5b42c34de5b747ab95.json new file mode 100644 index 0000000000..e01828cb4e --- /dev/null +++ b/backend/.sqlx/query-29fba245ac4b45d904ee50f424828e8d181651d7a4324c5b42c34de5b747ab95.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM flow_version WHERE workspace_id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "29fba245ac4b45d904ee50f424828e8d181651d7a4324c5b42c34de5b747ab95" +} diff --git a/backend/.sqlx/query-bae31609123da68d16bea8e0f1c4624403b6f97e13f13f056501fe2f4efb0f06.json b/backend/.sqlx/query-2d2a3beec12407c9a7ff29ad83a03d6cdd6a5a399a3a026ade25ac1bdb8a8c9b.json similarity index 53% rename from backend/.sqlx/query-bae31609123da68d16bea8e0f1c4624403b6f97e13f13f056501fe2f4efb0f06.json rename to backend/.sqlx/query-2d2a3beec12407c9a7ff29ad83a03d6cdd6a5a399a3a026ade25ac1bdb8a8c9b.json index bc0cc1a797..9eff1da00a 100644 --- a/backend/.sqlx/query-bae31609123da68d16bea8e0f1c4624403b6f97e13f13f056501fe2f4efb0f06.json +++ b/backend/.sqlx/query-2d2a3beec12407c9a7ff29ad83a03d6cdd6a5a399a3a026ade25ac1bdb8a8c9b.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "DELETE FROM trashbin WHERE workspace_id = $1", + "query": "DELETE FROM flow_node WHERE workspace_id = $1", "describe": { "columns": [], "parameters": { @@ -10,5 +10,5 @@ }, "nullable": [] }, - "hash": "bae31609123da68d16bea8e0f1c4624403b6f97e13f13f056501fe2f4efb0f06" + "hash": "2d2a3beec12407c9a7ff29ad83a03d6cdd6a5a399a3a026ade25ac1bdb8a8c9b" } diff --git a/backend/.sqlx/query-3453c0b7dd3c4d2c9bc639f379901741955502c9345e82a9b7fbbf3d3c7ab517.json b/backend/.sqlx/query-3453c0b7dd3c4d2c9bc639f379901741955502c9345e82a9b7fbbf3d3c7ab517.json deleted file mode 100644 index 5893b08c81..0000000000 --- a/backend/.sqlx/query-3453c0b7dd3c4d2c9bc639f379901741955502c9345e82a9b7fbbf3d3c7ab517.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM trashbin WHERE expires_at <= now()", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "3453c0b7dd3c4d2c9bc639f379901741955502c9345e82a9b7fbbf3d3c7ab517" -} diff --git a/backend/.sqlx/query-5e312a063a660a1d4da462b8d6e8493a674bcad0f0a4900323475f68d549c79c.json b/backend/.sqlx/query-5e312a063a660a1d4da462b8d6e8493a674bcad0f0a4900323475f68d549c79c.json new file mode 100644 index 0000000000..46c47084d7 --- /dev/null +++ b/backend/.sqlx/query-5e312a063a660a1d4da462b8d6e8493a674bcad0f0a4900323475f68d549c79c.json @@ -0,0 +1,24 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH RECURSIVE chain(id, parent_job, flow_innermost_root_job, runnable_id, kind, raw_flow, depth) AS (\n SELECT id, parent_job, flow_innermost_root_job, runnable_id, kind, raw_flow, 0\n FROM v2_job\n WHERE id = $1 AND workspace_id = $2\n UNION ALL\n SELECT j.id, j.parent_job, j.flow_innermost_root_job, j.runnable_id, j.kind, j.raw_flow, c.depth + 1\n FROM v2_job j\n JOIN chain c\n ON j.id = COALESCE(c.flow_innermost_root_job, c.parent_job)\n WHERE j.workspace_id = $2 AND c.depth < $3\n )\n SELECT\n CASE\n WHEN flow_version.id IS NOT NULL THEN\n flow_version.value -> 'flow_env'\n ELSE\n chain.raw_flow -> 'flow_env'\n END AS \"flow_env: Json>>\"\n FROM chain\n LEFT JOIN flow_version\n ON flow_version.id = chain.runnable_id\n AND chain.kind IN ('flow', 'unassigned_flow')\n AND flow_version.workspace_id = $2\n WHERE (CASE\n WHEN flow_version.id IS NOT NULL THEN flow_version.value -> 'flow_env'\n ELSE chain.raw_flow -> 'flow_env'\n END) IS NOT NULL\n ORDER BY chain.depth ASC\n LIMIT 1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "flow_env: Json>>", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Text", + "Int4" + ] + }, + "nullable": [ + null + ] + }, + "hash": "5e312a063a660a1d4da462b8d6e8493a674bcad0f0a4900323475f68d549c79c" +} diff --git a/backend/.sqlx/query-ed12d54e9cdc18672bbb34d2500adc18b72323e06a1f32e7a1a7589649888927.json b/backend/.sqlx/query-6842391724392d3244f98c8fb8d443f8c19ba123fab9abccba5be75b0e677964.json similarity index 50% rename from backend/.sqlx/query-ed12d54e9cdc18672bbb34d2500adc18b72323e06a1f32e7a1a7589649888927.json rename to backend/.sqlx/query-6842391724392d3244f98c8fb8d443f8c19ba123fab9abccba5be75b0e677964.json index 0088122f66..7c6ee69fae 100644 --- a/backend/.sqlx/query-ed12d54e9cdc18672bbb34d2500adc18b72323e06a1f32e7a1a7589649888927.json +++ b/backend/.sqlx/query-6842391724392d3244f98c8fb8d443f8c19ba123fab9abccba5be75b0e677964.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "UPDATE flow_node SET path = REGEXP_REPLACE(path,'u/' || $2 || '/(.*)','u/' || $1 || '/\\1') WHERE path LIKE ('u/' || $2 || '/%') AND workspace_id = $3", + "query": "UPDATE flow_node SET path = REGEXP_REPLACE(path,'u/' || $2 || '/(.*)','u/' || $1 || '/\\1') WHERE path LIKE ('u/' || $2 || '/%') AND workspace_id = $3 AND NOT EXISTS (SELECT 1 FROM flow_node d WHERE d.workspace_id = $3 AND d.hash_v2 = flow_node.hash_v2 AND d.path = REGEXP_REPLACE(flow_node.path,'u/' || $2 || '/(.*)','u/' || $1 || '/\\1'))", "describe": { "columns": [], "parameters": { @@ -12,5 +12,5 @@ }, "nullable": [] }, - "hash": "ed12d54e9cdc18672bbb34d2500adc18b72323e06a1f32e7a1a7589649888927" + "hash": "6842391724392d3244f98c8fb8d443f8c19ba123fab9abccba5be75b0e677964" } diff --git a/backend/.sqlx/query-d1a33665e47e10c4f992e018e234496935fc3415c7aa00642626494a2940cdf2.json b/backend/.sqlx/query-6cdd377dc2987bd46604b187ce7a54c7ce282621ef23ae0b8427b98474b41fef.json similarity index 51% rename from backend/.sqlx/query-d1a33665e47e10c4f992e018e234496935fc3415c7aa00642626494a2940cdf2.json rename to backend/.sqlx/query-6cdd377dc2987bd46604b187ce7a54c7ce282621ef23ae0b8427b98474b41fef.json index 08862eab8a..bfe83cdb18 100644 --- a/backend/.sqlx/query-d1a33665e47e10c4f992e018e234496935fc3415c7aa00642626494a2940cdf2.json +++ b/backend/.sqlx/query-6cdd377dc2987bd46604b187ce7a54c7ce282621ef23ae0b8427b98474b41fef.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "UPDATE flow_node SET path = REGEXP_REPLACE(path, 'u/' || $2 || '/(.*)', $1 || '/\\1') WHERE path LIKE ('u/' || $2 || '/%') AND workspace_id = $3", + "query": "UPDATE flow_node SET path = REGEXP_REPLACE(path, 'u/' || $2 || '/(.*)', $1 || '/\\1') WHERE path LIKE ('u/' || $2 || '/%') AND workspace_id = $3 AND NOT EXISTS (SELECT 1 FROM flow_node d WHERE d.workspace_id = $3 AND d.hash_v2 = flow_node.hash_v2 AND d.path = REGEXP_REPLACE(flow_node.path, 'u/' || $2 || '/(.*)', $1 || '/\\1'))", "describe": { "columns": [], "parameters": { @@ -12,5 +12,5 @@ }, "nullable": [] }, - "hash": "d1a33665e47e10c4f992e018e234496935fc3415c7aa00642626494a2940cdf2" + "hash": "6cdd377dc2987bd46604b187ce7a54c7ce282621ef23ae0b8427b98474b41fef" } diff --git a/backend/.sqlx/query-72597c62d560fcb8604eb5307bbc0442e976e96f13721ffdd63f0739fce516cd.json b/backend/.sqlx/query-72597c62d560fcb8604eb5307bbc0442e976e96f13721ffdd63f0739fce516cd.json new file mode 100644 index 0000000000..af1f7a0277 --- /dev/null +++ b/backend/.sqlx/query-72597c62d560fcb8604eb5307bbc0442e976e96f13721ffdd63f0739fce516cd.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE flow_node n SET path = $1 WHERE path = $2 AND workspace_id = $3\n AND NOT EXISTS (\n SELECT 1 FROM flow_node d\n WHERE d.path = $1 AND d.workspace_id = $3 AND d.hash_v2 = n.hash_v2\n )", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "72597c62d560fcb8604eb5307bbc0442e976e96f13721ffdd63f0739fce516cd" +} diff --git a/backend/.sqlx/query-a6a973dcd92d2e40fd9a1c1be42052fcd350bd47ee4f63832448b6e6f0f472f0.json b/backend/.sqlx/query-a6a973dcd92d2e40fd9a1c1be42052fcd350bd47ee4f63832448b6e6f0f472f0.json deleted file mode 100644 index 1c396d38fd..0000000000 --- a/backend/.sqlx/query-a6a973dcd92d2e40fd9a1c1be42052fcd350bd47ee4f63832448b6e6f0f472f0.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO flow_version\n (workspace_id, path, value, schema, created_by)\n\n SELECT workspace_id, path, value, schema, created_by\n FROM flow_version WHERE path = $1 AND workspace_id = $2 AND id = $3\n\n RETURNING id\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Text", - "Text", - "Int8" - ] - }, - "nullable": [ - false - ] - }, - "hash": "a6a973dcd92d2e40fd9a1c1be42052fcd350bd47ee4f63832448b6e6f0f472f0" -} diff --git a/backend/.sqlx/query-c98a28cdeced035b21b8893041c4f94e2564a609eb5b8b9c562a0dbded4d5b96.json b/backend/.sqlx/query-b840d72656c29477d2c4554d24aa40ad9224be03c4033f0bab943fb78e92ff57.json similarity index 85% rename from backend/.sqlx/query-c98a28cdeced035b21b8893041c4f94e2564a609eb5b8b9c562a0dbded4d5b96.json rename to backend/.sqlx/query-b840d72656c29477d2c4554d24aa40ad9224be03c4033f0bab943fb78e92ff57.json index ed68e38b67..5f4a77bf9f 100644 --- a/backend/.sqlx/query-c98a28cdeced035b21b8893041c4f94e2564a609eb5b8b9c562a0dbded4d5b96.json +++ b/backend/.sqlx/query-b840d72656c29477d2c4554d24aa40ad9224be03c4033f0bab943fb78e92ff57.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT id, workspace_id, path, value, schema, created_by, created_at\n FROM flow_version\n WHERE workspace_id = $1\n ORDER BY path, created_at", + "query": "SELECT id, workspace_id, path, value, schema, created_by, created_at\n FROM flow_version\n WHERE workspace_id = $1\n AND NOT starts_with(path, '__deleted/')\n ORDER BY path, created_at", "describe": { "columns": [ { @@ -54,5 +54,5 @@ false ] }, - "hash": "c98a28cdeced035b21b8893041c4f94e2564a609eb5b8b9c562a0dbded4d5b96" + "hash": "b840d72656c29477d2c4554d24aa40ad9224be03c4033f0bab943fb78e92ff57" } diff --git a/backend/migrations/20261109211607_keep_flow_versions_on_flow_delete.down.sql b/backend/migrations/20261109211607_keep_flow_versions_on_flow_delete.down.sql new file mode 100644 index 0000000000..8446a88527 --- /dev/null +++ b/backend/migrations/20261109211607_keep_flow_versions_on_flow_delete.down.sql @@ -0,0 +1,6 @@ +DELETE FROM flow_version v +WHERE NOT EXISTS (SELECT 1 FROM flow f WHERE f.workspace_id = v.workspace_id AND f.path = v.path); +ALTER TABLE flow_version ADD CONSTRAINT flow_version_workspace_id_path_fkey + FOREIGN KEY (workspace_id, path) REFERENCES flow (workspace_id, path) ON DELETE CASCADE; +-- flow_node's constraint is not restored: a node left at a deleted flow's path can be +-- shared by content with a live flow's versions, so deleting orphans could break that flow. diff --git a/backend/migrations/20261109211607_keep_flow_versions_on_flow_delete.up.sql b/backend/migrations/20261109211607_keep_flow_versions_on_flow_delete.up.sql new file mode 100644 index 0000000000..e28682a114 --- /dev/null +++ b/backend/migrations/20261109211607_keep_flow_versions_on_flow_delete.up.sql @@ -0,0 +1,5 @@ +-- A deleted flow's versions and nodes outlive its row so that runs in flight can finish: +-- its versions are set aside (trashbin::set_aside_flow_versions) and purged with its trash +-- entry, its nodes stay until the workspace is deleted. +ALTER TABLE flow_version DROP CONSTRAINT IF EXISTS flow_version_workspace_id_path_fkey; +ALTER TABLE flow_node DROP CONSTRAINT IF EXISTS flow_node_path_workspace_id_fkey; diff --git a/backend/windmill-api-flows/src/flows.rs b/backend/windmill-api-flows/src/flows.rs index bd4e90ba37..d4a4211f1c 100644 --- a/backend/windmill-api-flows/src/flows.rs +++ b/backend/windmill-api-flows/src/flows.rs @@ -1366,7 +1366,9 @@ async fn update_flow( windmill_common::feature_usage::log_feature_usage("job_token_scopes", "deploy", "step:set"); } - sqlx::query!( + // A version is inserted at the path below and nothing else ties it to a live flow: one + // written for a flow deleted meanwhile would surface in a flow recreated there. + let updated = sqlx::query!( " UPDATE flow @@ -1412,7 +1414,11 @@ async fn update_flow( .await .map_err(|e| { error::Error::internal_err(format!("Error updating flow due to flow update: {e:#}")) - })?; + })? + .rows_affected(); + if updated == 0 { + return Err(Error::NotFound(format!("Flow {flow_path} not found"))); + } if set_job_token_scopes { windmill_common::scopes::log_job_token_scopes_deploy("flow", job_token_scopes.as_deref()); } @@ -1449,10 +1455,14 @@ async fn update_flow( )) })?; - // Flow nodes cascade on the old path's deletion below; runs in flight and the - // versions just moved still reference them. + // Nodes are referenced by id, so moving them only keeps them deduplicated at the new + // path. One a deleted flow left there with the same content stays where it is. sqlx::query!( - "UPDATE flow_node SET path = $1 WHERE path = $2 AND workspace_id = $3", + "UPDATE flow_node n SET path = $1 WHERE path = $2 AND workspace_id = $3 + AND NOT EXISTS ( + SELECT 1 FROM flow_node d + WHERE d.path = $1 AND d.workspace_id = $3 AND d.hash_v2 = n.hash_v2 + )", nf.path, flow_path, w_id @@ -2152,7 +2162,6 @@ async fn delete_flow_by_path( } let mut tx = user_db.begin(&authed).await?; - // Capture all related data for trashbin before deleting (CASCADE will remove flow_version, flow_node) let trash_flow: Option = sqlx::query_scalar("SELECT to_jsonb(t) FROM flow t WHERE path = $1 AND workspace_id = $2") .bind(path) @@ -2192,15 +2201,18 @@ async fn delete_flow_by_path( .execute(&mut *tx) .await?; - sqlx::query!( + let deleted = sqlx::query!( "DELETE FROM flow WHERE path = $1 AND workspace_id = $2", path, &w_id ) .execute(&mut *tx) - .await?; + .await? + .rows_affected(); - if let Some(flow_data) = trash_flow { + // Row-level security can let a caller read a flow it may not delete; its versions must + // then stay where they are. + if let Some(flow_data) = trash_flow.filter(|_| deleted > 0) { let mut trash_data = serde_json::json!({"row": flow_data}); if !trash_flow_versions.is_empty() { trash_data["flow_versions"] = serde_json::Value::Array(trash_flow_versions); @@ -2211,7 +2223,7 @@ async fn delete_flow_by_path( if !trash_drafts.is_empty() { trash_data["drafts"] = serde_json::Value::Array(trash_drafts); } - windmill_common::trashbin::move_to_trash( + let trash_id = windmill_common::trashbin::move_to_trash( &mut *tx, &w_id, "flow", @@ -2220,6 +2232,7 @@ async fn delete_flow_by_path( &authed.username, ) .await?; + windmill_common::trashbin::set_aside_flow_versions(&mut *tx, &w_id, path, trash_id).await?; } if !query.keep_captures.unwrap_or(false) { diff --git a/backend/windmill-api-workspaces/src/workspaces.rs b/backend/windmill-api-workspaces/src/workspaces.rs index f80b6be2e5..2d192e3b8a 100644 --- a/backend/windmill-api-workspaces/src/workspaces.rs +++ b/backend/windmill-api-workspaces/src/workspaces.rs @@ -8827,6 +8827,7 @@ async fn clone_flows( "SELECT id, workspace_id, path, value, schema, created_by, created_at FROM flow_version WHERE workspace_id = $1 + AND NOT starts_with(path, '__deleted/') ORDER BY path, created_at", source_workspace_id ) diff --git a/backend/windmill-api-workspaces/src/workspaces_extra.rs b/backend/windmill-api-workspaces/src/workspaces_extra.rs index ee911f55ea..19087df2bf 100644 --- a/backend/windmill-api-workspaces/src/workspaces_extra.rs +++ b/backend/windmill-api-workspaces/src/workspaces_extra.rs @@ -1241,6 +1241,12 @@ pub(crate) async fn delete_workspace( sqlx::query!("DELETE FROM flow WHERE workspace_id = $1", &w_id) .execute(&mut *tx) .await?; + sqlx::query!("DELETE FROM flow_version WHERE workspace_id = $1", &w_id) + .execute(&mut *tx) + .await?; + sqlx::query!("DELETE FROM flow_node WHERE workspace_id = $1", &w_id) + .execute(&mut *tx) + .await?; sqlx::query!("DELETE FROM app WHERE workspace_id = $1", &w_id) .execute(&mut *tx) .await?; diff --git a/backend/windmill-api/src/offboarding.rs b/backend/windmill-api/src/offboarding.rs index 62c84697b2..7c8b2d4d8a 100644 --- a/backend/windmill-api/src/offboarding.rs +++ b/backend/windmill-api/src/offboarding.rs @@ -921,7 +921,7 @@ async fn offboard_user_from_workspace<'c>( ).execute(&mut **tx).await?; sqlx::query!( - r#"UPDATE flow_node SET path = REGEXP_REPLACE(path, 'u/' || $2 || '/(.*)', $1 || '/\1') WHERE path LIKE ('u/' || $2 || '/%') AND workspace_id = $3"#, + r#"UPDATE flow_node SET path = REGEXP_REPLACE(path, 'u/' || $2 || '/(.*)', $1 || '/\1') WHERE path LIKE ('u/' || $2 || '/%') AND workspace_id = $3 AND NOT EXISTS (SELECT 1 FROM flow_node d WHERE d.workspace_id = $3 AND d.hash_v2 = flow_node.hash_v2 AND d.path = REGEXP_REPLACE(flow_node.path, 'u/' || $2 || '/(.*)', $1 || '/\1'))"#, &new_prefix, username, w_id ).execute(&mut **tx).await?; diff --git a/backend/windmill-api/src/trash.rs b/backend/windmill-api/src/trash.rs index 53fc088582..39b50b01dd 100644 --- a/backend/windmill-api/src/trash.rs +++ b/backend/windmill-api/src/trash.rs @@ -258,6 +258,8 @@ async fn restore_flow(tx: &mut sqlx::PgConnection, item: &TrashItemWithData) -> .execute(&mut *tx) .await?; + trashbin::restore_flow_versions(&mut *tx, &item.workspace_id, &item.item_path, item.id).await?; + // Restore flow_versions if let Some(versions) = data.get("flow_versions").and_then(|v| v.as_array()) { for version in versions { diff --git a/backend/windmill-api/src/users.rs b/backend/windmill-api/src/users.rs index 87efcb84f4..5f546a7bed 100644 --- a/backend/windmill-api/src/users.rs +++ b/backend/windmill-api/src/users.rs @@ -773,7 +773,7 @@ async fn update_username_in_workpsace<'c>( .await?; sqlx::query!( - r#"UPDATE flow_node SET path = REGEXP_REPLACE(path,'u/' || $2 || '/(.*)','u/' || $1 || '/\1') WHERE path LIKE ('u/' || $2 || '/%') AND workspace_id = $3"#, + r#"UPDATE flow_node SET path = REGEXP_REPLACE(path,'u/' || $2 || '/(.*)','u/' || $1 || '/\1') WHERE path LIKE ('u/' || $2 || '/%') AND workspace_id = $3 AND NOT EXISTS (SELECT 1 FROM flow_node d WHERE d.workspace_id = $3 AND d.hash_v2 = flow_node.hash_v2 AND d.path = REGEXP_REPLACE(flow_node.path,'u/' || $2 || '/(.*)','u/' || $1 || '/\1'))"#, new_username, old_username, w_id diff --git a/backend/windmill-common/src/trashbin.rs b/backend/windmill-common/src/trashbin.rs index 6d88f12871..83e2771ecd 100644 --- a/backend/windmill-common/src/trashbin.rs +++ b/backend/windmill-common/src/trashbin.rs @@ -113,19 +113,82 @@ pub async fn get_trash_item<'e, E: sqlx::PgExecutor<'e>>( Ok(item) } +/// Where a deleted flow's versions wait while it is in the trash. Jobs load versions by id, +/// so runs in flight keep working, while every lookup by path (history, relocks, versioned +/// runs, renames) stops seeing them. Nodes stay at the flow's path: they are shared by +/// content and referenced by id. +fn set_aside_path(trash_id: i64) -> String { + format!("__deleted/{trash_id}") +} + +/// No permission check: the caller must have deleted the flow at `path` itself, in `tx`. +pub async fn set_aside_flow_versions( + tx: &mut PgConnection, + workspace_id: &str, + path: &str, + trash_id: i64, +) -> Result<()> { + sqlx::query("UPDATE flow_version SET path = $1 WHERE path = $2 AND workspace_id = $3") + .bind(set_aside_path(trash_id)) + .bind(path) + .bind(workspace_id) + .execute(&mut *tx) + .await?; + Ok(()) +} + +/// No permission check: the caller must have authorized restoring trash item `trash_id`. +pub async fn restore_flow_versions( + tx: &mut PgConnection, + workspace_id: &str, + path: &str, + trash_id: i64, +) -> Result<()> { + sqlx::query("UPDATE flow_version SET path = $1 WHERE path = $2 AND workspace_id = $3") + .bind(path) + .bind(set_aside_path(trash_id)) + .bind(workspace_id) + .execute(&mut *tx) + .await?; + Ok(()) +} + +/// SQL deleting the trash rows matching `cond` and selecting how many there were, along with +/// the versions their flows set aside, except those a queued job still references: those +/// are kept for good. `v2_job.runnable_id` has no index, so the queue is read once against +/// the set-aside ids: a check correlated per version scans `v2_job` once per version. +fn remove_trash_sql(cond: &str) -> String { + format!( + "WITH removed AS ( + DELETE FROM trashbin WHERE {cond} RETURNING id, workspace_id, item_kind + ), aside AS MATERIALIZED ( + SELECT v.workspace_id, v.id FROM flow_version v JOIN removed r + ON r.item_kind = 'flow' AND v.workspace_id = r.workspace_id + AND v.path = '__deleted/' || r.id + ), in_use AS MATERIALIZED ( + SELECT DISTINCT j.runnable_id AS id + FROM v2_job_queue q JOIN v2_job j ON j.id = q.id + WHERE q.workspace_id IN (SELECT workspace_id FROM aside) + AND j.runnable_id IN (SELECT id FROM aside) + ), _versions AS ( + DELETE FROM flow_version v USING aside a + WHERE v.workspace_id = a.workspace_id AND v.id = a.id + AND NOT EXISTS (SELECT 1 FROM in_use u WHERE u.id = v.id) + ) + SELECT count(*) FROM removed" + ) +} + pub async fn permanently_delete_item<'e, E: sqlx::PgExecutor<'e>>( db: E, workspace_id: &str, id: i64, ) -> Result<()> { - let rows = sqlx::query!( - "DELETE FROM trashbin WHERE workspace_id = $1 AND id = $2", - workspace_id, - id, - ) - .execute(db) - .await? - .rows_affected(); + let rows: i64 = sqlx::query_scalar(&remove_trash_sql("workspace_id = $1 AND id = $2")) + .bind(workspace_id) + .bind(id) + .fetch_one(db) + .await?; if rows == 0 { return Err(crate::error::Error::NotFound( @@ -137,19 +200,18 @@ pub async fn permanently_delete_item<'e, E: sqlx::PgExecutor<'e>>( } pub async fn empty_trash<'e, E: sqlx::PgExecutor<'e>>(db: E, workspace_id: &str) -> Result { - let rows = sqlx::query!("DELETE FROM trashbin WHERE workspace_id = $1", workspace_id,) - .execute(db) - .await? - .rows_affected(); + let rows = sqlx::query_scalar(&remove_trash_sql("workspace_id = $1")) + .bind(workspace_id) + .fetch_one(db) + .await?; - Ok(rows as i64) + Ok(rows) } pub async fn delete_expired_trash<'e, E: sqlx::PgExecutor<'e>>(db: E) -> Result { - let rows = sqlx::query!("DELETE FROM trashbin WHERE expires_at <= now()") - .execute(db) - .await? - .rows_affected(); + let rows = sqlx::query_scalar(&remove_trash_sql("expires_at <= now()")) + .fetch_one(db) + .await?; - Ok(rows as i64) + Ok(rows) } diff --git a/backend/windmill-common/tests/deleted_flow_versions.rs b/backend/windmill-common/tests/deleted_flow_versions.rs new file mode 100644 index 0000000000..98b1f17f81 --- /dev/null +++ b/backend/windmill-common/tests/deleted_flow_versions.rs @@ -0,0 +1,58 @@ +use sqlx::{Pool, Postgres}; +use windmill_common::trashbin::{delete_expired_trash, set_aside_flow_versions}; + +/// A deleted flow's versions must survive its trash entry while a queued job references +/// them, whatever path that job was queued under, and nothing else at the path is touched. +#[sqlx::test(migrations = "../migrations", fixtures("base"))] +async fn expired_trash_purges_set_aside_versions_no_queued_job_uses(db: Pool) { + sqlx::raw_sql( + "INSERT INTO flow_version (id, workspace_id, path, value, created_by) VALUES + (100, 'test-workspace', 'f/t/a', '{}', 'u'), + (101, 'test-workspace', 'f/t/a', '{}', 'u'), + (200, 'test-workspace', 'f/t/a', '{}', 'u'); + WITH job AS ( + INSERT INTO v2_job (id, workspace_id, kind, runnable_path, runnable_id) + VALUES (gen_random_uuid(), 'test-workspace', 'unassigned_flow', 'f/t/renamed', 100) + RETURNING id + ) + INSERT INTO v2_job_queue (id, workspace_id, scheduled_for) SELECT id, 'test-workspace', now() FROM job", + ) + .execute(&db) + .await + .unwrap(); + + let mut tx = db.begin().await.unwrap(); + let trash_id: i64 = sqlx::query_scalar( + "INSERT INTO trashbin (workspace_id, item_kind, item_path, item_data, deleted_by, expires_at) + VALUES ('test-workspace', 'flow', 'f/t/a', '{}', 'u', now() - interval '1 second') RETURNING id", + ) + .fetch_one(&mut *tx) + .await + .unwrap(); + set_aside_flow_versions(&mut tx, "test-workspace", "f/t/a", trash_id) + .await + .unwrap(); + // A flow recreated at the path after the deletion. + sqlx::query( + "INSERT INTO flow_version (id, workspace_id, path, value, created_by) + VALUES (300, 'test-workspace', 'f/t/a', '{}', 'u')", + ) + .execute(&mut *tx) + .await + .unwrap(); + tx.commit().await.unwrap(); + + assert_eq!(delete_expired_trash(&db).await.unwrap(), 1); + + let left: Vec<(i64, String)> = sqlx::query_as("SELECT id, path FROM flow_version ORDER BY id") + .fetch_all(&db) + .await + .unwrap(); + assert_eq!( + left, + vec![ + (100, format!("__deleted/{trash_id}")), + (300, "f/t/a".to_string()) + ] + ); +} diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index 0d339724c8..da062edb26 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -4868,23 +4868,34 @@ async fn clone_runnable(j: &mut PulledJob, db: &DB) -> error::Result<()> { // An app is relocked in place: a raw app's bundle is stored under its version id, // so a copy minted here could never be published. JobKind::Dependencies | JobKind::AppDependencies => *base_hash, - JobKind::FlowDependencies => { - sqlx::query_scalar!( - "INSERT INTO flow_version - (workspace_id, path, value, schema, created_by) + // The flow row is locked so that a concurrent delete or rename either waits for the + // copy and moves it with the flow's other versions, or wins and no copy is made: one + // committed after it would sit at the path of a flow recreated there. A rename first + // updates the row without changing its key, which `FOR KEY SHARE` would not wait for. + JobKind::FlowDependencies => sqlx::query_scalar!( + "INSERT INTO flow_version + (workspace_id, path, value, schema, created_by) - SELECT workspace_id, path, value, schema, created_by - FROM flow_version WHERE path = $1 AND workspace_id = $2 AND id = $3 + SELECT v.workspace_id, v.path, v.value, v.schema, v.created_by + FROM flow_version v + JOIN flow f ON f.workspace_id = v.workspace_id AND f.path = v.path + WHERE v.path = $1 AND v.workspace_id = $2 AND v.id = $3 + FOR SHARE OF f - RETURNING id - ", - j.runnable_path(), - j.workspace_id, - *base_hash, - ) - .fetch_one(db) - .await? - } + RETURNING id + ", + j.runnable_path(), + j.workspace_id, + *base_hash, + ) + .fetch_optional(db) + .await? + .ok_or_else(|| { + Error::NotFound(format!( + "Flow {} was deleted before its relock", + j.runnable_path() + )) + })?, _ => *base_hash, }; diff --git a/backend/windmill-worker/src/worker_flow.rs b/backend/windmill-worker/src/worker_flow.rs index bf4dc12875..ba587e355e 100644 --- a/backend/windmill-worker/src/worker_flow.rs +++ b/backend/windmill-worker/src/worker_flow.rs @@ -2944,13 +2944,15 @@ async fn fetch_root_flow_env( flow_job_id: Uuid, workspace_id: &str, ) -> Result>>, sqlx::Error> { + // Versions are matched by id alone (a deleted flow's are set aside off its path); only + // these kinds hold a flow version in `runnable_id`. sqlx::query_scalar!( - r#"WITH RECURSIVE chain(id, parent_job, flow_innermost_root_job, runnable_id, runnable_path, raw_flow, depth) AS ( - SELECT id, parent_job, flow_innermost_root_job, runnable_id, runnable_path, raw_flow, 0 + r#"WITH RECURSIVE chain(id, parent_job, flow_innermost_root_job, runnable_id, kind, raw_flow, depth) AS ( + SELECT id, parent_job, flow_innermost_root_job, runnable_id, kind, raw_flow, 0 FROM v2_job WHERE id = $1 AND workspace_id = $2 UNION ALL - SELECT j.id, j.parent_job, j.flow_innermost_root_job, j.runnable_id, j.runnable_path, j.raw_flow, c.depth + 1 + SELECT j.id, j.parent_job, j.flow_innermost_root_job, j.runnable_id, j.kind, j.raw_flow, c.depth + 1 FROM v2_job j JOIN chain c ON j.id = COALESCE(c.flow_innermost_root_job, c.parent_job) @@ -2966,7 +2968,7 @@ async fn fetch_root_flow_env( FROM chain LEFT JOIN flow_version ON flow_version.id = chain.runnable_id - AND flow_version.path = chain.runnable_path + AND chain.kind IN ('flow', 'unassigned_flow') AND flow_version.workspace_id = $2 WHERE (CASE WHEN flow_version.id IS NOT NULL THEN flow_version.value -> 'flow_env' From 2e422b497ee6f9691fe14812af1cb3646f928b34 Mon Sep 17 00:00:00 2001 From: AlexRV12 <71396855+AlexRV12@users.noreply.github.com> Date: Tue, 10 Nov 2026 10:32:46 +0100 Subject: [PATCH 02/10] fix: read the git sync callback script with the runnable parser (#12304) * fix: read the git sync callback script with the runnable parser * chore: update ee-repo-ref to a2e29e58a275306fa016c6675fc8e603848fb2f0 This commit updates the EE repository reference after PR #970 was merged in windmill-ee-private. Previous ee-repo-ref: b5adfeec9d5154f00c05bb808c944eef8fa5e611 New ee-repo-ref: a2e29e58a275306fa016c6675fc8e603848fb2f0 Automated by sync-ee-ref workflow. --------- Co-authored-by: windmill-internal-app[bot] --- backend/ee-repo-ref.txt | 2 +- backend/windmill-common/src/workspaces.rs | 77 +++++++++++++++++------ 2 files changed, 59 insertions(+), 20 deletions(-) diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 46be019f85..43061ebea2 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -effb55d778943537b96a9b0af26c2e24ca8b4686 +a2e29e58a275306fa016c6675fc8e603848fb2f0 diff --git a/backend/windmill-common/src/workspaces.rs b/backend/windmill-common/src/workspaces.rs index a3df2ac168..85d0290a87 100644 --- a/backend/windmill-common/src/workspaces.rs +++ b/backend/windmill-common/src/workspaces.rs @@ -408,26 +408,44 @@ impl GitRepositorySettings { .unwrap_or(LATEST_GIT_SYNC_SCRIPT_PATH) } - pub fn is_script_meets_min_version(&self, min_version: u32) -> error::Result { - let path = self.effective_script_path(); - // example: "hub/28102/sync-script-to-git-repo-windmill" - let current = path - .split("/") // -> ["hub" "28102" "sync-script-to-git-repo-windmill"] - .skip(1) // omit "hub" - .next() // get numeric id - .ok_or(Error::InternalErr(format!( - "cannot get script version id from: {}", - path - )))? - .parse() - .unwrap_or_else(|e| { - tracing::warn!("cannot get script version id from: {}. e: {e}", path); - - u32::MAX - }); - - Ok(current >= min_version) // this works on assumption that all scripts in hub have sequential ids + /// The path a deployment callback job is queued with. + pub fn callback_path(&self) -> String { + sync_callback_path(self.script_path.as_deref()) } + + pub fn is_script_meets_min_version(&self, min_version: u32) -> error::Result { + Ok(sync_script_meets_min_version( + &self.callback_path(), + min_version, + )) + } +} + +/// The path a git sync script (`None` for the latest one) is queued with: parsed when it +/// parses. A setting that doesn't parse is kept as written, so its callback is still queued and +/// fails visibly in the workspace's runs instead of the repository silently not syncing. +pub fn sync_callback_path(script_path: Option<&str>) -> String { + let raw = script_path.unwrap_or(LATEST_GIT_SYNC_SCRIPT_PATH); + crate::runnable_ref::RunnableRef::from_path(raw, false) + .map_or_else(|_| raw.to_string(), |script| script.path().to_string()) +} + +/// Whether the git sync script queued at `path` (from [`sync_callback_path`]) is at least +/// `min_version`. Never fails, so one repository's setting cannot stop the others' dispatch. +pub fn sync_script_meets_min_version(path: &str, min_version: u32) -> bool { + // Reading the queued path makes `/hub/28102/…` hub 28102. Not `hub_id()`: a workspace path + // keeps its second segment as version (`f/28000/…`). + let current = path + .split('/') + .nth(1) + .and_then(|id| id.parse().ok()) + .unwrap_or_else(|| { + tracing::warn!("cannot get script version id from: {}", path); + + u32::MAX + }); + + current >= min_version // this works on assumption that all scripts in hub have sequential ids } /// How auto-pull triggers are delivered for a repository. @@ -3937,6 +3955,27 @@ mod tests { DataTableRoleTenants { tenants: list.iter().map(|t| t.to_string()).collect() } } + #[test] + fn sync_script_version_is_the_second_segment_of_the_queued_path() { + let meets = |p, min| sync_script_meets_min_version(&sync_callback_path(p), min); + assert!(meets(None, 28956)); + assert!(!meets(Some("hub/28102/sync"), 28103)); + assert!(!meets(Some("/hub/28102/sync"), 28103)); + assert!(meets(Some("/hub/28103/sync"), 28103)); + assert!(!meets(Some("f/28000/sync"), 28103)); + assert!(meets(Some("u/admin/sync"), 28103)); + assert!(meets(Some("sync"), 28103)); + assert!(meets(Some("//hub/28102/sync"), 28103)); + assert_eq!( + sync_callback_path(Some("/hub/28102/sync")), + "hub/28102/sync" + ); + assert_eq!( + sync_callback_path(Some("//hub/28102/sync")), + "//hub/28102/sync" + ); + } + #[cfg(all(feature = "private", feature = "enterprise"))] #[test] fn a_tenant_list_covers_users_groups_folders_and_the_wildcard() { From a6ec7d0c18c0168bcda1ba6ccc9216b2bd5077a6 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 10 Nov 2026 09:50:00 +0000 Subject: [PATCH 03/10] perf: list audit logs by timestamp so only recent partitions are read (#12309) * perf: list audit logs by timestamp so only recent partitions are read Co-Authored-By: Claude Opus 5.5 * test: pin audit log paging by (timestamp, id) cursor Co-Authored-By: Claude Opus 5.5 * chore: update ee-repo-ref to d7d509d0955c52f83afd0bf8b61a0e811162c16f This commit updates the EE repository reference after PR #971 was merged in windmill-ee-private. Previous ee-repo-ref: 07dcbcda7762b5efab7caa515122066fa274c039 New ee-repo-ref: d7d509d0955c52f83afd0bf8b61a0e811162c16f Automated by sync-ee-ref workflow. --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: windmill-internal-app[bot] --- backend/ee-repo-ref.txt | 2 +- .../tests/audit.rs | 45 +++++++++++++++++++ backend/windmill-api/openapi.yaml | 15 +++++-- backend/windmill-audit/src/lib.rs | 6 ++- .../auditLogs/useAuditLogsLoader.svelte.ts | 24 +++++----- 5 files changed, 75 insertions(+), 17 deletions(-) diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 43061ebea2..7fe20e438b 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -a2e29e58a275306fa016c6675fc8e603848fb2f0 +d7d509d0955c52f83afd0bf8b61a0e811162c16f diff --git a/backend/windmill-api-integration-tests/tests/audit.rs b/backend/windmill-api-integration-tests/tests/audit.rs index 907eaf827e..6050ac2e8e 100644 --- a/backend/windmill-api-integration-tests/tests/audit.rs +++ b/backend/windmill-api-integration-tests/tests/audit.rs @@ -136,6 +136,51 @@ async fn test_job_run_is_searchable_by_token_and_by_caller( Ok(()) } +/// Paging with the `(timestamp, id)` cursor must return every row once, in `timestamp DESC, id +/// DESC` order, even where ids disagree with timestamps (an id is drawn at insert, the timestamp +/// at transaction start). +#[cfg(all(feature = "enterprise", feature = "private"))] +#[sqlx::test(migrations = "../migrations", fixtures("base"))] +async fn test_audit_list_cursor_follows_timestamp_order(db: Pool) -> anyhow::Result<()> { + initialize_tracing().await; + // Hours ahead stay inside the partitions created for the next days. + sqlx::query( + "INSERT INTO audit_partitioned (workspace_id, id, timestamp, username, operation, action_kind) + SELECT 'test-workspace', id, date_trunc('second', now()) + h * interval '1 hour', + 'test-user', 'cursor.probe', 'create' + FROM (VALUES (9000001, 1), (9000002, 3), (9000003, 2), (9000004, 2), (9000005, 1)) v(id, h)", + ) + .execute(&db) + .await?; + let server = ApiServer::start(db.clone()).await?; + let port = server.addr.port(); + + let mut seen = vec![]; + let mut cursor: Vec<(&str, String)> = vec![]; + loop { + let url = format!("http://localhost:{port}/api/w/test-workspace/audit/list"); + let page = authed(client().get(url)) + .query(&[("operation", "cursor.probe"), ("per_page", "1")]) + .query(&cursor) + .send() + .await? + .json::>() + .await?; + let Some(row) = page.first() else { break }; + seen.push(row["id"].as_i64().unwrap()); + cursor = vec![ + ("before_id", row["id"].to_string()), + ( + "before_id_timestamp", + row["timestamp"].as_str().unwrap().to_string(), + ), + ]; + } + assert_eq!(seen, [9000002, 9000004, 9000003, 9000005, 9000001]); + + Ok(()) +} + /// The run filter must find a run's entries under each key they keep its id in: the run itself /// (`parameters.uuid`), a cancel (`resource`) and a resume (`parameters.job_id`), and only those. #[cfg(all(feature = "enterprise", feature = "private"))] diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 63df36c4ad..a01ff0ec2f 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -271,12 +271,21 @@ paths: - name: before_id in: query description: > - only return logs with an id strictly lower than this one. Logs are ordered by - descending id, so this is a keyset cursor to stream a page in several batches - without paying a growing offset. + the id half of a keyset cursor. Logs are ordered by descending timestamp then + id: pass the last row's id here and its timestamp as before_id_timestamp to + stream a page in several batches without paying a growing offset. Alone, it + only filters on id < before_id, which can skip or repeat rows across pages. schema: type: integer format: int64 + - name: before_id_timestamp + in: query + description: > + the timestamp of the row whose id is before_id: with it, only logs strictly + before that row in (timestamp, id) order are returned + schema: + type: string + format: date-time - name: all_workspaces in: query description: get audit logs for all workspaces diff --git a/backend/windmill-audit/src/lib.rs b/backend/windmill-audit/src/lib.rs index 3b407b191f..89b5de067a 100644 --- a/backend/windmill-audit/src/lib.rs +++ b/backend/windmill-audit/src/lib.rs @@ -38,9 +38,11 @@ pub struct ListAuditLogQuery { pub resource: Option, pub before: Option>, pub after: Option>, - // Keyset cursor on the `id DESC` ordering. Lets a client stream a page in small batches - // without paying a growing OFFSET on every batch. + // Keyset cursor on the `timestamp DESC, id DESC` ordering: the id and timestamp of the last + // row seen. Lets a client stream a page in small batches without paying a growing OFFSET on + // every batch. `before_id` alone filters on the id only. pub before_id: Option, + pub before_id_timestamp: Option>, pub all_workspaces: Option, // The entries about one run: started, viewed, cancelled, resumed, deleted... pub job_id: Option, diff --git a/frontend/src/lib/components/auditLogs/useAuditLogsLoader.svelte.ts b/frontend/src/lib/components/auditLogs/useAuditLogsLoader.svelte.ts index cbfa573a74..788c21214f 100644 --- a/frontend/src/lib/components/auditLogs/useAuditLogsLoader.svelte.ts +++ b/frontend/src/lib/components/auditLogs/useAuditLogsLoader.svelte.ts @@ -25,8 +25,8 @@ const MAX_PER_PAGE = 1000 /** * Loads the newest audit logs, optionally streaming them in smaller batches so rows show up as * they arrive on instances where a full load takes a long time to come back, and appends older - * ones on demand. Rows are ordered by descending id, so every batch after the first follows a - * `before_id` cursor. + * ones on demand. Rows are ordered by descending timestamp then id, so every batch after the + * first follows a cursor on the last row's (timestamp, id). */ export function useAuditLogsLoader(args: () => AuditLogsLoaderArgs) { let logs: AuditLog[] | undefined = $state() @@ -45,12 +45,14 @@ export function useAuditLogsLoader(args: () => AuditLogsLoaderArgs) { function fetchBatch( a: AuditLogsLoaderArgs, limit: number, - beforeId: number | undefined + cursor: AuditLog | undefined ): CancelablePromise { return AuditService.listAuditLogs({ workspace: a.scope === 'instance' ? 'global' : a.workspace!, perPage: limit, - beforeId, + beforeId: cursor?.id, + // Passed back as received: the server's microseconds would not survive a `Date`. + beforeIdTimestamp: cursor?.timestamp, before: a.before, after: a.after, username: a.username === 'all' ? undefined : a.username, @@ -105,8 +107,8 @@ export function useAuditLogsLoader(args: () => AuditLogsLoaderArgs) { const acc: AuditLog[] = [] let slowBatchToastShown = false - function loadBatch(beforeId: number | undefined): CancelablePromise { - let fetch = fetchBatch(a, size, beforeId) + function loadBatch(cursor: AuditLog | undefined): CancelablePromise { + let fetch = fetchBatch(a, size, cursor) if (isBatched && size > 1) { fetch = CancelablePromiseUtils.onTimeout(fetch, 4000, () => { if (slowBatchToastShown) return @@ -132,7 +134,7 @@ export function useAuditLogsLoader(args: () => AuditLogsLoaderArgs) { hasMore = acc.length >= total return CancelablePromiseUtils.pure(undefined) } - return loadBatch(rows[rows.length - 1].id) + return loadBatch(rows[rows.length - 1]) }) } @@ -221,8 +223,8 @@ export function useAuditLogsLoader(args: () => AuditLogsLoaderArgs) { // Rows are appended as each batch lands, so stopping keeps them and the next load-more // continues from the last one. - function extraBatch(beforeId: number): CancelablePromise { - return CancelablePromiseUtils.then(fetchBatch(a, size, beforeId), (rows) => { + function extraBatch(cursor: AuditLog): CancelablePromise { + return CancelablePromiseUtils.then(fetchBatch(a, size, cursor), (rows) => { const kept = rows.slice(0, total - appended) appended += kept.length logs = [...(logs ?? []), ...kept] @@ -233,11 +235,11 @@ export function useAuditLogsLoader(args: () => AuditLogsLoaderArgs) { hasMore = false return CancelablePromiseUtils.pure(undefined) } - return extraBatch(rows[rows.length - 1].id) + return extraBatch(rows[rows.length - 1]) }) } - let promise = CancelablePromiseUtils.onTimeout(extraBatch(last.id), 4000, () => { + let promise = CancelablePromiseUtils.onTimeout(extraBatch(last), 4000, () => { const smaller = total > SMALL_BATCH_SIZE ? SMALL_BATCH_SIZE : 1 const offerBatches = size === total && total > 1 sendUserToast('Loading more audit logs is taking longer than expected...', 'warning', [ From c2f1cf39c1cbfcd922c773c057697fd80bdb21f5 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 10 Nov 2026 09:53:46 +0000 Subject: [PATCH 04/10] chore(main): release 1.866.0 (#12300) * chore(main): release 1.866.0 * Apply automatic changes --------- Co-authored-by: rubenfiszel <275584+rubenfiszel@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 21 ++ backend/Cargo.lock | 194 +++++++++--------- backend/Cargo.toml | 4 +- .../parsers/windmill-parser-wasm/Cargo.lock | 48 ++--- .../parsers/windmill-parser-wasm/Cargo.toml | 2 +- backend/windmill-api/openapi.yaml | 2 +- benchmarks/lib.ts | 2 +- chat-sdk/package-lock.json | 4 +- chat-sdk/package.json | 2 +- cli/src/core/constants.ts | 2 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- lsp/Pipfile | 2 +- openflow.openapi.yaml | 2 +- .../WindmillClient/WindmillClient.psd1 | 2 +- python-client/wmill/pyproject.toml | 2 +- typescript-client/jsr.json | 2 +- typescript-client/package.json | 2 +- version.txt | 2 +- windmill-yaml-validator/package-lock.json | 4 +- windmill-yaml-validator/package.json | 2 +- 22 files changed, 165 insertions(+), 144 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4d9d4331c9..ebb4b7f4d0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.865.0" + ".": "1.866.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 62677c823f..e893e893fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [1.866.0](https://github.com/windmill-labs/windmill/compare/v1.865.0...v1.866.0) (2026-11-10) + + +### Features + +* configurable columns and csv/json/xlsx export on the runs page ([#12302](https://github.com/windmill-labs/windmill/issues/12302)) ([47005d5](https://github.com/windmill-labs/windmill/commit/47005d5fcfe43251b2b184fbe625e7790b9a2adc)) +* show when each job started in the ai session jobs popover ([#12301](https://github.com/windmill-labs/windmill/issues/12301)) ([8b40416](https://github.com/windmill-labs/windmill/commit/8b404164e3487aead898d439de39993e313125be)) + + +### Bug Fixes + +* keep flow nodes on rename and stop masking flow load errors ([#12303](https://github.com/windmill-labs/windmill/issues/12303)) ([3bf4864](https://github.com/windmill-labs/windmill/commit/3bf486415bd88ffea9787f004874d15bbd433265)) +* never break running flows when their flow is deleted ([#12306](https://github.com/windmill-labs/windmill/issues/12306)) ([e3ff8be](https://github.com/windmill-labs/windmill/commit/e3ff8bee3d1e36c5ed1ea4982e8c6e02e24f7b50)) +* pin rsa to 0.9 so the lock refresh stops pulling 0.10 ([#12299](https://github.com/windmill-labs/windmill/issues/12299)) ([188b6cc](https://github.com/windmill-labs/windmill/commit/188b6ccf151e13aeef6d6a25c565ce59f7f02550)) +* read the git sync callback script with the runnable parser ([#12304](https://github.com/windmill-labs/windmill/issues/12304)) ([2e422b4](https://github.com/windmill-labs/windmill/commit/2e422b497ee6f9691fe14812af1cb3646f928b34)) + + +### Performance Improvements + +* list audit logs by timestamp so only recent partitions are read ([#12309](https://github.com/windmill-labs/windmill/issues/12309)) ([a6ec7d0](https://github.com/windmill-labs/windmill/commit/a6ec7d0c18c0168bcda1ba6ccc9216b2bd5077a6)) + ## [1.865.0](https://github.com/windmill-labs/windmill/compare/v1.864.1...v1.865.0) (2026-11-09) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 35d2df0130..75c2466a93 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -243,9 +243,9 @@ dependencies = [ [[package]] name = "arc-swap" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4c94f57a570fce5d381be3289b3f79aef6332d72948fe82ab5772e423ccf92" +checksum = "84a22b5d51209f6de83d37a0b33d320acb8da88823e42a94c075140708f032a5" dependencies = [ "rustversion", ] @@ -2858,9 +2858,9 @@ checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" [[package]] name = "crc32fast" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f97d3416d5337d15c4b0d78c8c91df922ca143f57ec20e2d1c188333047ef04" +checksum = "2b929dd2a135771f40afabd1073f85eed59c800b7c61901e5c254270497dad64" dependencies = [ "cfg-if", ] @@ -7254,9 +7254,9 @@ checksum = "4754a1731458af0443709c9667302793d3f63cc90ec4ba4c8259f2b9515478e5" [[package]] name = "jiff" -version = "0.2.41" +version = "0.2.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcefdcefac59ac8f8401852e3427d55610481fc41e6625c39bac62d2d771623a" +checksum = "fefca06093eeaed707a905795e68206da0edca4edef23d2a3997a3ddbee462aa" dependencies = [ "jiff-core", "jiff-static", @@ -7280,9 +7280,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.41" +version = "0.2.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "203edf9b0ce4083ec8fbf4adc823eac89768ea994b4953fc0dab1b90083234dd" +checksum = "41d3213549742662eea1a18e6c5af9be5dfbabeb7611ab71356a54928ec398f0" dependencies = [ "jiff-core", "proc-macro2", @@ -7831,9 +7831,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.32" +version = "1.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69965d2409bff8c8cea3829009fff66a86f05a0570656552ef70f616e8e4bd85" +checksum = "fee3f59f4321dab0c78d828942e7aa09d0bd8ad6e78a501977e6bf3d02938045" dependencies = [ "cc", "libc", @@ -9622,9 +9622,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" -version = "2.9.5" +version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8db75153506001cb36ed924f08cadc862eb3f8c4d0d534139f29074769d7660" +checksum = "5ec53fd1d256900a9a771bf2720d42cef6f8bc91b4e25065fbd291e3e7222576" dependencies = [ "memchr", "pest_stack_guard", @@ -9633,9 +9633,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.9.5" +version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20aa17e11fb35664b67d5214a0afac57a360d231b6ec53d6eba0700b27d933b4" +checksum = "adcf794fd301ddc20818a6b4de85ed507f4b45300245cec948982e69e12e3bd7" dependencies = [ "pest", "pest_generator", @@ -9643,9 +9643,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.9.5" +version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626ec5afccf44ccbfeb2b232316510bb55b4bf34d891afcb0fb07d2b17d7fe9d" +checksum = "c3073afae5db334c25dea9fc3e230a4f191e920c1df080cb9c0b37c9ce1dbb41" dependencies = [ "pest", "pest_meta", @@ -9656,9 +9656,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.9.5" +version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3f45b6caa65c1b08186832745159c2529994146340a7bf44168095469720f5d" +checksum = "7bc7f614b3742541642af1685faaa910bf6333e3cd3729c2cccd118146a57327" dependencies = [ "pest", ] @@ -15601,7 +15601,7 @@ dependencies = [ [[package]] name = "windmill" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-nats", @@ -15691,7 +15691,7 @@ dependencies = [ [[package]] name = "windmill-ai" -version = "1.865.0" +version = "1.866.0" dependencies = [ "async-stream", "async-trait", @@ -15726,7 +15726,7 @@ dependencies = [ [[package]] name = "windmill-alerting" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -15739,7 +15739,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "argon2", @@ -15881,7 +15881,7 @@ dependencies = [ [[package]] name = "windmill-api-agent-workers" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -15905,7 +15905,7 @@ dependencies = [ [[package]] name = "windmill-api-assets" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -15922,7 +15922,7 @@ dependencies = [ [[package]] name = "windmill-api-auth" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "axum", @@ -15948,7 +15948,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.865.0" +version = "1.866.0" dependencies = [ "reqwest 0.12.28", "serde", @@ -15958,7 +15958,7 @@ dependencies = [ [[package]] name = "windmill-api-configs" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -15975,7 +15975,7 @@ dependencies = [ [[package]] name = "windmill-api-debug" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "base64 0.22.1", @@ -15997,7 +15997,7 @@ dependencies = [ [[package]] name = "windmill-api-embeddings" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "axum", @@ -16020,7 +16020,7 @@ dependencies = [ [[package]] name = "windmill-api-flow-conversations" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -16036,7 +16036,7 @@ dependencies = [ [[package]] name = "windmill-api-flows" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -16058,7 +16058,7 @@ dependencies = [ [[package]] name = "windmill-api-groups" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -16080,7 +16080,7 @@ dependencies = [ [[package]] name = "windmill-api-inputs" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -16094,7 +16094,7 @@ dependencies = [ [[package]] name = "windmill-api-integration-tests" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-nats", @@ -16130,7 +16130,7 @@ dependencies = [ [[package]] name = "windmill-api-jobs" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "axum", @@ -16156,7 +16156,7 @@ dependencies = [ [[package]] name = "windmill-api-npm-proxy" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -16184,7 +16184,7 @@ dependencies = [ [[package]] name = "windmill-api-openapi" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "axum", @@ -16206,7 +16206,7 @@ dependencies = [ [[package]] name = "windmill-api-schedule" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -16225,7 +16225,7 @@ dependencies = [ [[package]] name = "windmill-api-scripts" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "axum", @@ -16267,7 +16267,7 @@ dependencies = [ [[package]] name = "windmill-api-settings" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "axum", @@ -16297,7 +16297,7 @@ dependencies = [ [[package]] name = "windmill-api-sse" -version = "1.865.0" +version = "1.866.0" dependencies = [ "lazy_static", "serde", @@ -16309,7 +16309,7 @@ dependencies = [ [[package]] name = "windmill-api-users" -version = "1.865.0" +version = "1.866.0" dependencies = [ "argon2", "axum", @@ -16333,7 +16333,7 @@ dependencies = [ [[package]] name = "windmill-api-workers" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -16348,7 +16348,7 @@ dependencies = [ [[package]] name = "windmill-api-workspaces" -version = "1.865.0" +version = "1.866.0" dependencies = [ "axum", "chrono", @@ -16387,7 +16387,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.865.0" +version = "1.866.0" dependencies = [ "chrono", "lazy_static", @@ -16402,7 +16402,7 @@ dependencies = [ [[package]] name = "windmill-autoscaling" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "axum", @@ -16421,7 +16421,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.865.0" +version = "1.866.0" dependencies = [ "aes-gcm", "aho-corasick", @@ -16540,7 +16540,7 @@ dependencies = [ [[package]] name = "windmill-dep-map" -version = "1.865.0" +version = "1.866.0" dependencies = [ "chrono", "futures", @@ -16560,7 +16560,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.865.0" +version = "1.866.0" dependencies = [ "regex", "serde", @@ -16577,7 +16577,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "astral-tokio-tar", @@ -16604,7 +16604,7 @@ dependencies = [ [[package]] name = "windmill-jseval" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "futures", @@ -16621,7 +16621,7 @@ dependencies = [ [[package]] name = "windmill-macros" -version = "1.865.0" +version = "1.866.0" dependencies = [ "itertools 0.14.0", "lazy_static", @@ -16637,7 +16637,7 @@ dependencies = [ [[package]] name = "windmill-mcp" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -16659,7 +16659,7 @@ dependencies = [ [[package]] name = "windmill-native-triggers" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -16691,7 +16691,7 @@ dependencies = [ [[package]] name = "windmill-oauth" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "arc-swap", @@ -16716,7 +16716,7 @@ dependencies = [ [[package]] name = "windmill-object-store" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-stream", @@ -16752,7 +16752,7 @@ dependencies = [ [[package]] name = "windmill-operator" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "futures", @@ -16771,7 +16771,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.865.0" +version = "1.866.0" dependencies = [ "convert_case 0.6.0", "serde", @@ -16780,7 +16780,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -16792,7 +16792,7 @@ dependencies = [ [[package]] name = "windmill-parser-csharp" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde_json", @@ -16804,7 +16804,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "gosyn", @@ -16816,7 +16816,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -16828,7 +16828,7 @@ dependencies = [ [[package]] name = "windmill-parser-java" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde_json", @@ -16840,7 +16840,7 @@ dependencies = [ [[package]] name = "windmill-parser-nu" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "nu-parser", @@ -16851,7 +16851,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -16862,7 +16862,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -16874,7 +16874,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-asset" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "ruff_python_ast", @@ -16885,7 +16885,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-recursion", @@ -16908,7 +16908,7 @@ dependencies = [ [[package]] name = "windmill-parser-r" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde_json", @@ -16920,7 +16920,7 @@ dependencies = [ [[package]] name = "windmill-parser-ruby" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -16934,7 +16934,7 @@ dependencies = [ [[package]] name = "windmill-parser-rust" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -16951,7 +16951,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -16964,7 +16964,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql-asset" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde", @@ -16976,7 +16976,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -16994,7 +16994,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts-asset" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde-wasm-bindgen", @@ -17010,7 +17010,7 @@ dependencies = [ [[package]] name = "windmill-parser-wac" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "ruff_python_ast", @@ -17027,7 +17027,7 @@ dependencies = [ [[package]] name = "windmill-parser-yaml" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -17041,7 +17041,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-recursion", @@ -17079,7 +17079,7 @@ dependencies = [ [[package]] name = "windmill-runtime-nativets" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "const_format", @@ -17117,7 +17117,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.865.0" +version = "1.866.0" dependencies = [ "getrandom 0.3.4", "wasm-bindgen", @@ -17128,7 +17128,7 @@ dependencies = [ [[package]] name = "windmill-store" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-recursion", @@ -17163,7 +17163,7 @@ dependencies = [ [[package]] name = "windmill-test-utils" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17187,7 +17187,7 @@ dependencies = [ [[package]] name = "windmill-trigger" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17220,7 +17220,7 @@ dependencies = [ [[package]] name = "windmill-trigger-amqp" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17247,7 +17247,7 @@ dependencies = [ [[package]] name = "windmill-trigger-azure" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17280,7 +17280,7 @@ dependencies = [ [[package]] name = "windmill-trigger-email" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17300,7 +17300,7 @@ dependencies = [ [[package]] name = "windmill-trigger-gcp" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17334,7 +17334,7 @@ dependencies = [ [[package]] name = "windmill-trigger-http" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17371,7 +17371,7 @@ dependencies = [ [[package]] name = "windmill-trigger-kafka" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17394,7 +17394,7 @@ dependencies = [ [[package]] name = "windmill-trigger-mqtt" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17418,7 +17418,7 @@ dependencies = [ [[package]] name = "windmill-trigger-nats" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-nats", @@ -17442,7 +17442,7 @@ dependencies = [ [[package]] name = "windmill-trigger-postgres" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17477,7 +17477,7 @@ dependencies = [ [[package]] name = "windmill-trigger-sqs" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17505,7 +17505,7 @@ dependencies = [ [[package]] name = "windmill-trigger-websocket" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-trait", @@ -17531,7 +17531,7 @@ dependencies = [ [[package]] name = "windmill-types" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "bitflags 2.13.2", @@ -17550,7 +17550,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-once-cell", @@ -17668,7 +17668,7 @@ dependencies = [ [[package]] name = "windmill-worker-volumes" -version = "1.865.0" +version = "1.866.0" dependencies = [ "bytes", "futures", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 8b831307d6..6b84a24949 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.865.0" +version = "1.866.0" authors.workspace = true edition.workspace = true @@ -88,7 +88,7 @@ members = [ exclude = ["./windmill-duckdb-ffi-internal", "./parsers/windmill-parser-wasm"] [workspace.package] -version = "1.865.0" +version = "1.866.0" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/parsers/windmill-parser-wasm/Cargo.lock b/backend/parsers/windmill-parser-wasm/Cargo.lock index c446a76567..b62513aef0 100644 --- a/backend/parsers/windmill-parser-wasm/Cargo.lock +++ b/backend/parsers/windmill-parser-wasm/Cargo.lock @@ -6340,7 +6340,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill-common" -version = "1.865.0" +version = "1.866.0" dependencies = [ "aes-gcm", "aho-corasick", @@ -6430,7 +6430,7 @@ dependencies = [ [[package]] name = "windmill-macros" -version = "1.865.0" +version = "1.866.0" dependencies = [ "proc-macro2", "quote", @@ -6442,7 +6442,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.865.0" +version = "1.866.0" dependencies = [ "convert_case", "serde", @@ -6451,7 +6451,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -6463,7 +6463,7 @@ dependencies = [ [[package]] name = "windmill-parser-csharp" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde_json", @@ -6475,7 +6475,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "gosyn", @@ -6487,7 +6487,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -6499,7 +6499,7 @@ dependencies = [ [[package]] name = "windmill-parser-java" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde_json", @@ -6511,7 +6511,7 @@ dependencies = [ [[package]] name = "windmill-parser-nu" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "nu-parser", @@ -6522,7 +6522,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -6533,7 +6533,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -6545,7 +6545,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-asset" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "ruff_python_ast", @@ -6556,7 +6556,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "async-recursion", @@ -6579,7 +6579,7 @@ dependencies = [ [[package]] name = "windmill-parser-r" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde_json", @@ -6591,7 +6591,7 @@ dependencies = [ [[package]] name = "windmill-parser-ruby" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -6605,7 +6605,7 @@ dependencies = [ [[package]] name = "windmill-parser-rust" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "convert_case", @@ -6622,7 +6622,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -6635,7 +6635,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql-asset" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde", @@ -6647,7 +6647,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -6665,7 +6665,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts-asset" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "serde-wasm-bindgen", @@ -6681,7 +6681,7 @@ dependencies = [ [[package]] name = "windmill-parser-wac" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "ruff_python_ast", @@ -6698,7 +6698,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "getrandom 0.2.17", @@ -6730,7 +6730,7 @@ dependencies = [ [[package]] name = "windmill-parser-yaml" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "lazy_static", @@ -6744,7 +6744,7 @@ dependencies = [ [[package]] name = "windmill-types" -version = "1.865.0" +version = "1.866.0" dependencies = [ "anyhow", "bitflags", diff --git a/backend/parsers/windmill-parser-wasm/Cargo.toml b/backend/parsers/windmill-parser-wasm/Cargo.toml index c32e0402f9..750721fa8c 100644 --- a/backend/parsers/windmill-parser-wasm/Cargo.toml +++ b/backend/parsers/windmill-parser-wasm/Cargo.toml @@ -12,7 +12,7 @@ resolver = "2" members = ["."] [workspace.package] -version = "1.865.0" +version = "1.866.0" edition = "2021" authors = ["Ruben Fiszel "] diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index a01ff0ec2f..bb910f28df 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.865.0 + version: 1.866.0 title: Windmill API contact: diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index 679cdfbe81..851a59e987 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.865.0"; +export const VERSION = "v1.866.0"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/chat-sdk/package-lock.json b/chat-sdk/package-lock.json index 02794b758c..69c3fa2b56 100644 --- a/chat-sdk/package-lock.json +++ b/chat-sdk/package-lock.json @@ -1,12 +1,12 @@ { "name": "@windmill-labs/chat-sdk", - "version": "1.865.0", + "version": "1.866.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@windmill-labs/chat-sdk", - "version": "1.865.0", + "version": "1.866.0", "license": "Apache-2.0", "devDependencies": { "@ai-sdk/react": "^4.0.102", diff --git a/chat-sdk/package.json b/chat-sdk/package.json index d4046f7b89..be58d54c45 100644 --- a/chat-sdk/package.json +++ b/chat-sdk/package.json @@ -1,7 +1,7 @@ { "name": "@windmill-labs/chat-sdk", "description": "Build chat interfaces on Windmill flows deployed in chat mode, from any frontend or raw app", - "version": "1.865.0", + "version": "1.866.0", "author": "Ruben Fiszel", "license": "Apache-2.0", "homepage": "https://github.com/windmill-labs/windmill/tree/main/chat-sdk#readme", diff --git a/cli/src/core/constants.ts b/cli/src/core/constants.ts index 4536e72fbb..a431495b12 100644 --- a/cli/src/core/constants.ts +++ b/cli/src/core/constants.ts @@ -10,4 +10,4 @@ export const WM_FORK_PREFIX = "wm-fork"; // (e.g. utils.ts) can read it without importing main.ts and creating a circular // dependency (main → workspace → utils → main) that triggers a TDZ. // Re-exported from main.ts for backwards compatibility. -export const VERSION = "1.865.0"; +export const VERSION = "1.866.0"; diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7ddaa0ceb7..f5d0e7fe90 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "@windmill-labs/components", - "version": "1.865.0", + "version": "1.866.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@windmill-labs/components", - "version": "1.865.0", + "version": "1.866.0", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/frontend/package.json b/frontend/package.json index e3f9164a71..aa2892911b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "@windmill-labs/components", - "version": "1.865.0", + "version": "1.866.0", "scripts": { "dev": "vite dev", "dev:ui-builder": "mv static/ui_builder static/ui_builder.dev-disabled 2>/dev/null || true ; trap 'mv static/ui_builder.dev-disabled static/ui_builder 2>/dev/null || true' EXIT ; vite dev", diff --git a/lsp/Pipfile b/lsp/Pipfile index 28cdb972ea..ee1142c14a 100644 --- a/lsp/Pipfile +++ b/lsp/Pipfile @@ -4,7 +4,7 @@ verify_ssl = true name = "pypi" [packages] -wmill = ">=1.865.0" +wmill = ">=1.866.0" sendgrid = "*" mysql-connector-python = "*" pymongo = "*" diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index 6a027eec28..293f2fd1ce 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -1,7 +1,7 @@ openapi: '3.0.3' info: - version: 1.865.0 + version: 1.866.0 title: OpenFlow Spec contact: name: Ruben Fiszel diff --git a/powershell-client/WindmillClient/WindmillClient.psd1 b/powershell-client/WindmillClient/WindmillClient.psd1 index 239ae66ed8..f8e8053985 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.865.0' + ModuleVersion = '1.866.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index 6b60132b58..5e4e7a31de 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill" -version = "1.865.0" +version = "1.866.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/typescript-client/jsr.json b/typescript-client/jsr.json index 86d1fa1b70..66c8606bdb 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,6 +1,6 @@ { "name": "@windmill/windmill", - "version": "1.865.0", + "version": "1.866.0", "exports": "./src/index.ts", "publish": { "exclude": ["!src", "./s3Types.ts", "./sqlUtils.ts", "./client.ts", "./wacError.ts"] diff --git a/typescript-client/package.json b/typescript-client/package.json index 15bb15bd62..f9fd3000aa 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.865.0", + "version": "1.866.0", "author": "Ruben Fiszel", "license": "Apache 2.0", "homepage": "https://github.com/windmill-labs/windmill/tree/main/typescript-client#readme", diff --git a/version.txt b/version.txt index fb6e847b6e..1cd897b0c5 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.865.0 +1.866.0 diff --git a/windmill-yaml-validator/package-lock.json b/windmill-yaml-validator/package-lock.json index 11327801db..873188826c 100644 --- a/windmill-yaml-validator/package-lock.json +++ b/windmill-yaml-validator/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-yaml-validator", - "version": "1.865.0", + "version": "1.866.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-yaml-validator", - "version": "1.865.0", + "version": "1.866.0", "license": "Apache 2.0", "dependencies": { "@stoplight/yaml": "^4.3.0", diff --git a/windmill-yaml-validator/package.json b/windmill-yaml-validator/package.json index 2a812987ef..1269e3db2e 100644 --- a/windmill-yaml-validator/package.json +++ b/windmill-yaml-validator/package.json @@ -1,6 +1,6 @@ { "name": "windmill-yaml-validator", - "version": "1.865.0", + "version": "1.866.0", "description": "YAML validator for Windmill flow, schedule, and trigger files", "main": "dist/index.js", "types": "dist/index.d.ts", From 466885fd26b74bd20de67ee0ef0e55a47826cd47 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 10 Nov 2026 11:05:42 +0000 Subject: [PATCH 05/10] feat: fold sidebar AI chats and sessions inactive for over a week (#12314) * feat: fold sidebar AI chats and sessions inactive for over a week Co-Authored-By: Claude Opus 5.5 * fix: fold sidebar sessions only when no activity cutoff is picked Co-Authored-By: Claude Opus 5.5 * refactor: render the sidebar show-older row with Button Co-Authored-By: Claude Opus 5.5 * feat: persist the sidebar show-older state Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .../components/sessions/SessionPicker.svelte | 42 ++++++++++++++++--- .../components/sidebar/AiChatsSection.svelte | 34 ++++++++++++--- .../sidebar/SidebarShowOlder.svelte | 34 +++++++++++++++ 3 files changed, 99 insertions(+), 11 deletions(-) create mode 100644 frontend/src/lib/components/sidebar/SidebarShowOlder.svelte diff --git a/frontend/src/lib/components/sessions/SessionPicker.svelte b/frontend/src/lib/components/sessions/SessionPicker.svelte index b194592809..a6c8ceb630 100644 --- a/frontend/src/lib/components/sessions/SessionPicker.svelte +++ b/frontend/src/lib/components/sessions/SessionPicker.svelte @@ -61,6 +61,9 @@ import UnreadCountBadge from '$lib/components/common/badge/UnreadCountBadge.svelte' import { buildWorkspaceHierarchy } from '$lib/utils/workspaceHierarchy' import MenuButton, { sidebarClasses } from '$lib/components/sidebar/MenuButton.svelte' + import SidebarShowOlder, { + SIDEBAR_RECENT_MS + } from '$lib/components/sidebar/SidebarShowOlder.svelte' import DropdownV2 from '$lib/components/DropdownV2.svelte' import { userStore, userWorkspaces, workspaceStore } from '$lib/stores' import { workspaceIsFork } from '$lib/utils/workspaceHierarchy' @@ -175,10 +178,9 @@ ) } - // Flat list passing the archive + scope filters. Grouping for display happens - // in `sessionGroups`; this flat view drives the runtime effect, the unread - // total, and keyboard navigation. - const visibleSessions = $derived( + // Every session passing the archive + scope filters, the ones folded under "Show older" + // included. + const filteredSessions = $derived( sessionState.sessions.filter((s) => { // A draft Home's composer holds becomes a session when its first send starts, typed // or not. Unsent drafts opened onto an item stay listed: the row is their only way @@ -198,6 +200,25 @@ }) ) + // With no activity cutoff picked, sessions inactive for over a week fold under a "Show older" + // row, except the one on screen. A picked cutoff is the reader's own choice and folds nothing. + const showOlder = useLocalStorageValue('windmill_sessions_show_older', false, 'boolean') + const olderIds = $derived.by(() => { + if (lastActivityDays.val > 0) return new Set() + const cutoff = clock - SIDEBAR_RECENT_MS + return new Set( + filteredSessions + .filter((s) => s.id !== activeRowId && sessionLastActivityAt(s) < cutoff) + .map((s) => s.id) + ) + }) + + // The rows listed. Grouping for display happens in `sessionGroups`; this flat view drives + // the runtime effect, the unread total, and keyboard navigation. + const visibleSessions = $derived( + showOlder.val ? filteredSessions : filteredSessions.filter((s) => !olderIds.has(s.id)) + ) + // Sessions grouped by workspace family for display, each group by its last turn // start or end, latest first. Family order follows its latest session and is NOT tied // to the current workspace: pinning the active family first reshuffled the @@ -384,7 +405,7 @@ // sessions load, the list is empty for every reader, and the fold is a // layout they chose to keep. $effect(() => { - if (sessionState.hydrated && visibleSessions.length === 0 && sectionCollapsed.val) { + if (sessionState.hydrated && filteredSessions.length === 0 && sectionCollapsed.val) { sectionCollapsed.val = false } }) @@ -785,7 +806,7 @@ icon={MessageSquare} folded={sectionCollapsed.val} onToggle={() => (sectionCollapsed.val = !sectionCollapsed.val)} - disabled={visibleSessions.length === 0} + disabled={filteredSessions.length === 0} notify={totalUnread > 0} actions={sectionOptions} {isCollapsed} @@ -1132,6 +1153,15 @@ {/each} {/if} + + {#if olderIds.size > 0} + (showOlder.val = !showOlder.val)} + {rail} + /> + {/if} {#if selecting}