Skip to content

Multiple tasks of same type only handled once per snowblock configuration file #76

@arcticicestudio

Description

@arcticicestudio

Epic: #33

When a task is defined multiple times within the same snowblock configuration file, only the last object is processed while any object before are ignored.
The root cause is the pkg/snowblock.TaskRunnerMapping custom type that only accepts one pkg/api.TaskConfiguration object.
Therefore any parsed task object of the same type is overriden by tasks that are parsed after that task resulting in missing tasks.

Running this example configuration will not process the first clean task but only the second one:

[
  {
    "clean": ["~/desktop/failure"]
  },
  {
    "link": {
      "~/desktop/success/config.json": {
        "create": true,
        "path": "config.json"
      }
    }
  },
  {
    "clean": ["~/desktop/success"]
  },
]

To fix this problem the pkg/snowblock.TaskRunnerMapping type should accept multiple pkg/api.TaskConfiguration objects (TaskRunnerMapping map[api.TaskRunner][]api.TaskConfiguration) instead of only one so the previous object won't be overridden.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions