Closed arcticicestudio closed 5 years ago
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.
pkg/snowblock.TaskRunnerMapping
pkg/api.TaskConfiguration
Running this example configuration will not process the first clean task but only the second one:
clean
[ { "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.
TaskRunnerMapping map[api.TaskRunner][]api.TaskConfiguration
Fixed in 006ae9984032561839312db9c4024e9b6c25b1ad
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 onepkg/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:To fix this problem the
pkg/snowblock.TaskRunnerMapping
type should accept multiplepkg/api.TaskConfiguration
objects (TaskRunnerMapping map[api.TaskRunner][]api.TaskConfiguration
) instead of only one so the previous object won't be overridden.