From 03c173ae078f88556873d04dadd857599d5df009 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 16 Jun 2025 15:16:56 +0200 Subject: [PATCH] warn for raw scripts --- ...17261771ac61d46d82d42d085ffebeb18be06.json | 22 +++++++++++++++++++ backend/windmill-api/src/scripts.rs | 13 ++++++++--- backend/windmill-common/src/utils.rs | 2 +- 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 backend/.sqlx/query-8373b2649ab46310860adbdd7b717261771ac61d46d82d42d085ffebeb18be06.json diff --git a/backend/.sqlx/query-8373b2649ab46310860adbdd7b717261771ac61d46d82d42d085ffebeb18be06.json b/backend/.sqlx/query-8373b2649ab46310860adbdd7b717261771ac61d46d82d42d085ffebeb18be06.json new file mode 100644 index 0000000000..3df7f08318 --- /dev/null +++ b/backend/.sqlx/query-8373b2649ab46310860adbdd7b717261771ac61d46d82d42d085ffebeb18be06.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT distinct(path) FROM script WHERE workspace_id = $1 AND archived = true", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "path", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "8373b2649ab46310860adbdd7b717261771ac61d46d82d42d085ffebeb18be06" +} diff --git a/backend/windmill-api/src/scripts.rs b/backend/windmill-api/src/scripts.rs index 8ac824e4c1..5e49dc4d1c 100644 --- a/backend/windmill-api/src/scripts.rs +++ b/backend/windmill-api/src/scripts.rs @@ -1354,9 +1354,16 @@ async fn raw_script_by_path_internal( ) .fetch_all(&db) .await?; - tracing::info!( - "Script {path} does not exist in workspace {w_id} but these paths do: {:?}", - other_script_o.join(", ") + let other_script_archived = sqlx::query_scalar!( + "SELECT distinct(path) FROM script WHERE workspace_id = $1 AND archived = true", + w_id + ) + .fetch_all(&db) + .await?; + tracing::warn!( + "Script {path} does not exist in workspace {w_id} but these paths do, non-archived: {:?} | archived: {:?}", + other_script_o.join(", "), + other_script_archived.join(", ") ) } } diff --git a/backend/windmill-common/src/utils.rs b/backend/windmill-common/src/utils.rs index 7c2faea868..08cbb7345b 100644 --- a/backend/windmill-common/src/utils.rs +++ b/backend/windmill-common/src/utils.rs @@ -81,7 +81,7 @@ lazy_static::lazy_static! { } Mode::Worker } else if &x == "agent" { - println!("Binary is in 'agent' mode"); + println!("Binary is in 'agent' mode with BASE_INTERNAL_URL={}", std::env::var("BASE_INTERNAL_URL").unwrap_or_default()); if std::env::var("BASE_INTERNAL_URL").is_err() { panic!("BASE_INTERNAL_URL is required in agent mode") }