{"action":"created","comment":{"url":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/comments/27576358","id":27576358,"diff_hunk":"@@ -26,13 +26,21 @@ class Job < ActiveRecord::Base\n   scope :parallel, ->(){ where(job_type: \"parallel\") }\n   scope :deploy, ->(){ where(job_type: \"deploy\") }\n \n-  validate :refs, length: { maximum: 100 }\n-  \n+  validate :refs, length: { maximum: 255 }\n+\n   def deploy?\n     job_type == \"deploy\"\n   end\n \n   def run_for_ref?(ref)\n-    refs.blank? || refs.split(\",\").map{|ref| ref.strip}.include?(ref)\n+    if !refs.blank?\n+      refs.split(\",\").map(&:strip).each do |refsVal|","path":"app/models/job.rb","position":15,"original_position":15,"commit_id":"6b4148c8ca04ff3332be6452b8d6cfc6870bc780","original_commit_id":"6b4148c8ca04ff3332be6452b8d6cfc6870bc780","user":{"login":"vsizov","id":417636,"avatar_url":"https://avatars.githubusercontent.com/u/417636?v=3","gravatar_id":"","url":"https://api.github.com/users/vsizov","html_url":"https://github.com/vsizov","followers_url":"https://api.github.com/users/vsizov/followers","following_url":"https://api.github.com/users/vsizov/following{/other_user}","gists_url":"https://api.github.com/users/vsizov/gists{/gist_id}","starred_url":"https://api.github.com/users/vsizov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsizov/subscriptions","organizations_url":"https://api.github.com/users/vsizov/orgs","repos_url":"https://api.github.com/users/vsizov/repos","events_url":"https://api.github.com/users/vsizov/events{/privacy}","received_events_url":"https://api.github.com/users/vsizov/received_events","type":"User","site_admin":false},"body":"CamelCase is not ruby style :)","created_at":"2015-04-01T14:54:49Z","updated_at":"2015-04-01T14:54:49Z","html_url":"https://github.com/gitlabhq/gitlab-ci/pull/573#discussion_r27576358","pull_request_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/573","_links":{"self":{"href":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/comments/27576358"},"html":{"href":"https://github.com/gitlabhq/gitlab-ci/pull/573#discussion_r27576358"},"pull_request":{"href":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/573"}}},"pull_request":{"url":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/573","id":32407094,"html_url":"https://github.com/gitlabhq/gitlab-ci/pull/573","diff_url":"https://github.com/gitlabhq/gitlab-ci/pull/573.diff","patch_url":"https://github.com/gitlabhq/gitlab-ci/pull/573.patch","issue_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/issues/573","number":573,"state":"open","locked":false,"title":"Jobs checking \"run_for_ref\" by RegExp now","user":{"login":"pixel-shock","id":3963057,"avatar_url":"https://avatars.githubusercontent.com/u/3963057?v=3","gravatar_id":"","url":"https://api.github.com/users/pixel-shock","html_url":"https://github.com/pixel-shock","followers_url":"https://api.github.com/users/pixel-shock/followers","following_url":"https://api.github.com/users/pixel-shock/following{/other_user}","gists_url":"https://api.github.com/users/pixel-shock/gists{/gist_id}","starred_url":"https://api.github.com/users/pixel-shock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixel-shock/subscriptions","organizations_url":"https://api.github.com/users/pixel-shock/orgs","repos_url":"https://api.github.com/users/pixel-shock/repos","events_url":"https://api.github.com/users/pixel-shock/events{/privacy}","received_events_url":"https://api.github.com/users/pixel-shock/received_events","type":"User","site_admin":false},"body":"Regarding to [this request](https://gitlab.com/gitlab-org/gitlab-ci/issues/131) I changed the \"run_for_ref\" method to support regular expressions.\r\n\r\nUsers will now be able to run Jobs by a RegExp ref check like:\r\n\r\n- jobs with **unstable-v.0.1.0** in the ref name will run with **/unstable-v.*/** in a ref-job name\r\n\r\nI made the changed backward compatible, so it's not necessary to change all the old job ref-stuff to RegExp. Strings which not starting and ending with an \"/\" are handled like before with a simple equals.\r\n\r\nHope you like it :wink:","created_at":"2015-04-01T10:39:30Z","updated_at":"2015-04-01T14:54:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82947fa8bb8953af762b3009a5ce7fda3eb54a44","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/573/commits","review_comments_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/573/comments","review_comment_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/issues/573/comments","statuses_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/statuses/6b4148c8ca04ff3332be6452b8d6cfc6870bc780","head":{"label":"pixel-shock:deploy-jobs-with-regex","ref":"deploy-jobs-with-regex","sha":"6b4148c8ca04ff3332be6452b8d6cfc6870bc780","user":{"login":"pixel-shock","id":3963057,"avatar_url":"https://avatars.githubusercontent.com/u/3963057?v=3","gravatar_id":"","url":"https://api.github.com/users/pixel-shock","html_url":"https://github.com/pixel-shock","followers_url":"https://api.github.com/users/pixel-shock/followers","following_url":"https://api.github.com/users/pixel-shock/following{/other_user}","gists_url":"https://api.github.com/users/pixel-shock/gists{/gist_id}","starred_url":"https://api.github.com/users/pixel-shock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixel-shock/subscriptions","organizations_url":"https://api.github.com/users/pixel-shock/orgs","repos_url":"https://api.github.com/users/pixel-shock/repos","events_url":"https://api.github.com/users/pixel-shock/events{/privacy}","received_events_url":"https://api.github.com/users/pixel-shock/received_events","type":"User","site_admin":false},"repo":{"id":33238045,"name":"gitlab-ci","full_name":"pixel-shock/gitlab-ci","owner":{"login":"pixel-shock","id":3963057,"avatar_url":"https://avatars.githubusercontent.com/u/3963057?v=3","gravatar_id":"","url":"https://api.github.com/users/pixel-shock","html_url":"https://github.com/pixel-shock","followers_url":"https://api.github.com/users/pixel-shock/followers","following_url":"https://api.github.com/users/pixel-shock/following{/other_user}","gists_url":"https://api.github.com/users/pixel-shock/gists{/gist_id}","starred_url":"https://api.github.com/users/pixel-shock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixel-shock/subscriptions","organizations_url":"https://api.github.com/users/pixel-shock/orgs","repos_url":"https://api.github.com/users/pixel-shock/repos","events_url":"https://api.github.com/users/pixel-shock/events{/privacy}","received_events_url":"https://api.github.com/users/pixel-shock/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pixel-shock/gitlab-ci","description":"Continuous integration server for GitLab","fork":true,"url":"https://api.github.com/repos/pixel-shock/gitlab-ci","forks_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/forks","keys_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/teams","hooks_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/hooks","issue_events_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/issues/events{/number}","events_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/events","assignees_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/assignees{/user}","branches_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/branches{/branch}","tags_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/tags","blobs_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/git/refs{/sha}","trees_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/statuses/{sha}","languages_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/languages","stargazers_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/stargazers","contributors_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/contributors","subscribers_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/subscribers","subscription_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/subscription","commits_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/commits{/sha}","git_commits_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/git/commits{/sha}","comments_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/comments{/number}","issue_comment_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/issues/comments{/number}","contents_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/contents/{+path}","compare_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/merges","archive_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/downloads","issues_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/issues{/number}","pulls_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/pulls{/number}","milestones_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/milestones{/number}","notifications_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/labels{/name}","releases_url":"https://api.github.com/repos/pixel-shock/gitlab-ci/releases{/id}","created_at":"2015-04-01T09:16:28Z","updated_at":"2015-04-01T09:16:29Z","pushed_at":"2015-04-01T11:58:30Z","git_url":"git://github.com/pixel-shock/gitlab-ci.git","ssh_url":"git@github.com:pixel-shock/gitlab-ci.git","clone_url":"https://github.com/pixel-shock/gitlab-ci.git","svn_url":"https://github.com/pixel-shock/gitlab-ci","homepage":"https://about.gitlab.com/gitlab-ci/","size":7078,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gitlabhq:master","ref":"master","sha":"185bc3c3a4207333b084d4294c345c10b193dacc","user":{"login":"gitlabhq","id":1086321,"avatar_url":"https://avatars.githubusercontent.com/u/1086321?v=3","gravatar_id":"","url":"https://api.github.com/users/gitlabhq","html_url":"https://github.com/gitlabhq","followers_url":"https://api.github.com/users/gitlabhq/followers","following_url":"https://api.github.com/users/gitlabhq/following{/other_user}","gists_url":"https://api.github.com/users/gitlabhq/gists{/gist_id}","starred_url":"https://api.github.com/users/gitlabhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitlabhq/subscriptions","organizations_url":"https://api.github.com/users/gitlabhq/orgs","repos_url":"https://api.github.com/users/gitlabhq/repos","events_url":"https://api.github.com/users/gitlabhq/events{/privacy}","received_events_url":"https://api.github.com/users/gitlabhq/received_events","type":"Organization","site_admin":false},"repo":{"id":6154653,"name":"gitlab-ci","full_name":"gitlabhq/gitlab-ci","owner":{"login":"gitlabhq","id":1086321,"avatar_url":"https://avatars.githubusercontent.com/u/1086321?v=3","gravatar_id":"","url":"https://api.github.com/users/gitlabhq","html_url":"https://github.com/gitlabhq","followers_url":"https://api.github.com/users/gitlabhq/followers","following_url":"https://api.github.com/users/gitlabhq/following{/other_user}","gists_url":"https://api.github.com/users/gitlabhq/gists{/gist_id}","starred_url":"https://api.github.com/users/gitlabhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitlabhq/subscriptions","organizations_url":"https://api.github.com/users/gitlabhq/orgs","repos_url":"https://api.github.com/users/gitlabhq/repos","events_url":"https://api.github.com/users/gitlabhq/events{/privacy}","received_events_url":"https://api.github.com/users/gitlabhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gitlabhq/gitlab-ci","description":"Continuous integration server for GitLab","fork":false,"url":"https://api.github.com/repos/gitlabhq/gitlab-ci","forks_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/forks","keys_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/teams","hooks_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/hooks","issue_events_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/issues/events{/number}","events_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/events","assignees_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/assignees{/user}","branches_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/branches{/branch}","tags_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/tags","blobs_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/statuses/{sha}","languages_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/languages","stargazers_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/stargazers","contributors_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/contributors","subscribers_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/subscribers","subscription_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/subscription","commits_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/issues/comments{/number}","contents_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/contents/{+path}","compare_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/merges","archive_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/downloads","issues_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/issues{/number}","pulls_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls{/number}","milestones_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/milestones{/number}","notifications_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/labels{/name}","releases_url":"https://api.github.com/repos/gitlabhq/gitlab-ci/releases{/id}","created_at":"2012-10-10T09:00:53Z","updated_at":"2015-04-01T09:07:47Z","pushed_at":"2015-04-01T11:58:30Z","git_url":"git://github.com/gitlabhq/gitlab-ci.git","ssh_url":"git@github.com:gitlabhq/gitlab-ci.git","clone_url":"https://github.com/gitlabhq/gitlab-ci.git","svn_url":"https://github.com/gitlabhq/gitlab-ci","homepage":"https://about.gitlab.com/gitlab-ci/","size":7078,"stargazers_count":1304,"watchers_count":1304,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":323,"mirror_url":null,"open_issues_count":48,"forks":323,"open_issues":48,"watchers":1304,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/573"},"html":{"href":"https://github.com/gitlabhq/gitlab-ci/pull/573"},"issue":{"href":"https://api.github.com/repos/gitlabhq/gitlab-ci/issues/573"},"comments":{"href":"https://api.github.com/repos/gitlabhq/gitlab-ci/issues/573/comments"},"review_comments":{"href":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/573/comments"},"review_comment":{"href":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gitlabhq/gitlab-ci/pulls/573/commits"},"statuses":{"href":"https://api.github.com/repos/gitlabhq/gitlab-ci/statuses/6b4148c8ca04ff3332be6452b8d6cfc6870bc780"}}}}