defenseunicorns / maru-runner

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

Included task that includes a task that includes a common task fails due to a "cyclic loop" #122

Open Racer159 opened 2 weeks ago

Racer159 commented 2 weeks ago

Environment

Device and OS: popOS 22.04 App version: 0.2.1 Kubernetes distro being used: N/A Other: N/A

Steps to reproduce

  1. Create the following with a common import:

tasks.yaml

includes:
  - lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/main/tasks/lint.yaml
  - import: import.yaml

tasks:
  - name: default
    actions:
     - task: lint:yaml
     - task: import:lint

import.yaml

includes:
  - lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/main/tasks/lint.yaml

tasks:
  - name: lint
    actions:
     - task: lint:yaml
  1. Run maru run

Expected result

Linting successfully runs twice

Actual Result

Maru complains about an "include loop"

Visual Proof (screenshots, videos, text, etc)

image

Severity/Priority

Medium - this forces unnecessary copying of tasks if a common task is needed in many places

Additional Context

This was found through the implementation of the GitLab runner tests where a deploy task happens in a parent and then is reused in a child to redeploy the app.

Racer159 commented 2 weeks ago

Diagram of what is going on:

task.yaml
|  |
|  |--> include.yaml
|            |
|            | ---> lint.yaml
|                     ^
|---------------------|