Thanks Lee,

The problem is even more profound; I know what capistrano does in this 
situation :charlie; but what "I" think it should do is additively filter the 
roles;

So that in your example it would run on [] since you effectively said:

(:alpha || :beta) && :charlie

Unless you had something like this:

server 'localhost', :alpha, :charlie

I'm sure there's also a perverse school of thought that it should run on all of 
them. 

In the absence of better behavior if I have a task that calls other tasks I do 
not specify any roles on the first one in the chain. That way the reader of the 
code must look at the chained task to figure out how it's scoped. 

The other thing you can do is instead of defining that functionality as a task 
is define it as a method that is then called by the higher order task; then it 
will run in the scope of whatever task called it. 

And the other thing you can do is not call b in a but use an after hook

after :a, :b

Then there's no ambiguity as to how each task is scoped. This I believe should 
be best practice; and chaining tasks within the task should be discouraged.

Changing the existing behavior is a landmine; I'm sure there's lots of tasks 
written in the wild that are totally oblivious to this nuance, and any change 
to the behavior is likely to break scripts that used to work.

On Oct 24, 2011, at 1:54 PM, Lee Hambley <lee.hamb...@gmail.com> wrote:

> Donovan, the problem is as such I believe:
> 
> task :a, :roles => [:alpha, :beta] do
>   b
> end
> 
> task :b, :roles => [:charlie] do
>   # When A calls me, should I run against
>   # [:alpha, :beta] or [:charlie]
> end
> 
> Roger, did I understand you correctly?
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to 
> capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to