refactor: Reorganisation of Taskfiles for Enhanced Responsibility Segregation
[refactor] Reorganisation of Taskfiles for Enhanced Responsibility Segregation
What?
Restructure the Taskfiles architecture by segregating generic DevSecOps tasks from project-specific tasks into dedicated files under .config/devsecops/
. This reorganisation will facilitate improved code reuse and extensibility.
Why?
The current structure combines responsibilities, making it challenging to reuse generic tasks and extend projects. This refactoring will significantly enhance maintainability and adhere to the Open/Closed principle.
How to reproduce?
Feature: Taskfiles Reorganisation
As a DevSecOps engineer
I want to separate generic tasks from specific tasks
In order to facilitate code reuse and extension
Scenario: Segregation of Generic Tasks
Given the current main Taskfile
When I create the new structure under .config/devsecops/
And I migrate generic tasks to their dedicated files
Then each task type has its own yml file
And the main Taskfile correctly imports these files
Scenario: Project Task Extension
Given the new Taskfiles structure
When a project adds its own tasks in src/Taskfile.yml
Then these tasks are properly integrated
And generic tasks remain unchanged
Definition of Done
-
Directory structure created under .config/devsecops/
-
Generic tasks migrated to their respective files (code.yml, build.yml, test.yml) -
Main Taskfile modified to include new files -
Example src/Taskfile.yml
created -
Documentation updated with: -
New architecture explanation -
Task extension guide -
Usage examples
-
-
Tests added/updated -
CI/CD pipeline verified without regression
Breaking change?
Additional Information:
- Impact: All projects utilising Taskfiles
- Prerequisites: Knowledge of Task and YAML