From 92cf325c35fe878adade46b89fbe95626db4f0bb Mon Sep 17 00:00:00 2001 From: HugoCasa Date: Sat, 25 May 2024 10:38:03 +0200 Subject: [PATCH] fix: use hub script language as tag instead of 'hub' (#3816) * fix: use hub script language as tag instead of 'hub' * fix: remove hub tag --- backend/windmill-common/src/worker.rs | 2 +- backend/windmill-queue/src/jobs.rs | 16 +++++++--------- .../src/lib/components/WorkspaceGroup.svelte | 1 - 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/backend/windmill-common/src/worker.rs b/backend/windmill-common/src/worker.rs index 1b3a2c46ab..e89661e5fd 100644 --- a/backend/windmill-common/src/worker.rs +++ b/backend/windmill-common/src/worker.rs @@ -31,9 +31,9 @@ lazy_static::lazy_static! { "snowflake".to_string(), "mssql".to_string(), "graphql".to_string(), + "php".to_string(), "dependency".to_string(), "flow".to_string(), - "hub".to_string(), "other".to_string() ]; diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index 47f794ee98..8be2763840 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -59,9 +59,9 @@ use windmill_common::{ }, oauth2::WORKSPACE_SLACK_BOT_TOKEN_PATH, schedule::Schedule, - scripts::{ScriptHash, ScriptLang}, + scripts::{get_full_hub_script_by_path, ScriptHash, ScriptLang}, users::{SUPERADMIN_NOTIFICATION_EMAIL, SUPERADMIN_SECRET_EMAIL}, - utils::{not_found_if_none, report_critical_error}, + utils::{not_found_if_none, report_critical_error, StripPath}, worker::{to_raw_value, DEFAULT_TAGS_PER_WORKSPACE, NO_LOGS, WORKER_CONFIG}, BASE_URL, DB, METRICS_ENABLED, }; @@ -2991,6 +2991,10 @@ pub async fn push<'c, R: rsmq_async::RsmqConnection + Send + 'c>( permissioned_as = SUPERADMIN_NOTIFICATION_EMAIL.to_string(); email = SUPERADMIN_NOTIFICATION_EMAIL; } + + let hub_script = + get_full_hub_script_by_path(StripPath(path.clone()), &HTTP_CLIENT, _db).await?; + ( None, Some(path), @@ -2999,7 +3003,7 @@ pub async fn push<'c, R: rsmq_async::RsmqConnection + Send + 'c>( JobKind::Script_Hub, None, None, - None, + Some(hub_script.language), None, None, None, @@ -3430,12 +3434,6 @@ pub async fn push<'c, R: rsmq_async::RsmqConnection + Send + 'c>( }, script_path.clone().expect("dedicated script has a path") ) - } else if job_kind == JobKind::Script_Hub { - if per_workspace { - format!("hub-{}", workspace_id) - } else { - "hub".to_string() - } } else { if tag == Some("".to_string()) { tag = None; diff --git a/frontend/src/lib/components/WorkspaceGroup.svelte b/frontend/src/lib/components/WorkspaceGroup.svelte index 99c4f90c21..c8d030a705 100644 --- a/frontend/src/lib/components/WorkspaceGroup.svelte +++ b/frontend/src/lib/components/WorkspaceGroup.svelte @@ -91,7 +91,6 @@ 'powershell', 'dependency', 'flow', - 'hub', 'other', 'bun', 'php'