defenseunicorns / maru-runner

The Unicorn Task Runner
Apache License 2.0
8 stars 0 forks source link

Runner: advanced task execution logic #66

Open mjnagel opened 5 months ago

mjnagel commented 5 months ago

Is your feature request related to a problem? Please describe

I have several use cases where I would like to execute a task with more advanced logic wrapping how the task executes. Concrete examples:

Describe the solution you'd like

I'm not sure what the right approach on this is, for conditionals I think there could be a basic check implemented using conditional on a task to check existence of a variable, and possibly support more advanced logic checks (string equality, etc).

For the loop not really sure what would make sense. I could see a for type syntax being useful, with some ability to change parameter/directory on each. I don't really like the potential gross yaml here.

Describe alternatives you've considered

Most things can be done via cmd with traditional script logic, but this could mean calling uds run inside of a cmd block AND not being able to leverage wait.

joelmccoy commented 3 weeks ago

Also would like to see a feature that allows conditional execution of actions. I just ran into a scenario where it would be nice to have something like:

tasks:
  - name: validate
    actions:
      - description: Validate the dummy service
        if: $SERVICE_IS_DEPLOYED
        wait:
          cluster:
            kind: Service
            name: dummy-service
            namespace: dummy-namespace

The if keyword could be used to only run the action conditionally. Taking inspiration from github actions. I think this is mainly helpful at the action level, but there may be some other cases where this conditional check would be nice to have at the task level.