Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multiple tasks of same type only handled once per snowblock config
When a task is defined multiple times within the same snowblock configuration file, only the last object was processed while any object before has been ignored. The root cause was the `pkg/snowblock.TaskRunnerMapping` (1) custom type that only accepted one `pkg/api.TaskConfiguration` (2) object. Therefore any parsed task object of the same type was overriden (2) by tasks that are parsed after that task resulted in missing tasks. Before this commit, running this example configuration has not processed the first `clean` task but only the second one: ```json [ { "clean": ["~/desktop/failure"] }, { "link": { "~/desktop/success/config.json": { "create": true, "path": "config.json" } } }, { "clean": ["~/desktop/success"] }, ] ``` To fix the problem the `pkg/snowblock.TaskRunnerMapping` type now accepts multiple `pkg/api.TaskConfiguration` (2) objects (`TaskRunnerMapping map[api.TaskRunner][]api.TaskConfiguration`) instead of only one so the previous object won't be overridden. References: (1) https://github.com/arcticicestudio/snowsaw/blob/efdff96ec01f26bbf0a0d75bb9aab4cb86f023e8/pkg/snowblock/snowblock.go#L46 (2) https://github.com/arcticicestudio/snowsaw/blob/988073b1bde8d7db4b40f259e99d218c959bba8f/pkg/api/snowblock/task.go#L18 (3) https://github.com/arcticicestudio/snowsaw/blob/efdff96ec01f26bbf0a0d75bb9aab4cb86f023e8/pkg/snowblock/snowblock.go#L112 Epic: GH-33 Fixes GH-76
- Loading branch information