Skip to content

Commit

Permalink
fix(core): Fix Pause property annotation, exclude Input subtypes from…
Browse files Browse the repository at this point in the history
… definitions (#6265)

* fix(core): Fix Pause property annotation and exclude Input subtypes from definitions

* only enable filter if base class is null
  • Loading branch information
bppdanto-t authored Dec 4, 2024
1 parent 9cdaefc commit b9ccc4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ protected AbstractClassDocumentation(JsonSchemaGenerator jsonSchemaGenerator, Cl
// Remove the Task entry as it only contains a reference that is filtered in the doc template,
// which prevent the Definitions section to be empty if no other def exist.
.filter(entry -> !entry.getKey().equals("io.kestra.core.models.tasks.Task"))
// Remove definitions of all Input subtypes if base class is null
.filter(entry -> (baseCls == null) || !entry.getKey().startsWith("io.kestra.core.models.flows.input."))
.map(entry -> {
Map<String, Object> value = (Map<String, Object>) entry.getValue();
value.put("properties", flatten(properties(value), required(value), isTypeToKeep(entry.getKey())));
Expand Down
6 changes: 4 additions & 2 deletions core/src/main/java/io/kestra/plugin/core/flow/Pause.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,15 @@
public class Pause extends Task implements FlowableTask<Pause.Output> {
@Schema(
title = "Duration of the pause — useful if you want to pause the execution for a fixed amount of time.",
description = "The delay is a string in the [ISO 8601 Duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) format, e.g. `PT1H` for 1 hour, `PT30M` for 30 minutes, `PT10S` for 10 seconds, `P1D` for 1 day, etc. If no delay and no timeout are configured, the execution will never end until it's manually resumed from the UI or API."
description = "The delay is a string in the [ISO 8601 Duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) format, e.g. `PT1H` for 1 hour, `PT30M` for 30 minutes, `PT10S` for 10 seconds, `P1D` for 1 day, etc. If no delay and no timeout are configured, the execution will never end until it's manually resumed from the UI or API.",
implementation = Duration.class
)
private Property<Duration> delay;

@Schema(
title = "Timeout of the pause — useful to avoid never-ending workflows in a human-in-the-loop scenario. For example, if you want to pause the execution until a human validates some data generated in a previous task, you can set a timeout of e.g. 24 hours. If no manual approval happens within 24 hours, the execution will automatically resume without a prior data validation.",
description = "If no delay and no timeout are configured, the execution will never end until it's manually resumed from the UI or API."
description = "If no delay and no timeout are configured, the execution will never end until it's manually resumed from the UI or API.",
implementation = Duration.class
)
private Property<Duration> timeout;

Expand Down

0 comments on commit b9ccc4b

Please sign in to comment.