kestra-io / kestra-io/plugin-scripts
Introduce ScriptTrigger & CommandsTrigger for the Perl plugin
- Lingua principale
- Java
- Stelle
- 19
- Fork
- 33
- Merge medio
- 2g 12h
- PR unite (30g)
- 9
Descrizione
## 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"
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Confronta le implementazioni di ScriptTrigger e CommandsTrigger in plugin-script-go, plugin-script-node, plugin-script-python, plugin-script-ruby e plugin-script-shell, mantenendo le classi task Perl nello stesso package. Aggiungi trigger corrispondenti per io.kestra.plugin.scripts.perl.Script e Commands con i pattern elencati, la condizione di uscita, i campi dell’evento e i metadati, quindi verifica che entrambe le configurazioni di esempio possano reagire ai risultati di esecuzione riusciti e non riusciti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, perl
- Ambito
- backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 68/100