Skip to content

Commit

Permalink
feat: Schedule error handler improvements (#2555)
Browse files Browse the repository at this point in the history
* Fix schedule path for scheduled scripts

* feat: Add possibility to mute workspace error handler on schedules and define an error/recovery handler as default

* Permission error handlers to the error handler group for consistency, and small refactoring

* Fix recovery handler

* Add parent job to recovery handler for consistency

* Fix tests

* Locking feature to EE in FE
  • Loading branch information
gbouv committed Nov 3, 2023
1 parent 6f47b96 commit 668c9da
Show file tree
Hide file tree
Showing 22 changed files with 341 additions and 82 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Add down migration script here
ALTER TABLE schedule DROP COLUMN ws_error_handler_muted;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Add up migration script here
ALTER TABLE schedule ADD COLUMN ws_error_handler_muted BOOLEAN NOT NULL DEFAULT false;
4 changes: 4 additions & 0 deletions backend/tests/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2854,6 +2854,7 @@ async fn test_script_schedule_handlers(db: Pool<Postgres>) {
script_path: "f/system/failing_script".to_string(),
timezone: "UTC".to_string(),
schedule: format!("{} {} * * * *", then.second(), then.minute()).to_string(),
ws_error_handler_muted: None,
};

let _ = client.create_schedule("test-workspace", &schedule).await;
Expand Down Expand Up @@ -2913,6 +2914,7 @@ async fn test_script_schedule_handlers(db: Pool<Postgres>) {
on_recovery_extra_args: None,
timezone: "UTC".to_string(),
schedule: format!("{} {} * * * *", then.second(), then.minute()).to_string(),
ws_error_handler_muted: None,
},
)
.await
Expand Down Expand Up @@ -2988,6 +2990,7 @@ async fn test_flow_schedule_handlers(db: Pool<Postgres>) {
script_path: "f/system/failing_flow".to_string(),
timezone: "UTC".to_string(),
schedule: format!("{} {} * * * *", then.second(), then.minute()).to_string(),
ws_error_handler_muted: None,
};

let _ = client.create_schedule("test-workspace", &schedule).await;
Expand Down Expand Up @@ -3048,6 +3051,7 @@ async fn test_flow_schedule_handlers(db: Pool<Postgres>) {
on_recovery_extra_args: None,
timezone: "UTC".to_string(),
schedule: format!("{} {} * * * *", then.second(), then.minute()).to_string(),
ws_error_handler_muted: None,
},
)
.await
Expand Down
14 changes: 12 additions & 2 deletions backend/windmill-api/openapi-deref.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.3
info:
version: 1.192.0
version: 1.197.1
title: Windmill API
contact:
name: Windmill Team
Expand Down Expand Up @@ -3048,13 +3048,17 @@ paths:
type: array
items:
type: string
/embeddings/query_resource_types:
/w/{workspace}/embeddings/query_resource_types:
get:
summary: query resource types by similarity
operationId: queryResourceTypes
tags:
- resource
parameters:
- name: workspace
in: path
required: true
schema: *ref_0
- name: text
description: query text
in: query
Expand Down Expand Up @@ -7818,6 +7822,8 @@ paths:
on_recovery_extra_args:
type: object
additionalProperties: *ref_14
ws_error_handler_muted:
type: boolean
required: &ref_133
- path
- schedule
Expand Down Expand Up @@ -7878,6 +7884,8 @@ paths:
on_recovery_extra_args:
type: object
additionalProperties: *ref_14
ws_error_handler_muted:
type: boolean
required: &ref_135
- schedule
- timezone
Expand Down Expand Up @@ -8014,6 +8022,8 @@ paths:
on_recovery_extra_args:
type: object
additionalProperties: *ref_14
ws_error_handler_muted:
type: boolean
required: &ref_74
- path
- edited_by
Expand Down
6 changes: 6 additions & 0 deletions backend/windmill-api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7580,6 +7580,8 @@ components:
type: number
on_recovery_extra_args:
$ref: "#/components/schemas/ScriptArgs"
ws_error_handler_muted:
type: boolean
required:
- path
- edited_by
Expand Down Expand Up @@ -7645,6 +7647,8 @@ components:
type: number
on_recovery_extra_args:
$ref: "#/components/schemas/ScriptArgs"
ws_error_handler_muted:
type: boolean
required:
- path
- schedule
Expand Down Expand Up @@ -7677,6 +7681,8 @@ components:
type: number
on_recovery_extra_args:
$ref: "#/components/schemas/ScriptArgs"
ws_error_handler_muted:
type: boolean
required:
- schedule
- timezone
Expand Down

0 comments on commit 668c9da

Please sign in to comment.