diff --git a/backend/.sqlx/query-0a686ca61444d7ad7484071727aa039a6ea6697e5a49a633b767c052aa3e0a18.json b/backend/.sqlx/query-0a686ca61444d7ad7484071727aa039a6ea6697e5a49a633b767c052aa3e0a18.json index a7b670b1ab..aa608ecc57 100644 --- a/backend/.sqlx/query-0a686ca61444d7ad7484071727aa039a6ea6697e5a49a633b767c052aa3e0a18.json +++ b/backend/.sqlx/query-0a686ca61444d7ad7484071727aa039a6ea6697e5a49a633b767c052aa3e0a18.json @@ -32,7 +32,6 @@ "noop", "appdependencies", "deploymentcallback", - "scheduledscriptwithretry", "singlescriptflow" ] } @@ -49,6 +48,7 @@ "bash", "postgresql", "nativets", + "Nativets", "bun", "mysql", "bigquery", diff --git a/backend/.sqlx/query-254776959f60455a00a2c29a1783ee6b27c836197df6454d3bb5c59441c34f44.json b/backend/.sqlx/query-254776959f60455a00a2c29a1783ee6b27c836197df6454d3bb5c59441c34f44.json index 56cd2b7390..b2421d64f2 100644 --- a/backend/.sqlx/query-254776959f60455a00a2c29a1783ee6b27c836197df6454d3bb5c59441c34f44.json +++ b/backend/.sqlx/query-254776959f60455a00a2c29a1783ee6b27c836197df6454d3bb5c59441c34f44.json @@ -47,7 +47,6 @@ "noop", "appdependencies", "deploymentcallback", - "scheduledscriptwithretry", "singlescriptflow" ] } @@ -70,6 +69,7 @@ "bash", "postgresql", "nativets", + "Nativets", "bun", "mysql", "bigquery", diff --git a/backend/.sqlx/query-2f42460fdd8aa125c8fd46b3cd02e47f57de0f073d3ce3bc7d21a7e404a83b5c.json b/backend/.sqlx/query-2f42460fdd8aa125c8fd46b3cd02e47f57de0f073d3ce3bc7d21a7e404a83b5c.json index 030a85c000..c9110033a5 100644 --- a/backend/.sqlx/query-2f42460fdd8aa125c8fd46b3cd02e47f57de0f073d3ce3bc7d21a7e404a83b5c.json +++ b/backend/.sqlx/query-2f42460fdd8aa125c8fd46b3cd02e47f57de0f073d3ce3bc7d21a7e404a83b5c.json @@ -42,6 +42,7 @@ "bash", "postgresql", "nativets", + "Nativets", "bun", "mysql", "bigquery", diff --git a/backend/.sqlx/query-4a393e61e33c1204c01044254692629e6ee2c053c7b1fa10f84462a327c739b3.json b/backend/.sqlx/query-4a393e61e33c1204c01044254692629e6ee2c053c7b1fa10f84462a327c739b3.json index cac6b88592..a8c925c966 100644 --- a/backend/.sqlx/query-4a393e61e33c1204c01044254692629e6ee2c053c7b1fa10f84462a327c739b3.json +++ b/backend/.sqlx/query-4a393e61e33c1204c01044254692629e6ee2c053c7b1fa10f84462a327c739b3.json @@ -28,6 +28,7 @@ "bash", "postgresql", "nativets", + "Nativets", "bun", "mysql", "bigquery", diff --git a/backend/.sqlx/query-620ddf29c5e867079df4c2aa6e80bccb19beeb9ddfa308ca97f254cd5ba8157e.json b/backend/.sqlx/query-620ddf29c5e867079df4c2aa6e80bccb19beeb9ddfa308ca97f254cd5ba8157e.json index 744772bb74..89583ff5ef 100644 --- a/backend/.sqlx/query-620ddf29c5e867079df4c2aa6e80bccb19beeb9ddfa308ca97f254cd5ba8157e.json +++ b/backend/.sqlx/query-620ddf29c5e867079df4c2aa6e80bccb19beeb9ddfa308ca97f254cd5ba8157e.json @@ -42,7 +42,6 @@ "noop", "appdependencies", "deploymentcallback", - "scheduledscriptwithretry", "singlescriptflow" ] } @@ -63,6 +62,7 @@ "bash", "postgresql", "nativets", + "Nativets", "bun", "mysql", "bigquery", diff --git a/backend/.sqlx/query-6b313cc9a57ae3c943bda4a3213f7f6231a44b6ef5a52754074d136007f4f72a.json b/backend/.sqlx/query-6b313cc9a57ae3c943bda4a3213f7f6231a44b6ef5a52754074d136007f4f72a.json index 72c175aff7..7d9d04bc37 100644 --- a/backend/.sqlx/query-6b313cc9a57ae3c943bda4a3213f7f6231a44b6ef5a52754074d136007f4f72a.json +++ b/backend/.sqlx/query-6b313cc9a57ae3c943bda4a3213f7f6231a44b6ef5a52754074d136007f4f72a.json @@ -37,6 +37,7 @@ "bash", "postgresql", "nativets", + "Nativets", "bun", "mysql", "bigquery", diff --git a/backend/.sqlx/query-b53442ca97ed9d25990405281c82c31062de24cbd2f99d1c4039965d861aafa9.json b/backend/.sqlx/query-6bb9e6cab7034bf28ef2597445dc617b60c49b42568fdb975cf2d2dc8702167e.json similarity index 85% rename from backend/.sqlx/query-b53442ca97ed9d25990405281c82c31062de24cbd2f99d1c4039965d861aafa9.json rename to backend/.sqlx/query-6bb9e6cab7034bf28ef2597445dc617b60c49b42568fdb975cf2d2dc8702167e.json index a2fa06c429..64d6e6b88a 100644 --- a/backend/.sqlx/query-b53442ca97ed9d25990405281c82c31062de24cbd2f99d1c4039965d861aafa9.json +++ b/backend/.sqlx/query-6bb9e6cab7034bf28ef2597445dc617b60c49b42568fdb975cf2d2dc8702167e.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "INSERT INTO schedule (workspace_id, path, schedule, timezone, edited_by, script_path, is_flow, args, enabled, email, on_failure, on_failure_times, on_failure_exact, on_failure_extra_args, on_recovery, on_recovery_times, on_recovery_extra_args, ws_error_handler_muted, retry ) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19 ) RETURNING *", + "query": "INSERT INTO schedule (workspace_id, path, schedule, timezone, edited_by, script_path, is_flow, args, enabled, email, on_failure, on_failure_times, on_failure_exact, on_failure_extra_args, on_recovery, on_recovery_times, on_recovery_extra_args, ws_error_handler_muted, retry, summary, no_flow_overlap ) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21 ) RETURNING *", "describe": { "columns": [ { @@ -112,6 +112,16 @@ "ordinal": 21, "name": "retry", "type_info": "Jsonb" + }, + { + "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" } ], "parameters": { @@ -134,7 +144,9 @@ "Int4", "Json", "Bool", - "Jsonb" + "Jsonb", + "Varchar", + "Bool" ] }, "nullable": [ @@ -159,8 +171,10 @@ true, true, false, - true + true, + true, + false ] }, - "hash": "b53442ca97ed9d25990405281c82c31062de24cbd2f99d1c4039965d861aafa9" + "hash": "6bb9e6cab7034bf28ef2597445dc617b60c49b42568fdb975cf2d2dc8702167e" } diff --git a/backend/.sqlx/query-7a00843921db4ac1eb20a1045e83363587c1a2cb62d2df25d5564ae78a03b097.json b/backend/.sqlx/query-7a00843921db4ac1eb20a1045e83363587c1a2cb62d2df25d5564ae78a03b097.json index 29c1f9ca0c..1cc71540c8 100644 --- a/backend/.sqlx/query-7a00843921db4ac1eb20a1045e83363587c1a2cb62d2df25d5564ae78a03b097.json +++ b/backend/.sqlx/query-7a00843921db4ac1eb20a1045e83363587c1a2cb62d2df25d5564ae78a03b097.json @@ -115,6 +115,16 @@ }, { "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" + }, + { + "ordinal": 24, "name": "jobs", "type_info": "JsonArray" } @@ -149,6 +159,8 @@ true, false, true, + true, + false, null ] }, diff --git a/backend/.sqlx/query-911b1e1f2a5ba6d5159916e5598020e680c45043b0736ad0153ee261a151dd90.json b/backend/.sqlx/query-911b1e1f2a5ba6d5159916e5598020e680c45043b0736ad0153ee261a151dd90.json index 5327b9928f..eba555aa49 100644 --- a/backend/.sqlx/query-911b1e1f2a5ba6d5159916e5598020e680c45043b0736ad0153ee261a151dd90.json +++ b/backend/.sqlx/query-911b1e1f2a5ba6d5159916e5598020e680c45043b0736ad0153ee261a151dd90.json @@ -112,6 +112,16 @@ "ordinal": 21, "name": "retry", "type_info": "Jsonb" + }, + { + "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" } ], "parameters": { @@ -143,7 +153,9 @@ true, true, false, - true + true, + true, + false ] }, "hash": "911b1e1f2a5ba6d5159916e5598020e680c45043b0736ad0153ee261a151dd90" diff --git a/backend/.sqlx/query-96dc1cd308f3c21cfb50b88048054dc03f93e261d25969d66aa48e9d0502960f.json b/backend/.sqlx/query-96dc1cd308f3c21cfb50b88048054dc03f93e261d25969d66aa48e9d0502960f.json index a1cba9cd82..d0d95c1094 100644 --- a/backend/.sqlx/query-96dc1cd308f3c21cfb50b88048054dc03f93e261d25969d66aa48e9d0502960f.json +++ b/backend/.sqlx/query-96dc1cd308f3c21cfb50b88048054dc03f93e261d25969d66aa48e9d0502960f.json @@ -112,6 +112,16 @@ "ordinal": 21, "name": "retry", "type_info": "Jsonb" + }, + { + "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" } ], "parameters": { @@ -144,7 +154,9 @@ true, true, false, - true + true, + true, + false ] }, "hash": "96dc1cd308f3c21cfb50b88048054dc03f93e261d25969d66aa48e9d0502960f" diff --git a/backend/.sqlx/query-9d3556319411a27a875bf6cf0e5eda837cc63e4d8be912c0b5bfeea4a0c8db2e.json b/backend/.sqlx/query-9d3556319411a27a875bf6cf0e5eda837cc63e4d8be912c0b5bfeea4a0c8db2e.json index 475965470b..983c1586f0 100644 --- a/backend/.sqlx/query-9d3556319411a27a875bf6cf0e5eda837cc63e4d8be912c0b5bfeea4a0c8db2e.json +++ b/backend/.sqlx/query-9d3556319411a27a875bf6cf0e5eda837cc63e4d8be912c0b5bfeea4a0c8db2e.json @@ -26,7 +26,6 @@ "noop", "appdependencies", "deploymentcallback", - "scheduledscriptwithretry", "singlescriptflow" ] } @@ -43,6 +42,7 @@ "bash", "postgresql", "nativets", + "Nativets", "bun", "mysql", "bigquery", diff --git a/backend/.sqlx/query-aa2800113a8a8805f47cdc1dd0f29d94c546fe531e7edd3e91da4978af5442fb.json b/backend/.sqlx/query-aa2800113a8a8805f47cdc1dd0f29d94c546fe531e7edd3e91da4978af5442fb.json index 65067dc26f..b0a50e53df 100644 --- a/backend/.sqlx/query-aa2800113a8a8805f47cdc1dd0f29d94c546fe531e7edd3e91da4978af5442fb.json +++ b/backend/.sqlx/query-aa2800113a8a8805f47cdc1dd0f29d94c546fe531e7edd3e91da4978af5442fb.json @@ -112,6 +112,16 @@ "ordinal": 21, "name": "retry", "type_info": "Jsonb" + }, + { + "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" } ], "parameters": { @@ -142,7 +152,9 @@ true, true, false, - true + true, + true, + false ] }, "hash": "aa2800113a8a8805f47cdc1dd0f29d94c546fe531e7edd3e91da4978af5442fb" diff --git a/backend/.sqlx/query-b69891c25dd029b1a54e97ace292433e1485324ff7dc802fe75d21c8c6db1d42.json b/backend/.sqlx/query-b69891c25dd029b1a54e97ace292433e1485324ff7dc802fe75d21c8c6db1d42.json index f95d9d95b2..86a1402ad0 100644 --- a/backend/.sqlx/query-b69891c25dd029b1a54e97ace292433e1485324ff7dc802fe75d21c8c6db1d42.json +++ b/backend/.sqlx/query-b69891c25dd029b1a54e97ace292433e1485324ff7dc802fe75d21c8c6db1d42.json @@ -42,6 +42,7 @@ "bash", "postgresql", "nativets", + "Nativets", "bun", "mysql", "bigquery", diff --git a/backend/.sqlx/query-e1673b211da54039c5cffa5a38fe23073149bc5bfcea1daccb657d5fa6892183.json b/backend/.sqlx/query-b7ed211ec7611c994a49565e46e5893788bcf49b2c9357fbc45a8353a7c84f48.json similarity index 87% rename from backend/.sqlx/query-e1673b211da54039c5cffa5a38fe23073149bc5bfcea1daccb657d5fa6892183.json rename to backend/.sqlx/query-b7ed211ec7611c994a49565e46e5893788bcf49b2c9357fbc45a8353a7c84f48.json index 88cf43c727..9d82879533 100644 --- a/backend/.sqlx/query-e1673b211da54039c5cffa5a38fe23073149bc5bfcea1daccb657d5fa6892183.json +++ b/backend/.sqlx/query-b7ed211ec7611c994a49565e46e5893788bcf49b2c9357fbc45a8353a7c84f48.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "UPDATE schedule SET schedule = $1, timezone = $2, args = $3, on_failure = $4, on_failure_times = $5, on_failure_exact = $6, on_failure_extra_args = $7, on_recovery = $8, on_recovery_times = $9, on_recovery_extra_args = $10, ws_error_handler_muted = $11, retry = $12\n WHERE path = $13 AND workspace_id = $14 RETURNING *", + "query": "UPDATE schedule SET schedule = $1, timezone = $2, args = $3, on_failure = $4, on_failure_times = $5, on_failure_exact = $6, on_failure_extra_args = $7, on_recovery = $8, on_recovery_times = $9, on_recovery_extra_args = $10, ws_error_handler_muted = $11, retry = $12, summary = $13, no_flow_overlap = $14 WHERE path = $15 AND workspace_id = $16 RETURNING *", "describe": { "columns": [ { @@ -112,6 +112,16 @@ "ordinal": 21, "name": "retry", "type_info": "Jsonb" + }, + { + "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" } ], "parameters": { @@ -128,6 +138,8 @@ "Json", "Bool", "Jsonb", + "Varchar", + "Bool", "Text", "Text" ] @@ -154,8 +166,10 @@ true, true, false, - true + true, + true, + false ] }, - "hash": "e1673b211da54039c5cffa5a38fe23073149bc5bfcea1daccb657d5fa6892183" + "hash": "b7ed211ec7611c994a49565e46e5893788bcf49b2c9357fbc45a8353a7c84f48" } diff --git a/backend/.sqlx/query-c10348d26e3e3dc9e345d9044db35db9906617eb9c98aaf58a55d9681ffb85e3.json b/backend/.sqlx/query-c10348d26e3e3dc9e345d9044db35db9906617eb9c98aaf58a55d9681ffb85e3.json index 1ef892cb95..45d8398802 100644 --- a/backend/.sqlx/query-c10348d26e3e3dc9e345d9044db35db9906617eb9c98aaf58a55d9681ffb85e3.json +++ b/backend/.sqlx/query-c10348d26e3e3dc9e345d9044db35db9906617eb9c98aaf58a55d9681ffb85e3.json @@ -112,6 +112,16 @@ "ordinal": 21, "name": "retry", "type_info": "Jsonb" + }, + { + "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" } ], "parameters": { @@ -143,7 +153,9 @@ true, true, false, - true + true, + true, + false ] }, "hash": "c10348d26e3e3dc9e345d9044db35db9906617eb9c98aaf58a55d9681ffb85e3" diff --git a/backend/.sqlx/query-dd74fa9468b5fe8c8ad657ded06076c11a78d0206af2af20685c691d4d9520bb.json b/backend/.sqlx/query-dd74fa9468b5fe8c8ad657ded06076c11a78d0206af2af20685c691d4d9520bb.json index fb2116fb51..fb290de9fa 100644 --- a/backend/.sqlx/query-dd74fa9468b5fe8c8ad657ded06076c11a78d0206af2af20685c691d4d9520bb.json +++ b/backend/.sqlx/query-dd74fa9468b5fe8c8ad657ded06076c11a78d0206af2af20685c691d4d9520bb.json @@ -112,6 +112,16 @@ "ordinal": 21, "name": "retry", "type_info": "Jsonb" + }, + { + "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" } ], "parameters": { @@ -143,7 +153,9 @@ true, true, false, - true + true, + true, + false ] }, "hash": "dd74fa9468b5fe8c8ad657ded06076c11a78d0206af2af20685c691d4d9520bb" diff --git a/backend/.sqlx/query-eced0a09ba547ce1dccb54a5419b22373603c9d01f77047b3553bde125bf71e8.json b/backend/.sqlx/query-eced0a09ba547ce1dccb54a5419b22373603c9d01f77047b3553bde125bf71e8.json index b2f72a0f94..be594f4b98 100644 --- a/backend/.sqlx/query-eced0a09ba547ce1dccb54a5419b22373603c9d01f77047b3553bde125bf71e8.json +++ b/backend/.sqlx/query-eced0a09ba547ce1dccb54a5419b22373603c9d01f77047b3553bde125bf71e8.json @@ -112,6 +112,16 @@ "ordinal": 21, "name": "retry", "type_info": "Jsonb" + }, + { + "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" } ], "parameters": { @@ -143,7 +153,9 @@ true, true, false, - true + true, + true, + false ] }, "hash": "eced0a09ba547ce1dccb54a5419b22373603c9d01f77047b3553bde125bf71e8" diff --git a/backend/.sqlx/query-ef132ac8d79579b08d7359789b6f22991f51e1c945efc2924df6253d62b83bba.json b/backend/.sqlx/query-ef132ac8d79579b08d7359789b6f22991f51e1c945efc2924df6253d62b83bba.json index 73af3f369c..9ea1ab28f3 100644 --- a/backend/.sqlx/query-ef132ac8d79579b08d7359789b6f22991f51e1c945efc2924df6253d62b83bba.json +++ b/backend/.sqlx/query-ef132ac8d79579b08d7359789b6f22991f51e1c945efc2924df6253d62b83bba.json @@ -42,6 +42,7 @@ "bash", "postgresql", "nativets", + "Nativets", "bun", "mysql", "bigquery", diff --git a/backend/.sqlx/query-fc2ec6fc4e22e46cc35b00503eff1eac35a6fdbc82a634b7eb9da4d7931f3582.json b/backend/.sqlx/query-fc2ec6fc4e22e46cc35b00503eff1eac35a6fdbc82a634b7eb9da4d7931f3582.json index 7349e7c860..a32600cede 100644 --- a/backend/.sqlx/query-fc2ec6fc4e22e46cc35b00503eff1eac35a6fdbc82a634b7eb9da4d7931f3582.json +++ b/backend/.sqlx/query-fc2ec6fc4e22e46cc35b00503eff1eac35a6fdbc82a634b7eb9da4d7931f3582.json @@ -41,7 +41,6 @@ "noop", "appdependencies", "deploymentcallback", - "scheduledscriptwithretry", "singlescriptflow" ] } @@ -66,7 +65,6 @@ "noop", "appdependencies", "deploymentcallback", - "scheduledscriptwithretry", "singlescriptflow" ] } diff --git a/backend/.sqlx/query-fdd3710a381dac33ef5ee5ec5564a4874e6d7807d43fa6ea7b8408cad9e97480.json b/backend/.sqlx/query-fdd3710a381dac33ef5ee5ec5564a4874e6d7807d43fa6ea7b8408cad9e97480.json index 1baa81ce64..b0dafb0da1 100644 --- a/backend/.sqlx/query-fdd3710a381dac33ef5ee5ec5564a4874e6d7807d43fa6ea7b8408cad9e97480.json +++ b/backend/.sqlx/query-fdd3710a381dac33ef5ee5ec5564a4874e6d7807d43fa6ea7b8408cad9e97480.json @@ -112,6 +112,16 @@ "ordinal": 21, "name": "retry", "type_info": "Jsonb" + }, + { + "ordinal": 22, + "name": "summary", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "no_flow_overlap", + "type_info": "Bool" } ], "parameters": { @@ -141,7 +151,9 @@ true, true, false, - true + true, + true, + false ] }, "hash": "fdd3710a381dac33ef5ee5ec5564a4874e6d7807d43fa6ea7b8408cad9e97480" diff --git a/backend/migrations/20231226062524_add_schedule_summary_no_overlap.down.sql b/backend/migrations/20231226062524_add_schedule_summary_no_overlap.down.sql new file mode 100644 index 0000000000..d2f607c5b8 --- /dev/null +++ b/backend/migrations/20231226062524_add_schedule_summary_no_overlap.down.sql @@ -0,0 +1 @@ +-- Add down migration script here diff --git a/backend/migrations/20231226062524_add_schedule_summary_no_overlap.up.sql b/backend/migrations/20231226062524_add_schedule_summary_no_overlap.up.sql new file mode 100644 index 0000000000..910c208007 --- /dev/null +++ b/backend/migrations/20231226062524_add_schedule_summary_no_overlap.up.sql @@ -0,0 +1,3 @@ +-- Add up migration script here +ALTER TABLE schedule ADD COLUMN summary VARCHAR(512); +ALTER TABLE schedule ADD COLUMN no_flow_overlap BOOLEAN NOT NULL DEFAULT FALSE; diff --git a/backend/tests/worker.rs b/backend/tests/worker.rs index 9d9f9216a7..143a9ffe08 100644 --- a/backend/tests/worker.rs +++ b/backend/tests/worker.rs @@ -2871,6 +2871,9 @@ async fn test_script_schedule_handlers(db: Pool) { schedule: format!("{} {} * * * *", then.second(), then.minute()).to_string(), ws_error_handler_muted: None, retry: None, + no_flow_overlap: None, + summary: None, + }; let _ = client.create_schedule("test-workspace", &schedule).await; @@ -2932,6 +2935,8 @@ async fn test_script_schedule_handlers(db: Pool) { schedule: format!("{} {} * * * *", then.second(), then.minute()).to_string(), ws_error_handler_muted: None, retry: None, + summary: None, + no_flow_overlap: None }, ) .await @@ -3009,6 +3014,8 @@ async fn test_flow_schedule_handlers(db: Pool) { schedule: format!("{} {} * * * *", then.second(), then.minute()).to_string(), ws_error_handler_muted: None, retry: None, + no_flow_overlap: None, + summary: None, }; let _ = client.create_schedule("test-workspace", &schedule).await; @@ -3071,6 +3078,8 @@ async fn test_flow_schedule_handlers(db: Pool) { schedule: format!("{} {} * * * *", then.second(), then.minute()).to_string(), ws_error_handler_muted: None, retry: None, + summary: None, + no_flow_overlap: None }, ) .await diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index f5aabb9c13..3e05878bbb 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -2231,7 +2231,8 @@ paths: /w/{workspace}/resources/get_value_interpolated/{path}: get: - summary: get resource interpolated (variables and resources are fully unrolled) + summary: + get resource interpolated (variables and resources are fully unrolled) operationId: getResourceValueInterpolated tags: - resource @@ -2919,7 +2920,8 @@ paths: schema: type: string - name: first_parent_hash - description: mask to filter scripts whom first direct parent has exact hash + description: + mask to filter scripts whom first direct parent has exact hash in: query schema: type: string @@ -3114,7 +3116,8 @@ paths: /workers/custom_tags: get: - summary: get all instance custom tags (tags are used to dispatch jobs to + summary: + get all instance custom tags (tags are used to dispatch jobs to different worker groups) operationId: getCustomTags tags: @@ -3165,7 +3168,8 @@ paths: /w/{workspace}/scripts/delete/h/{hash}: post: - summary: delete script by hash (erase content but keep hash, require admin) + summary: + delete script by hash (erase content but keep hash, require admin) operationId: deleteScriptByHash tags: - script @@ -3404,7 +3408,8 @@ paths: type: string format: date-time - name: scheduled_in_secs - description: schedule the script to execute in the number of seconds starting now + description: + schedule the script to execute in the number of seconds starting now in: query schema: type: integer @@ -3412,7 +3417,8 @@ paths: - $ref: "#/components/parameters/WorkerTag" - $ref: "#/components/parameters/NewJobId" - name: invisible_to_owner - description: make the run invisible to the the script owner (default false) + description: + make the run invisible to the the script owner (default false) in: query schema: type: boolean @@ -4445,7 +4451,8 @@ paths: type: string format: date-time - name: scheduled_in_secs - description: schedule the script to execute in the number of seconds starting now + description: + schedule the script to execute in the number of seconds starting now in: query schema: type: integer @@ -4454,7 +4461,8 @@ paths: - $ref: "#/components/parameters/NewJobId" - $ref: "#/components/parameters/IncludeHeader" - name: invisible_to_owner - description: make the run invisible to the the flow owner (default false) + description: + make the run invisible to the the flow owner (default false) in: query schema: type: boolean @@ -4506,7 +4514,8 @@ paths: type: string format: date-time - name: scheduled_in_secs - description: schedule the script to execute in the number of seconds starting now + description: + schedule the script to execute in the number of seconds starting now in: query schema: type: integer @@ -4515,7 +4524,8 @@ paths: - $ref: "#/components/parameters/NewJobId" - $ref: "#/components/parameters/IncludeHeader" - name: invisible_to_owner - description: make the run invisible to the the flow owner (default false) + description: + make the run invisible to the the flow owner (default false) in: query schema: type: boolean @@ -4553,7 +4563,8 @@ paths: type: string format: date-time - name: scheduled_in_secs - description: schedule the script to execute in the number of seconds starting now + description: + schedule the script to execute in the number of seconds starting now in: query schema: type: integer @@ -4562,7 +4573,8 @@ paths: - $ref: "#/components/parameters/NewJobId" - $ref: "#/components/parameters/IncludeHeader" - name: invisible_to_owner - description: make the run invisible to the the script owner (default false) + description: + make the run invisible to the the script owner (default false) in: query schema: type: boolean @@ -4593,7 +4605,8 @@ paths: - $ref: "#/components/parameters/WorkspaceId" - $ref: "#/components/parameters/IncludeHeader" - name: invisible_to_owner - description: make the run invisible to the the script owner (default false) + description: + make the run invisible to the the script owner (default false) in: query schema: type: boolean @@ -4626,7 +4639,8 @@ paths: - $ref: "#/components/parameters/WorkspaceId" - $ref: "#/components/parameters/IncludeHeader" - name: invisible_to_owner - description: make the run invisible to the the script owner (default false) + description: + make the run invisible to the the script owner (default false) in: query schema: type: boolean @@ -4843,7 +4857,8 @@ paths: - job responses: "200": - description: the timestamp of the db that can be used to compute the drift + description: + the timestamp of the db that can be used to compute the drift content: application/json: schema: @@ -5107,7 +5122,8 @@ paths: /w/{workspace}/jobs/resume_urls/{id}/{resume_id}: get: - summary: get resume urls given a job_id, resume_id and a nonce to resume a flow + summary: + get resume urls given a job_id, resume_id and a nonce to resume a flow operationId: getResumeUrls tags: - job @@ -5658,7 +5674,8 @@ paths: - $ref: "#/components/parameters/WorkspaceId" - name: only_member_of in: query - description: only list the groups the user is member of (default false) + description: + only list the groups the user is member of (default false) schema: type: boolean responses: @@ -5846,7 +5863,8 @@ paths: - $ref: "#/components/parameters/WorkspaceId" - name: only_member_of in: query - description: only list the folders the user is member of (default false) + description: + only list the folders the user is member of (default false) schema: type: boolean responses: @@ -6674,14 +6692,18 @@ paths: - storage_options /w/{workspace}/job_helpers/v2/s3_resource_info: post: - summary: Returns the s3 resource associated to the provided path, or the workspace default S3 resource + summary: + Returns the s3 resource associated to the provided path, or the + workspace default S3 resource operationId: s3ResourceInfo tags: - helpers parameters: - $ref: "#/components/parameters/WorkspaceId" requestBody: - description: S3 resource path to use. If empty, the S3 resource defined in the workspace settings will be used + description: + S3 resource path to use. If empty, the S3 resource defined in the + workspace settings will be used required: true content: application/json: @@ -7015,7 +7037,8 @@ components: type: integer PerPage: name: per_page - description: number of items to return for a given page (default 30, max 100) + description: + number of items to return for a given page (default 30, max 100) in: query schema: type: integer @@ -7143,7 +7166,8 @@ components: type: boolean ScheduledForBeforeNow: name: scheduled_for_before_now - description: filter on jobs scheduled_for before now (hence waitinf for a worker) + description: + filter on jobs scheduled_for before now (hence waitinf for a worker) in: query schema: type: boolean @@ -7161,7 +7185,8 @@ components: type: boolean ArgsFilter: name: args - description: filter on jobs containing those args as a json subset (@> in postgres) + description: + filter on jobs containing those args as a json subset (@> in postgres) in: query schema: type: string @@ -7173,7 +7198,8 @@ components: type: string ResultFilter: name: result - description: filter on jobs containing those result as a json subset (@> in postgres) + description: + filter on jobs containing those result as a json subset (@> in postgres) in: query schema: type: string @@ -8399,6 +8425,10 @@ components: type: boolean retry: $ref: "../../openflow.openapi.yaml#/components/schemas/Retry" + summary: + type: string + no_flow_overlap: + type: boolean required: - path - edited_by @@ -8468,6 +8498,10 @@ components: type: boolean retry: $ref: "../../openflow.openapi.yaml#/components/schemas/Retry" + no_flow_overlap: + type: boolean + summary: + type: string required: - path - schedule @@ -8504,6 +8538,10 @@ components: type: boolean retry: $ref: "../../openflow.openapi.yaml#/components/schemas/Retry" + no_flow_overlap: + type: boolean + summary: + type: string required: - schedule - timezone diff --git a/backend/windmill-api/src/schedule.rs b/backend/windmill-api/src/schedule.rs index fa5315a06a..7d909b098d 100644 --- a/backend/windmill-api/src/schedule.rs +++ b/backend/windmill-api/src/schedule.rs @@ -54,6 +54,8 @@ pub struct NewSchedule { pub path: String, pub schedule: String, pub timezone: String, + pub summary: Option, + pub no_flow_overlap: Option, pub script_path: String, pub is_flow: bool, pub args: Option, @@ -153,9 +155,9 @@ async fn create_schedule( "INSERT INTO schedule (workspace_id, path, schedule, timezone, edited_by, script_path, \ is_flow, args, enabled, email, on_failure, on_failure_times, on_failure_exact, \ on_failure_extra_args, on_recovery, on_recovery_times, on_recovery_extra_args, \ - ws_error_handler_muted, retry \ + ws_error_handler_muted, retry, summary, no_flow_overlap \ ) VALUES ( \ - $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19 \ + $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21 \ ) RETURNING *", w_id, ns.path, @@ -176,6 +178,8 @@ async fn create_schedule( ns.on_recovery_extra_args, ns.ws_error_handler_muted.unwrap_or(false), ns.retry, + ns.summary, + ns.no_flow_overlap.unwrap_or(false), ) .fetch_one(&mut tx) .await @@ -229,8 +233,8 @@ async fn edit_schedule( Schedule, "UPDATE schedule SET schedule = $1, timezone = $2, args = $3, on_failure = $4, on_failure_times = $5, \ on_failure_exact = $6, on_failure_extra_args = $7, on_recovery = $8, on_recovery_times = $9, \ - on_recovery_extra_args = $10, ws_error_handler_muted = $11, retry = $12 - WHERE path = $13 AND workspace_id = $14 RETURNING *", + on_recovery_extra_args = $10, ws_error_handler_muted = $11, retry = $12, summary = $13, no_flow_overlap = $14 \ + WHERE path = $15 AND workspace_id = $16 RETURNING *", es.schedule, es.timezone, es.args, @@ -243,6 +247,8 @@ async fn edit_schedule( es.on_recovery_extra_args, es.ws_error_handler_muted.unwrap_or(false), es.retry, + es.summary, + es.no_flow_overlap.unwrap_or(false), path, w_id, ) @@ -336,6 +342,8 @@ pub struct ScheduleWJobs { pub ws_error_handler_muted: bool, pub retry: Option, pub jobs: Option>, + pub summary: Option, + pub no_flow_overlap: bool, } async fn list_schedule_with_jobs( @@ -673,6 +681,7 @@ pub struct EditSchedule { pub schedule: String, pub timezone: String, pub args: Option, + pub summary: Option, pub on_failure: Option, pub on_failure_times: Option, pub on_failure_exact: Option, @@ -682,6 +691,7 @@ pub struct EditSchedule { pub on_recovery_extra_args: Option, pub ws_error_handler_muted: Option, pub retry: Option, + pub no_flow_overlap: Option, } pub async fn clear_schedule<'c>( diff --git a/backend/windmill-common/src/schedule.rs b/backend/windmill-common/src/schedule.rs index ebb2f53a0d..30823ef94f 100644 --- a/backend/windmill-common/src/schedule.rs +++ b/backend/windmill-common/src/schedule.rs @@ -37,6 +37,8 @@ pub struct Schedule { pub on_recovery_extra_args: Option, pub ws_error_handler_muted: bool, pub retry: Option, + pub no_flow_overlap: bool, + pub summary: Option, } impl Schedule { diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index 0ac14866ad..44e6f04996 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -1003,6 +1003,8 @@ pub async fn handle_maybe_scheduled_job<'c, R: rsmq_async::RsmqConnection + Clon on_recovery_extra_args: schedule.on_recovery_extra_args, ws_error_handler_muted: schedule.ws_error_handler_muted, retry: schedule.retry, + summary: schedule.summary, + no_flow_overlap: schedule.no_flow_overlap, }, ) .await; diff --git a/backend/windmill-worker/src/worker_flow.rs b/backend/windmill-worker/src/worker_flow.rs index 687cca6cd9..92e1a8dede 100644 --- a/backend/windmill-worker/src/worker_flow.rs +++ b/backend/windmill-worker/src/worker_flow.rs @@ -1149,6 +1149,41 @@ async fn push_next_flow_job let arc_flow_job_args = Arc::new(flow_job_args.clone()); if i == 0 { + // if !flow_job.is_flow_step && flow_job.schedule_path.is_some() { + // let not_allow_overlap = sqlx::query_scalar!( + // "SELECT not_allow_overlap FROM schedule WHERE path = $1 AND workspace_id = $2", + // flow_job.schedule_path.as_ref().unwrap(), + // flow_job.workspace_id.as_str() + // ) + // .fetch_one(db) + // .await?; + // if not_allow_overlap.fetch_one(db).await? { + // let count = sqlx::query_scalar!( + // "SELECT count(*) FROM queue WHERE schedule_path = $1 AND workspace_id = $2 AND id != $3 AND (flow_status->>'step')::int = 0", + // flow_job.schedule_path.as_ref().unwrap(), + // flow_job.workspace_id.as_str(), + // flow_job.id + // ).fetch_one(db).await?; + // if count > 1 { + // return update_flow_status_after_job_completion( + // db, + // client, + // flow_job.id, + // &Uuid::nil(), + // flow_job.workspace_id.as_str(), + // true, + // serde_json::from_str("\"not allowed to overlap\"").unwrap(), + // true, + // same_worker_tx, + // worker_dir, + // Some(true), + // rsmq, + // worker_name, + // ) + // .await; + // } + // } + // } if let Some(skip_expr) = &flow.skip_expr { let skip = compute_bool_from_expr( skip_expr.to_string(), diff --git a/frontend/src/lib/components/ScheduleEditorInner.svelte b/frontend/src/lib/components/ScheduleEditorInner.svelte index 5b416bd29a..bb35c51de3 100644 --- a/frontend/src/lib/components/ScheduleEditorInner.svelte +++ b/frontend/src/lib/components/ScheduleEditorInner.svelte @@ -1,5 +1,5 @@ @@ -402,9 +410,35 @@
- {#if !edit} -
+
+
+

Metadata

+
+ + { + if (!edit && summary?.length > 0 && !dirtyPath) { + pathC?.setName( + summary + .toLowerCase() + .replace(/[^a-z0-9_]/g, '_') + .replace(/-+/g, '_') + .replace(/^-|-$/g, '') + ) + } + }} + /> +
+
+ {#if !edit} -
- {/if} + {:else} +
+ + Schedule path (not editable) + + { + currentTarget.select() + }} + /> + +
+ {/if} +
+
Schedules use CRON syntax. Seconds are mandatory. diff --git a/frontend/src/lib/components/apps/components/inputs/AppSelect.svelte b/frontend/src/lib/components/apps/components/inputs/AppSelect.svelte index 7451513b2f..34048ff07c 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppSelect.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppSelect.svelte @@ -77,8 +77,8 @@ listItems = Array.isArray(resolvedConfig.items) ? resolvedConfig.items.map((item) => { return { - label: item.label, - value: JSON.stringify(item.value) + label: item?.label ?? 'undefined', + value: item?.value != undefined ? JSON.stringify(item.value) : 'undefined' } }) : [] diff --git a/frontend/src/lib/components/apps/editor/DecisionTreeDebug.svelte b/frontend/src/lib/components/apps/editor/DecisionTreeDebug.svelte index 4c21e1ae02..a9037f584c 100644 --- a/frontend/src/lib/components/apps/editor/DecisionTreeDebug.svelte +++ b/frontend/src/lib/components/apps/editor/DecisionTreeDebug.svelte @@ -9,8 +9,6 @@ export let nodes: DecisionTreeNode[] = [] export let id: string - export let isConditionalDebugMode: boolean = false - const { componentControl } = getContext('AppViewerContext') const dispatch = createEventDispatcher() @@ -18,7 +16,7 @@