{"action":"closed","issue":{"url":"https://api.github.com/repos/capistrano/capistrano/issues/1686","repository_url":"https://api.github.com/repos/capistrano/capistrano","labels_url":"https://api.github.com/repos/capistrano/capistrano/issues/1686/labels{/name}","comments_url":"https://api.github.com/repos/capistrano/capistrano/issues/1686/comments","events_url":"https://api.github.com/repos/capistrano/capistrano/issues/1686/events","html_url":"https://github.com/capistrano/capistrano/issues/1686","id":155823847,"number":1686,"title":"Re-consider how calling already invoked tasks should behave","user":{"login":"kenn","id":10350,"avatar_url":"https://avatars3.githubusercontent.com/u/10350?v=4","gravatar_id":"","url":"https://api.github.com/users/kenn","html_url":"https://github.com/kenn","followers_url":"https://api.github.com/users/kenn/followers","following_url":"https://api.github.com/users/kenn/following{/other_user}","gists_url":"https://api.github.com/users/kenn/gists{/gist_id}","starred_url":"https://api.github.com/users/kenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenn/subscriptions","organizations_url":"https://api.github.com/users/kenn/orgs","repos_url":"https://api.github.com/users/kenn/repos","events_url":"https://api.github.com/users/kenn/events{/privacy}","received_events_url":"https://api.github.com/users/kenn/received_events","type":"User","site_admin":false},"labels":[{"id":313740861,"url":"https://api.github.com/repos/capistrano/capistrano/labels/you%20can%20help!","name":"you can help!","color":"eb6420","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":31,"created_at":"2016-05-19T20:10:07Z","updated_at":"2017-07-24T17:58:46Z","closed_at":"2017-07-24T17:58:46Z","body":"May be a proposal for v4.\n\nRight now, the same task can get called only once, unless `Rake::Task[].reenable` is called explicitly.\n\n``` ruby\nnamespace :deploy do\n  task :restart_unicorn_twice? do\n    invoke 'deploy:restart_unicorn'\n    invoke 'deploy:restart_unicorn'\n  end\n\n  task :restart_unicorn_twice! do\n    invoke 'deploy:restart_unicorn'\n    Rake::Task['deploy:restart_unicorn'].reenable\n    invoke 'deploy:restart_unicorn'\n  end\nend\n```\n\n``` ruby\n$ cap staging deploy:restart_unicorn_twice?\n00:00 deploy:restart_unicorn\n      01 /etc/init.d/unicorn restart\n      01 Restarting\n    ✔ 01 root@12.34.56.78 6.070s\n\n$ cap staging deploy:restart_unicorn_twice!\n00:00 deploy:restart_unicorn\n      01 /etc/init.d/unicorn restart\n      01 Restarting\n    ✔ 01 root@12.34.56.78 6.074s\n      01 Restarting\n    ✔ 01 root@12.34.56.78 5.936s\n```\n\nHowever, I believe `reenable` should be set for each task by default, because:\n- I know that's how rake is designed to work, but it's an implementation detail that users of capistrano shouldn't care. Let's keep in mind that even non-ruby devs are using capistrano for deployment.\n- \"Run only once\" semantics is useful for build tasks with dependencies, which is what rake is originally designed for, but it's almost always a surprising, unwanted behavior for deployment tools. We don't think in terms of dependency. We think in terms of execution order.\n- If we DO believe that \"run only once\" is the right way, we should at least offer a syntax sugar for `Rake::Task[].reenable` - that's very ugly and distracting.\n"}}
{"actor":{"display_login":"mattbrictson"}}