-
Notifications
You must be signed in to change notification settings - Fork 219
Description
Currently rex only supports task first task execution order. I want to add host first task execution order. Some goals for this issue:
- Explain what this change will look like to the user.
- Create a detailed plan to get there so I can do small incremental prs instead of one gigantic pr.
User interface
Command line options
Users will use the -eo option to indicate which execution order they prefer. The default value will be task-first for backwards compatibility. Next major version bump should probably flip that because host-first execution is faster and I believe its what users want though I have no data to back that up:
rex -eo host-first -G production deploy:product1
rex -eo task-first -G production deploy:product1
New rex feature flags
Users will also be able to specify a default execution order using the host_first_execution_order or task_first_execution_order` feature flags.
use Rex -feature => [qw/ host_first_execution_order /];
Task execution summary
Users will also see a summary of success/failure at the end of a rex run. The summary of failures will be sorted by host first when using host first execution. And it will be sorted by task first when using task first execution.
How to get there
Refactor some stuff first
- Refactor TaskList::Base and TaskList::Parallel_ForkManager (Refactor Rex::TaskList. No functional change. #849)
- Moved
$forked_subout ofTaskList->run()and into its own function. - This function is now shared between Rex::TaskList::Base and TaskList::Parallel_ForkManager.
- Removed functions from TaskList::Parallel_Forkmanager which are already in TaskList::Base.
- Moved
@SUMMARYlogic and shared variables fromFork::TaskandFork::ManagerintoTaskList::Base->build_child_coderef().
- Moved
- Refactor
TaskList::Base->run()- Rename
run()torun_task(). I think this will eventually be calledrun_task_first(). - Deprecate
run()? - Move all logic in
TaskList->run()andRunList->new->run_tasks()intoTaskList::Base->run_tasks()
- Rename
Then add new features
-
TaskList::Base->run_tasks()will callrun_host_first()orrun_task_first() - Warn about errors that happen in a child process?
- Add
host_first_execution_orderandtask_first_execution_orderfeature flags - Add
rex -eocommand line option - Change the summary output to reflect the users execution order preferences.