diff --git a/CHANGELOG.md b/CHANGELOG.md index cfcd62c85f..bfe137eaed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [1.379.3](https://github.com/windmill-labs/windmill/compare/v1.379.2...v1.379.3) (2024-08-13) + + +### Bug Fixes + +* improve scrolling performance of the runs page ([0be8982](https://github.com/windmill-labs/windmill/commit/0be8982ddc263b76dab2c87cb6fa63e21effd58c)) + +## [1.379.2](https://github.com/windmill-labs/windmill/compare/v1.379.1...v1.379.2) (2024-08-13) + + +### Bug Fixes + +* add fetch connection limits to bun type fetcher ([b9924d0](https://github.com/windmill-labs/windmill/commit/b9924d01d54f6dfaf5d719c13a38bb3dccbfe3b9)) +* extend step_id being returned as part of the error of every languages ([bcc94ba](https://github.com/windmill-labs/windmill/commit/bcc94badbd848b6838dd0e353c3a30e7a1889ff8)) +* **frontend:** date input is more flexible and accept default html format as a fallback ([b424c61](https://github.com/windmill-labs/windmill/commit/b424c61e95e3cc9213d4d3efbe4173857d4e80fd)) +* improve logviewer behavior when job is loading ([7a68cc7](https://github.com/windmill-labs/windmill/commit/7a68cc76c2d5d7a66f080afdfcb6c5cd09fc25b5)) + +## [1.379.1](https://github.com/windmill-labs/windmill/compare/v1.379.0...v1.379.1) (2024-08-13) + + +### Bug Fixes + +* add an option to disable bundling globally ([f00545f](https://github.com/windmill-labs/windmill/commit/f00545f1691c5107d1103f89bf68fdc3915ddd82)) +* **apps:** improve tanstack table handling of objects ([1d0807f](https://github.com/windmill-labs/windmill/commit/1d0807f54238c8d8d242e3e5534c6d0868b3172b)) + ## [1.379.0](https://github.com/windmill-labs/windmill/compare/v1.378.0...v1.379.0) (2024-08-13) diff --git a/backend/.sqlx/query-44d0c89afbc472165d80ca7a14b391bc2e5c44e0953103790dfe9375f605ee65.json b/backend/.sqlx/query-28a878c59b6d52f42d315eabb34c96133b69542b01232295c26cc9e093c372f9.json similarity index 55% rename from backend/.sqlx/query-44d0c89afbc472165d80ca7a14b391bc2e5c44e0953103790dfe9375f605ee65.json rename to backend/.sqlx/query-28a878c59b6d52f42d315eabb34c96133b69542b01232295c26cc9e093c372f9.json index 4005465103..fcdf2ac38d 100644 --- a/backend/.sqlx/query-44d0c89afbc472165d80ca7a14b391bc2e5c44e0953103790dfe9375f605ee65.json +++ b/backend/.sqlx/query-28a878c59b6d52f42d315eabb34c96133b69542b01232295c26cc9e093c372f9.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT coalesce(COUNT(*) FILTER(WHERE suspend = 0), 0) as \"database_length!\", coalesce(COUNT(*) FILTER(WHERE suspend > 0), 0) as \"suspended!\" FROM queue WHERE (workspace_id = $1 OR $2) AND scheduled_for <= now() AND running = false", + "query": "SELECT coalesce(COUNT(*) FILTER(WHERE suspend = 0 AND running = false), 0) as \"database_length!\", coalesce(COUNT(*) FILTER(WHERE suspend > 0), 0) as \"suspended!\" FROM queue WHERE (workspace_id = $1 OR $2) AND scheduled_for <= now()", "describe": { "columns": [ { @@ -25,5 +25,5 @@ null ] }, - "hash": "44d0c89afbc472165d80ca7a14b391bc2e5c44e0953103790dfe9375f605ee65" + "hash": "28a878c59b6d52f42d315eabb34c96133b69542b01232295c26cc9e093c372f9" } diff --git a/backend/Cargo.lock b/backend/Cargo.lock index ecd7f3495b..c50d92967d 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -377,7 +377,7 @@ dependencies = [ "arrow-schema", "chrono", "half", - "indexmap 2.3.0", + "indexmap 2.4.0", "lexical-core", "num", "serde", @@ -1105,7 +1105,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 1.0.1", "tokio", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -2264,7 +2264,7 @@ dependencies = [ "glob", "half", "hashbrown 0.14.5", - "indexmap 2.3.0", + "indexmap 2.4.0", "itertools 0.12.1", "log", "num_cpus", @@ -2433,7 +2433,7 @@ dependencies = [ "datafusion-expr", "datafusion-physical-expr", "hashbrown 0.14.5", - "indexmap 2.3.0", + "indexmap 2.4.0", "itertools 0.12.1", "log", "regex-syntax 0.8.4", @@ -2462,7 +2462,7 @@ dependencies = [ "half", "hashbrown 0.14.5", "hex", - "indexmap 2.3.0", + "indexmap 2.4.0", "itertools 0.12.1", "log", "paste", @@ -2506,7 +2506,7 @@ dependencies = [ "futures", "half", "hashbrown 0.14.5", - "indexmap 2.3.0", + "indexmap 2.4.0", "itertools 0.12.1", "log", "once_cell", @@ -2664,7 +2664,7 @@ dependencies = [ "tokio-rustls 0.26.0", "tokio-socks", "tokio-util", - "tower", + "tower 0.4.13", "tower-http", "tower-service", ] @@ -3884,7 +3884,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.3.0", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -3903,7 +3903,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.3.0", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -4284,7 +4284,7 @@ dependencies = [ "pin-project-lite", "socket2 0.5.7", "tokio", - "tower", + "tower 0.4.13", "tower-service", "tracing", ] @@ -4357,9 +4357,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -4539,7 +4539,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee7893dab2e44ae5f9d0173f26ff4aa327c10b01b06a72b52dd9405b628640d" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", ] [[package]] @@ -5814,7 +5814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.3.0", + "indexmap 2.4.0", ] [[package]] @@ -7532,7 +7532,7 @@ version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "itoa", "memchr", "ryu", @@ -7636,7 +7636,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "serde_derive", "serde_json", @@ -7662,7 +7662,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "itoa", "ryu", "serde", @@ -8042,7 +8042,7 @@ dependencies = [ "hashbrown 0.14.5", "hashlink", "hex", - "indexmap 2.3.0", + "indexmap 2.4.0", "log", "memchr", "once_cell", @@ -8419,7 +8419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84b67e115ab136fe0eb03558bb0508ca7782eeb446a96d165508c48617e3fd94" dependencies = [ "anyhow", - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "serde_json", "swc_cached", @@ -8570,7 +8570,7 @@ checksum = "d37dc505c92af56d0f77cf6f31a6ccd37ac40cad1e01ff77277e0b1c70e8f8ff" dependencies = [ "better_scoped_tls", "bitflags 2.6.0", - "indexmap 2.3.0", + "indexmap 2.4.0", "once_cell", "phf", "rustc-hash 1.1.0", @@ -8639,7 +8639,7 @@ checksum = "446da32cac8299973aaf1d37496562bfd0c1e4f3c3ab5d0af6f07f42e8184102" dependencies = [ "base64 0.21.7", "dashmap", - "indexmap 2.3.0", + "indexmap 2.4.0", "once_cell", "serde", "sha1", @@ -8678,7 +8678,7 @@ version = "0.130.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13e62b199454a576c5fdbd7e1bef8ab88a395427456d8a713d994b7d469833aa" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "num_cpus", "once_cell", "rustc-hash 1.1.0", @@ -9437,7 +9437,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "serde_spanned", "toml_datetime", @@ -9450,7 +9450,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "toml_datetime", "winnow 0.5.40", ] @@ -9461,7 +9461,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "serde_spanned", "toml_datetime", @@ -9497,6 +9497,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36b837f86b25d7c0d7988f00a54e74739be6477f2aac6201b8f429a7569991b7" +dependencies = [ + "tower-layer", + "tower-service", +] + [[package]] name = "tower-cookies" version = "0.10.0" @@ -9537,15 +9547,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -10398,7 +10408,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "axum", @@ -10438,7 +10448,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "argon2", @@ -10501,7 +10511,7 @@ dependencies = [ "tokio-native-tls", "tokio-tar", "tokio-util", - "tower", + "tower 0.5.0", "tower-cookies", "tower-http", "tracing", @@ -10522,7 +10532,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.379.0" +version = "1.379.3" dependencies = [ "base64 0.21.7", "chrono", @@ -10540,7 +10550,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.379.0" +version = "1.379.3" dependencies = [ "chrono", "serde", @@ -10553,7 +10563,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "async-stream", @@ -10568,7 +10578,7 @@ dependencies = [ "hex", "hmac", "hyper 1.4.1", - "indexmap 2.3.0", + "indexmap 2.4.0", "itertools 0.13.0", "lazy_static", "magic-crypt", @@ -10594,7 +10604,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.379.0" +version = "1.379.3" dependencies = [ "regex", "rsmq_async", @@ -10609,7 +10619,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "bytes", @@ -10630,7 +10640,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.379.0" +version = "1.379.3" dependencies = [ "serde", "serde_json", @@ -10638,7 +10648,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "lazy_static", @@ -10649,7 +10659,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "gosyn", @@ -10661,7 +10671,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "lazy_static", @@ -10672,7 +10682,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -10686,7 +10696,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "itertools 0.13.0", @@ -10697,7 +10707,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "async-recursion", @@ -10714,7 +10724,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "lazy_static", @@ -10725,7 +10735,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -10744,7 +10754,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -10763,7 +10773,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "async-recursion", @@ -10796,7 +10806,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.379.0" +version = "1.379.3" dependencies = [ "wasm-bindgen", "wasm-bindgen-test", @@ -10806,7 +10816,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.379.0" +version = "1.379.3" dependencies = [ "anyhow", "async-recursion", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index f55145399e..4cb4a7c5a2 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.379.0" +version = "1.379.3" authors.workspace = true edition.workspace = true @@ -25,7 +25,7 @@ members = [ ] [workspace.package] -version = "1.379.0" +version = "1.379.3" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 67c39c95b6..ce5664ad2c 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -80d9e507977b55d0b76272905c969c3d6e830083 \ No newline at end of file +c654f4b6406e5d2608446cb644fb23ac1c7287a8 \ No newline at end of file diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index f1710b526f..81feee52f2 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.379.0 + version: 1.379.3 title: Windmill API contact: diff --git a/backend/windmill-api/src/settings.rs b/backend/windmill-api/src/settings.rs index 63bb0b11ce..b26ee8bab0 100644 --- a/backend/windmill-api/src/settings.rs +++ b/backend/windmill-api/src/settings.rs @@ -21,6 +21,9 @@ use axum::{ Json, Router, }; +#[cfg(feature = "enterprise")] +use axum::extract::Query; + use serde::Deserialize; use windmill_common::{ error::{self, JsonResult, Result}, @@ -237,12 +240,12 @@ pub async fn set_global_setting_internal( } v => { sqlx::query!( - "INSERT INTO global_settings (name, value) VALUES ($1, $2) ON CONFLICT (name) DO UPDATE SET value = $2, updated_at = now()", - key, - v - ) - .execute(db) - .await?; + "INSERT INTO global_settings (name, value) VALUES ($1, $2) ON CONFLICT (name) DO UPDATE SET value = $2, updated_at = now()", + key, + v + ) + .execute(db) + .await?; tracing::info!("Set global setting {} to {}", key, v); } }; @@ -339,6 +342,12 @@ pub async fn get_latest_key_renewal_attempt( } } +#[cfg(feature = "enterprise")] +#[derive(Deserialize)] +pub struct LicenseQuery { + license_key: Option, +} + #[cfg(not(feature = "enterprise"))] pub async fn renew_license_key() -> Result { return Err(error::Error::BadRequest( @@ -347,15 +356,23 @@ pub async fn renew_license_key() -> Result { } #[cfg(feature = "enterprise")] -pub async fn renew_license_key(Extension(db): Extension, authed: ApiAuthed) -> Result { +pub async fn renew_license_key( + Extension(db): Extension, + Query(LicenseQuery { license_key }): Query, + authed: ApiAuthed, +) -> Result { require_super_admin(&db, &authed.email).await?; windmill_common::stats_ee::send_stats(&"manual".to_string(), &HTTP_CLIENT, &db).await?; - let result = windmill_common::ee::renew_license_key(&HTTP_CLIENT, &db, None).await; + let result = windmill_common::ee::renew_license_key(&HTTP_CLIENT, &db, license_key).await; if result != "success" { return Err(error::Error::BadRequest(format!( "Failed to renew license key: {}", - result + if result == "Unauthorized" { + "Invalid key".to_string() + } else { + result + } ))); } else { return Ok("Renewed license key".to_string()); @@ -370,8 +387,11 @@ pub async fn create_customer_portal_session() -> Result { } #[cfg(feature = "enterprise")] -pub async fn create_customer_portal_session() -> Result { - let url = windmill_common::ee::create_customer_portal_session(&HTTP_CLIENT, None).await?; +pub async fn create_customer_portal_session( + Query(LicenseQuery { license_key }): Query, +) -> Result { + let url = + windmill_common::ee::create_customer_portal_session(&HTTP_CLIENT, license_key).await?; return Ok(url); } diff --git a/backend/windmill-common/src/global_settings.rs b/backend/windmill-common/src/global_settings.rs index a49b755ddb..b5d6e6da4d 100644 --- a/backend/windmill-common/src/global_settings.rs +++ b/backend/windmill-common/src/global_settings.rs @@ -30,7 +30,7 @@ pub const DEV_INSTANCE_SETTING: &str = "dev_instance"; pub const JWT_SECRET_SETTING: &str = "jwt_secret"; pub const EMAIL_DOMAIN_SETTING: &str = "email_domain"; -pub const ENV_SETTINGS: [&str; 50] = [ +pub const ENV_SETTINGS: [&str; 51] = [ "DISABLE_NSJAIL", "MODE", "NUM_WORKERS", @@ -81,4 +81,5 @@ pub const ENV_SETTINGS: [&str; 50] = [ "MAX_WAIT_FOR_SIGTERM", "WORKER_GROUP", "SAML_METADATA", + "INSTANCE_IS_DEV", ]; diff --git a/backend/windmill-common/src/worker.rs b/backend/windmill-common/src/worker.rs index 4e6e7d7d50..292a4aef2e 100644 --- a/backend/windmill-common/src/worker.rs +++ b/backend/windmill-common/src/worker.rs @@ -78,6 +78,11 @@ lazy_static::lazy_static! { static ref CUSTOM_TAG_REGEX: Regex = Regex::new(r"^(\w+)\(((?:\w+)\+?)+\)$").unwrap(); + pub static ref DISABLE_BUNDLING: bool = std::env::var("DISABLE_BUNDLING") + .ok() + .and_then(|x| x.parse::().ok()) + .unwrap_or(false); + } pub async fn make_suspended_pull_query(wc: &WorkerConfig) { @@ -232,7 +237,8 @@ pub fn get_annotation(inner_content: &str) -> Annotations { let native_mode: bool = annotations.contains(&"native".to_string()); //TODO: remove || npm_mode when bun build is more powerful - let nobundling: bool = annotations.contains(&"nobundling".to_string()) || nodejs_mode; + let nobundling: bool = + annotations.contains(&"nobundling".to_string()) || nodejs_mode || *DISABLE_BUNDLING; Annotations { npm_mode, nodejs_mode, native_mode, nobundling } } diff --git a/backend/windmill-worker/src/pg_executor.rs b/backend/windmill-worker/src/pg_executor.rs index 3fb96677fd..f679d6c003 100644 --- a/backend/windmill-worker/src/pg_executor.rs +++ b/backend/windmill-worker/src/pg_executor.rs @@ -561,6 +561,9 @@ pub fn pg_cell_to_json_value( Type::TIME => get_basic(row, column, column_i, |a: chrono::NaiveTime| { Ok(JSONValue::String(a.to_string())) })?, + Type::TIMETZ => get_basic(row, column, column_i, |a: TimeTZStr| { + Ok(JSONValue::String(a.0)) + })?, Type::TIMESTAMPTZ => get_basic(row, column, column_i, |a: chrono::DateTime| { Ok(JSONValue::String(a.to_string())) })?, @@ -633,6 +636,9 @@ pub fn pg_cell_to_json_value( Type::TIME_ARRAY => get_array(row, column, column_i, |a: chrono::NaiveTime| { Ok(JSONValue::String(a.to_string())) })?, + Type::TIMETZ_ARRAY => get_array(row, column, column_i, |a: TimeTZStr| { + Ok(JSONValue::String(a.0)) + })?, Type::TIMESTAMPTZ_ARRAY => get_array(row, column, column_i, |a: chrono::DateTime| { Ok(JSONValue::String(a.to_string())) })?, @@ -699,6 +705,28 @@ impl<'a> FromSql<'a> for IntervalStr { } } +struct TimeTZStr(String); +impl<'a> FromSql<'a> for TimeTZStr { + fn from_sql( + _: &Type, + mut raw: &'a [u8], + ) -> Result> { + let microsecond = raw.get_i64(); + let offset = raw.get_i32(); + let utc_sec = (microsecond / 1_000_000) + offset as i64; + let utc = chrono::NaiveTime::from_num_seconds_from_midnight_opt( + ((utc_sec + 3600 * 24) % (3600 * 24)) as u32, + ((microsecond % 1_000_000) * 1_000) as u32, + ) + .ok_or_else(|| anyhow::anyhow!("Invalid time value"))?; + Ok(TimeTZStr(format!("{:?} UTC", utc))) + } + + fn accepts(ty: &Type) -> bool { + matches!(ty, &Type::TIMETZ) + } +} + fn get_array<'a, T: FromSql<'a>>( row: &'a Row, column: &Column, diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index fecd551fae..745e3a10ac 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -2170,9 +2170,20 @@ pub async fn handle_job_error Box { +#[derive(Debug, Serialize)] +struct SerializedError { + message: String, + name: String, + #[serde(skip_serializing_if = "Option::is_none")] + step_id: Option, +} +fn extract_error_value(log_lines: &str, i: i32, step_id: Option) -> Box { return to_raw_value( - &json!({"message": format!("ExitCode: {i}, last log lines:\n{}", ANSI_ESCAPE_RE.replace_all(log_lines.trim(), "").to_string()), "name": "ExecutionErr"}), + &SerializedError { + message: format!("ExitCode: {i}, last log lines:\n{}", ANSI_ESCAPE_RE.replace_all(log_lines.trim(), "").to_string()), + name: "ExecutionErr".to_string(), + step_id, + }, ); } @@ -2640,11 +2651,15 @@ async fn process_result( .last() .unwrap_or(&last_10_log_lines); - extract_error_value(log_lines, i) + extract_error_value(log_lines, i, job.flow_step_id.clone()) } } err @ _ => to_raw_value( - &json!({"message": format!("error during execution of the script:\n{}", err), "name": "ExecutionErr"}), + &SerializedError { + message: format!("error during execution of the script:\n{}", err), + name: "ExecutionErr".to_string(), + step_id: job.flow_step_id.clone(), + }, ), }; diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index 458aa1f44c..a3a5734b01 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.379.0"; +export const VERSION = "v1.379.3"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/cli/main.ts b/cli/main.ts index 4fb7e6a3a5..6d241cfb5b 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -34,7 +34,7 @@ addEventListener("error", (event) => { } }); -export const VERSION = "v1.379.0"; +export const VERSION = "v1.379.3"; let command: any = new Command() .name("wmill") diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 994c78f994..4e61d29524 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-components", - "version": "1.379.0", + "version": "1.379.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-components", - "version": "1.379.0", + "version": "1.379.3", "license": "AGPL-3.0", "dependencies": { "@aws-crypto/sha256-js": "^4.0.0", @@ -41,6 +41,7 @@ "monaco-languageclient": "~7.0.1", "ol": "^7.4.0", "openai": "^4.47.1", + "p-limit": "^6.1.0", "pdfjs-dist": "^3.8.162", "quill": "^1.3.7", "rfc4648": "^1.5.3", @@ -7595,15 +7596,15 @@ } }, "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.1.0.tgz", + "integrity": "sha512-H0jc0q1vOzlEk0TqAKXKZxdl7kX3OFUzCnNVUnq5Pc3DGo0kpeaMuPqxQn235HibwBEb0/pm9dgKTjXy66fBkg==", + "license": "MIT", "dependencies": { - "yocto-queue": "^0.1.0" + "yocto-queue": "^1.1.1" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -7624,6 +7625,35 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/pako": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", @@ -10927,12 +10957,12 @@ } }, "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" diff --git a/frontend/package.json b/frontend/package.json index 6b3529168a..557277ec49 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "windmill-components", - "version": "1.379.0", + "version": "1.379.3", "scripts": { "dev": "vite dev", "build": "vite build", @@ -122,6 +122,7 @@ "monaco-languageclient": "~7.0.1", "ol": "^7.4.0", "openai": "^4.47.1", + "p-limit": "^6.1.0", "pdfjs-dist": "^3.8.162", "quill": "^1.3.7", "rfc4648": "^1.5.3", diff --git a/frontend/src/lib/ata/apis.ts b/frontend/src/lib/ata/apis.ts index 6bd8fad530..b2a18d3fec 100644 --- a/frontend/src/lib/ata/apis.ts +++ b/frontend/src/lib/ata/apis.ts @@ -1,5 +1,7 @@ // https://github.com/jsdelivr/data.jsdelivr.com +import pLimit from 'p-limit' + export const getNPMVersionsForModule = (moduleName: string, resLimit: ResLimit) => { const url = `https://data.jsdelivr.com/v1/package/npm/${moduleName}` return api<{ tags: Record; versions: string[] }>(url, resLimit, { @@ -51,7 +53,7 @@ export const getDTSFileForModuleWithVersion = async ( ) => { // file comes with a prefix / const url = `https://cdn.jsdelivr.net/npm/${moduleName}@${version}${file}` - const res = await fetch(url) + const res = await limit(() => fetch(url)) if (res.ok) { return res.text() } else { @@ -67,6 +69,8 @@ export function isOverlimit(resLimit: ResLimit) { return resLimit.usage > 5000000 } +export const limit = pLimit(6) + function api(url: string, resLimit: ResLimit, init?: RequestInit): Promise { if (isOverlimit(resLimit)) { console.warn( @@ -75,16 +79,18 @@ function api(url: string, resLimit: ResLimit, init?: RequestInit): Promise new Error('Exceeded limit of 100MB of data downloaded.')) } - return fetch(url, init).then((res) => { - if (res.ok) { - return res.text().then((text) => { - resLimit.usage += text.length - console.log('resLimit', url, resLimit.usage) + return limit(() => + fetch(url, init).then((res) => { + if (res.ok) { + return res.text().then((text) => { + resLimit.usage += text.length + console.log('resLimit', url, resLimit.usage) - return JSON.parse(text) as T - }) as Promise - } else { - return new Error('OK') - } - }) + return JSON.parse(text) as T + }) as Promise + } else { + return new Error('OK') + } + }) + ) } diff --git a/frontend/src/lib/ata/index.ts b/frontend/src/lib/ata/index.ts index 4be56edb0f..1a2ade62f2 100644 --- a/frontend/src/lib/ata/index.ts +++ b/frontend/src/lib/ata/index.ts @@ -4,6 +4,7 @@ import { getNPMVersionForModuleReference, getNPMVersionsForModule, isOverlimit, + limit, type NPMTreeMeta, type ResLimit } from './apis' @@ -49,6 +50,7 @@ export const setupTypeAcquisition = (config: ATABootstrapConfig) => { const moduleMap = new Map() const fsMap = new Map() + limit.clearQueue() let estimatedToDownload = 0 let estimatedDownloaded = 0 diff --git a/frontend/src/lib/components/DateInput.svelte b/frontend/src/lib/components/DateInput.svelte index ad4c17c2d7..eb4b650c76 100644 --- a/frontend/src/lib/components/DateInput.svelte +++ b/frontend/src/lib/components/DateInput.svelte @@ -1,6 +1,7 @@ { let { job } = detail if (job.script_path != lastScriptPath && job.script_path) { diff --git a/frontend/src/lib/components/FlowStatusViewerInner.svelte b/frontend/src/lib/components/FlowStatusViewerInner.svelte index d9d9b284e7..6463d58334 100644 --- a/frontend/src/lib/components/FlowStatusViewerInner.svelte +++ b/frontend/src/lib/components/FlowStatusViewerInner.svelte @@ -65,6 +65,7 @@ export let reducedPolling = false export let wideResults = false + export let hideFlowResult = false let jobResults: any[] = flowJobIds?.flowJobs?.map((x, id) => `iter #${id + 1} not loaded by frontend yet`) ?? [] @@ -639,16 +640,18 @@ {:else if `result` in job} -
- -
+ {#if !hideFlowResult} +
+ +
+ {/if} {:else if job.flow_status?.modules?.[job?.flow_status?.step]?.type === 'WaitingForEvents'} {:else if $suspendStatus && Object.keys($suspendStatus).length > 0} diff --git a/frontend/src/lib/components/InstanceSettings.svelte b/frontend/src/lib/components/InstanceSettings.svelte index 4d81ccad68..4f7f4e2bea 100644 --- a/frontend/src/lib/components/InstanceSettings.svelte +++ b/frontend/src/lib/components/InstanceSettings.svelte @@ -718,6 +718,7 @@ /> {:else if setting.fieldType == 'password'} diff --git a/frontend/src/lib/components/ObjectStoreConfigSettings.svelte b/frontend/src/lib/components/ObjectStoreConfigSettings.svelte index a66b640486..b11b854f34 100644 --- a/frontend/src/lib/components/ObjectStoreConfigSettings.svelte +++ b/frontend/src/lib/components/ObjectStoreConfigSettings.svelte @@ -148,7 +148,7 @@ If left empty, will be derived automatically from $AWS_SECRET_KEY, pod or ec2 profile - +