{"action":"created","issue":{"url":"https://api.github.com/repos/capistrano/capistrano/issues/1766","repository_url":"https://api.github.com/repos/capistrano/capistrano","labels_url":"https://api.github.com/repos/capistrano/capistrano/issues/1766/labels{/name}","comments_url":"https://api.github.com/repos/capistrano/capistrano/issues/1766/comments","events_url":"https://api.github.com/repos/capistrano/capistrano/issues/1766/events","html_url":"https://github.com/capistrano/capistrano/issues/1766","id":173765211,"number":1766,"title":"Host filter doesn't exactly match","user":{"login":"cseeger-epages","id":13348918,"avatar_url":"https://avatars.githubusercontent.com/u/13348918?v=3","gravatar_id":"","url":"https://api.github.com/users/cseeger-epages","html_url":"https://github.com/cseeger-epages","followers_url":"https://api.github.com/users/cseeger-epages/followers","following_url":"https://api.github.com/users/cseeger-epages/following{/other_user}","gists_url":"https://api.github.com/users/cseeger-epages/gists{/gist_id}","starred_url":"https://api.github.com/users/cseeger-epages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cseeger-epages/subscriptions","organizations_url":"https://api.github.com/users/cseeger-epages/orgs","repos_url":"https://api.github.com/users/cseeger-epages/repos","events_url":"https://api.github.com/users/cseeger-epages/events{/privacy}","received_events_url":"https://api.github.com/users/cseeger-epages/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/capistrano/capistrano/labels/bug?","name":"bug?","color":"fbca04"},{"url":"https://api.github.com/repos/capistrano/capistrano/labels/you%20can%20help!","name":"you can help!","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-29T12:41:12Z","updated_at":"2016-08-31T00:28:49Z","closed_at":null,"body":"Greedy host filter\r\n---\r\n\r\n#### Steps to reproduce\r\neg. cap stage --hosts=system01 <some task>\r\nusing a stage with defined hosts:\r\nsystem011\r\nsystem012\r\nsystem020\r\n\r\n#### Expected behaviour\r\n\r\nempty host list or ERROR Host does not exists or sth. like this\r\n\r\n#### Actual behaviour\r\n\r\nmatching any host starting with the hosts parameter\r\n\r\nin this case\r\nsystem011 and system012\r\n\r\n#### Fix\r\n\r\nfrom: https://github.com/capistrano/capistrano/blob/master/lib/capistrano/configuration/host_filter.rb#L17-L27\r\n```ruby\r\ndef regex_matcher(values)\r\n        values.map! do |v|\r\n          case v\r\n          when Regexp then v\r\n          else\r\n            vs = v.to_s\r\n            vs =~ /^[-A-Za-z0-9.]+$/ ? vs : Regexp.new(vs)\r\n          end\r\n        end\r\n        Regexp.union values\r\n      end\r\n```\r\n\r\nLine 23 needs to be changed from\r\n```ruby\r\nvs =~ /^[-A-Za-z0-9.]+$/ ? vs : Regexp.new(vs)\r\n```\r\nto\r\n```ruby\r\nvs =~ /^[-A-Za-z0-9.]+$/ ? %r{^#{vs}$} : Regexp.new(vs)\r\n```\r\n\r\n#### Addition\r\n\r\nWildcard matching should be used while directly using a regex in capistrano \r\n\r\neg. cap stage --hosts='system01\\d' <some task>\r\n\r\nusing only a string it should match exactly\r\n"},"comment":{"url":"https://api.github.com/repos/capistrano/capistrano/issues/comments/243623534","html_url":"https://github.com/capistrano/capistrano/issues/1766#issuecomment-243623534","issue_url":"https://api.github.com/repos/capistrano/capistrano/issues/1766","id":243623534,"user":{"login":"mattbrictson","id":189693,"avatar_url":"https://avatars.githubusercontent.com/u/189693?v=3","gravatar_id":"","url":"https://api.github.com/users/mattbrictson","html_url":"https://github.com/mattbrictson","followers_url":"https://api.github.com/users/mattbrictson/followers","following_url":"https://api.github.com/users/mattbrictson/following{/other_user}","gists_url":"https://api.github.com/users/mattbrictson/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbrictson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbrictson/subscriptions","organizations_url":"https://api.github.com/users/mattbrictson/orgs","repos_url":"https://api.github.com/users/mattbrictson/repos","events_url":"https://api.github.com/users/mattbrictson/events{/privacy}","received_events_url":"https://api.github.com/users/mattbrictson/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T00:28:49Z","updated_at":"2016-08-31T00:28:49Z","body":"@will-in-wi Thanks. Can you take the lead on seeing this issue is ultimately resolved? I'll assign it to you if that's OK."}}
{"actor":{"display_login":"mattbrictson"}}