feat: add email workspace error handler if smtp is configured (#6267)

* detecting trigger kind on job error

* v0 done

* done

* updat .sqlx and add mgrations

* fix: set back vs code settings and unused

* fix unused import

* add feature flag

* update ref

* nits

* nits

* done

* update repo ref

* remove

* add isCloudHosted

* update sqlx

* big

* fix

* use extra args instead of new col

* nits

* update .sqllx

* update ref

* update email

* fix

* fix

* fix

* nits

* update script and use env base_internal_url

* update sqlx and fix query

* remove

* fix unused import

* update ref
This commit is contained in:
dieriba
2025-08-07 16:46:53 +02:00
committed by GitHub
parent 84f76eebf7
commit 9fbb1992e5
62 changed files with 1061 additions and 366 deletions
+20 -10
View File
@@ -564,8 +564,10 @@ pub(crate) async fn tarball_workspace(
error_handler_path,
error_handler_args as "error_handler_args: _",
retry as "retry: _"
FROM http_trigger
WHERE workspace_id = $1
FROM
http_trigger
WHERE
workspace_id = $1
"#,
&w_id
)
@@ -649,7 +651,7 @@ pub(crate) async fn tarball_workspace(
enabled,
error_handler_path,
error_handler_args as "error_handler_args: _",
retry as "retry: _"
retry as "retry: _"
FROM kafka_trigger
WHERE workspace_id = $1"#,
&w_id
@@ -760,7 +762,8 @@ pub(crate) async fn tarball_workspace(
{
let nats_triggers = sqlx::query_as!(
crate::nats_triggers_oss::NatsTrigger,
r#"SELECT
r#"
SELECT
workspace_id,
path,
nats_resource_path,
@@ -781,8 +784,11 @@ pub(crate) async fn tarball_workspace(
error_handler_path,
error_handler_args as "error_handler_args: _",
retry as "retry: _"
FROM nats_trigger
WHERE workspace_id = $1"#,
FROM
nats_trigger
WHERE
workspace_id = $1
"#,
&w_id
)
.fetch_all(&mut *tx)
@@ -801,7 +807,8 @@ pub(crate) async fn tarball_workspace(
{
let postgres_triggers = sqlx::query_as!(
crate::postgres_triggers::PostgresTrigger,
r#"SELECT
r#"
SELECT
workspace_id,
path,
script_path,
@@ -819,9 +826,12 @@ pub(crate) async fn tarball_workspace(
postgres_resource_path,
error_handler_path,
error_handler_args as "error_handler_args: _",
retry as "retry: _"
FROM postgres_trigger
WHERE workspace_id = $1"#,
retry as "retry: _"
FROM
postgres_trigger
WHERE
workspace_id = $1
"#,
&w_id
)
.fetch_all(&mut *tx)