Currently there is no way to tell exactly what tasks/hooks will get executed when a particular task is invoked, especially when another package is providing some of those tasks for you. The bootleg mix tasks would support a --dry-run flag, which would cause bootleg to load and parse its config files like normal, and then "run" the tasks with remote turned into a no-op (or maybe patch into SSHKit's dry run functionality). During the run, it would print out each task/hook as they are entered/exited.
The flexibility of the DSL is a bit of a disadvantage here, as things like invoke can be conditionalised on the results of a remote call. Doing AST traversal, it should be possible to detect those cases and maybe the output would reflect both branches? Or warn that the results are unknown (we don't want to follow too many conditional branches if the user has a bunch of conditional invokes).
This feature is probably going to need to rely on AST parsing instead of actual code execution to avoid side-effects like notifying APMs or touching files via system calls.
Example output:
$ mix bootleg.build --dry-run
Dry run...
task :build started
task :compile started
remote :build, MIX_ENV=prod mix deps.compile
remote :build, MIX_ENV=prod mix compile
task :compile ended
task :generate_release started
remote :build, MIX_ENV=prod mix release
task :generate_release ended
task :build ended
Currently there is no way to tell exactly what tasks/hooks will get executed when a particular task is invoked, especially when another package is providing some of those tasks for you. The bootleg mix tasks would support a
--dry-runflag, which would cause bootleg to load and parse its config files like normal, and then "run" the tasks withremoteturned into a no-op (or maybe patch into SSHKit's dry run functionality). During the run, it would print out each task/hook as they are entered/exited.The flexibility of the DSL is a bit of a disadvantage here, as things like
invokecan be conditionalised on the results of aremotecall. Doing AST traversal, it should be possible to detect those cases and maybe the output would reflect both branches? Or warn that the results are unknown (we don't want to follow too many conditional branches if the user has a bunch of conditionalinvokes).This feature is probably going to need to rely on AST parsing instead of actual code execution to avoid side-effects like notifying APMs or touching files via system calls.
Example output:
$ mix bootleg.build --dry-run Dry run... task :build started task :compile started remote :build, MIX_ENV=prod mix deps.compile remote :build, MIX_ENV=prod mix compile task :compile ended task :generate_release started remote :build, MIX_ENV=prod mix release task :generate_release ended task :build ended