kestra-io / kestra-io/plugin-scripts

Introduce ScriptTrigger & CommandsTrigger for the Perl plugin

Open
#429 0 comments 0 reactions 0 assignees View on GitHub
area/plugin good first issue
Dominant language
Java
Stars
19
Forks
33
Avg merge
2d 12h
Merged PRs (30d)
9

Description

## Context

Part of #313. `plugin-scripts` wants every submodule to expose a `ScriptTrigger` and a `CommandsTrigger`, so a flow can be triggered whenever the underlying script/commands execution completes, with an **exit condition** deciding whether the trigger fires based on the result (e.g. only on failure).

`plugin-script-perl` is missing both. Existing implementations in `plugin-script-go`, `plugin-script-node`, `plugin-script-python`, `plugin-script-ruby`, and `plugin-script-shell` (same package as the task classes, no nested subpackage) can be used as a reference.

## What to implement

### 1. `ScriptTrigger`

- Triggers when `io.kestra.plugin.scripts.perl.Script` execution completes.
- Emits an event containing: command executed, arguments, env (if available), exit code, stdout/stderr (if capture enabled), and contextual metadata (execution id, namespace, flow id).

### 2. `CommandsTrigger`

- Triggers when `io.kestra.plugin.scripts.perl.Commands` execution completes.
- Emits an event containing: commands executed (or the matched one), exit code(s), stdout/stderr if available, and contextual metadata (execution id, namespace, flow id).

## Trigger configuration requirements

Each trigger should accept at least:

- `commandPattern` (string / regex / glob)
- `argumentsPattern` (optional)
- `exitCondition` (string expression — can match on exit code, output, or a literal condition)

## Example YAML

```yaml
triggers:
- id: on_perl_fail
type: io.kestra.plugin.scripts.perl.ScriptTrigger
commandPattern: ".*"
exitCondition: "exitCode != 0"

triggers:
- id: on_perl_commands
type: io.kestra.plugin.scripts.perl.CommandsTrigger
commandPattern: ".*"
exitCondition: "exitCode == 0"
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Compare the ScriptTrigger and CommandsTrigger implementations in plugin-script-go, plugin-script-node, plugin-script-python, plugin-script-ruby, and plugin-script-shell, keeping the Perl task classes in the same package. Add matching triggers for io.kestra.plugin.scripts.perl.Script and Commands with the listed patterns, exit condition, event fields, and metadata, then verify both example configurations can react to successful and failed execution results.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, perl
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.