{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/36849685","id":36849685,"diff_hunk":"@@ -24,7 +24,7 @@ def test_path2match_single_domain_path\n     key   = \"\"\n     value = \"\"\n     as_admin do\n-      key   = LookupKey.create!(:key => \"ntp\", :path => \"domain\", :puppetclass => Puppetclass.first)\n+      key   = LookupKey.create!(:key => \"ntp\", :path => \"domain\", :puppetclass => Puppetclass.first, :key_type => \"string\")","path":"test/unit/lookup_key_test.rb","position":5,"original_position":5,"commit_id":"4033ca568a9ffc7463695d0dd167292fde45168d","original_commit_id":"df1ee69f2a45e40749f0ea856705516a350e1f3c","user":{"login":"domcleal","id":482089,"avatar_url":"https://avatars.githubusercontent.com/u/482089?v=3","gravatar_id":"","url":"https://api.github.com/users/domcleal","html_url":"https://github.com/domcleal","followers_url":"https://api.github.com/users/domcleal/followers","following_url":"https://api.github.com/users/domcleal/following{/other_user}","gists_url":"https://api.github.com/users/domcleal/gists{/gist_id}","starred_url":"https://api.github.com/users/domcleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domcleal/subscriptions","organizations_url":"https://api.github.com/users/domcleal/orgs","repos_url":"https://api.github.com/users/domcleal/repos","events_url":"https://api.github.com/users/domcleal/events{/privacy}","received_events_url":"https://api.github.com/users/domcleal/received_events","type":"User","site_admin":false},"body":"For invalid values of key_type, sure, throw an error.  Blank/nil is a valid value though (as is string, etc), so it shouldn't throw an error.  Probably simply skip casting/validation `unless key_type.present?`.\r\n\r\nThe current code quietly ignores invalid key_types, but that was the earlier point - it's perfectly safe to raise an error there.","created_at":"2015-08-12T11:36:28Z","updated_at":"2015-08-12T11:36:28Z","html_url":"https://github.com/theforeman/foreman/pull/2399#discussion_r36849685","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/2399","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/36849685"},"html":{"href":"https://github.com/theforeman/foreman/pull/2399#discussion_r36849685"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2399"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/2399","id":35932157,"html_url":"https://github.com/theforeman/foreman/pull/2399","diff_url":"https://github.com/theforeman/foreman/pull/2399.diff","patch_url":"https://github.com/theforeman/foreman/pull/2399.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/2399","number":2399,"state":"open","locked":false,"title":"fixes #10232 - moving validations and casting out of lookup key and value","user":{"login":"unorthodoxgeek","id":706359,"avatar_url":"https://avatars.githubusercontent.com/u/706359?v=3","gravatar_id":"","url":"https://api.github.com/users/unorthodoxgeek","html_url":"https://github.com/unorthodoxgeek","followers_url":"https://api.github.com/users/unorthodoxgeek/followers","following_url":"https://api.github.com/users/unorthodoxgeek/following{/other_user}","gists_url":"https://api.github.com/users/unorthodoxgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/unorthodoxgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unorthodoxgeek/subscriptions","organizations_url":"https://api.github.com/users/unorthodoxgeek/orgs","repos_url":"https://api.github.com/users/unorthodoxgeek/repos","events_url":"https://api.github.com/users/unorthodoxgeek/events{/privacy}","received_events_url":"https://api.github.com/users/unorthodoxgeek/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-21T13:16:21Z","updated_at":"2015-08-12T11:36:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5725654a0816c11ffecf15e9fc7f250ee313501","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/2399/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/2399/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/2399/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/4033ca568a9ffc7463695d0dd167292fde45168d","head":{"label":"unorthodoxgeek:10232-move-validations-and-casting","ref":"10232-move-validations-and-casting","sha":"4033ca568a9ffc7463695d0dd167292fde45168d","user":{"login":"unorthodoxgeek","id":706359,"avatar_url":"https://avatars.githubusercontent.com/u/706359?v=3","gravatar_id":"","url":"https://api.github.com/users/unorthodoxgeek","html_url":"https://github.com/unorthodoxgeek","followers_url":"https://api.github.com/users/unorthodoxgeek/followers","following_url":"https://api.github.com/users/unorthodoxgeek/following{/other_user}","gists_url":"https://api.github.com/users/unorthodoxgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/unorthodoxgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unorthodoxgeek/subscriptions","organizations_url":"https://api.github.com/users/unorthodoxgeek/orgs","repos_url":"https://api.github.com/users/unorthodoxgeek/repos","events_url":"https://api.github.com/users/unorthodoxgeek/events{/privacy}","received_events_url":"https://api.github.com/users/unorthodoxgeek/received_events","type":"User","site_admin":false},"repo":{"id":27370503,"name":"foreman","full_name":"unorthodoxgeek/foreman","owner":{"login":"unorthodoxgeek","id":706359,"avatar_url":"https://avatars.githubusercontent.com/u/706359?v=3","gravatar_id":"","url":"https://api.github.com/users/unorthodoxgeek","html_url":"https://github.com/unorthodoxgeek","followers_url":"https://api.github.com/users/unorthodoxgeek/followers","following_url":"https://api.github.com/users/unorthodoxgeek/following{/other_user}","gists_url":"https://api.github.com/users/unorthodoxgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/unorthodoxgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unorthodoxgeek/subscriptions","organizations_url":"https://api.github.com/users/unorthodoxgeek/orgs","repos_url":"https://api.github.com/users/unorthodoxgeek/repos","events_url":"https://api.github.com/users/unorthodoxgeek/events{/privacy}","received_events_url":"https://api.github.com/users/unorthodoxgeek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/unorthodoxgeek/foreman","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/unorthodoxgeek/foreman","forks_url":"https://api.github.com/repos/unorthodoxgeek/foreman/forks","keys_url":"https://api.github.com/repos/unorthodoxgeek/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unorthodoxgeek/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unorthodoxgeek/foreman/teams","hooks_url":"https://api.github.com/repos/unorthodoxgeek/foreman/hooks","issue_events_url":"https://api.github.com/repos/unorthodoxgeek/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/unorthodoxgeek/foreman/events","assignees_url":"https://api.github.com/repos/unorthodoxgeek/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/unorthodoxgeek/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/unorthodoxgeek/foreman/tags","blobs_url":"https://api.github.com/repos/unorthodoxgeek/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unorthodoxgeek/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unorthodoxgeek/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/unorthodoxgeek/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unorthodoxgeek/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/unorthodoxgeek/foreman/languages","stargazers_url":"https://api.github.com/repos/unorthodoxgeek/foreman/stargazers","contributors_url":"https://api.github.com/repos/unorthodoxgeek/foreman/contributors","subscribers_url":"https://api.github.com/repos/unorthodoxgeek/foreman/subscribers","subscription_url":"https://api.github.com/repos/unorthodoxgeek/foreman/subscription","commits_url":"https://api.github.com/repos/unorthodoxgeek/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/unorthodoxgeek/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/unorthodoxgeek/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/unorthodoxgeek/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/unorthodoxgeek/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/unorthodoxgeek/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unorthodoxgeek/foreman/merges","archive_url":"https://api.github.com/repos/unorthodoxgeek/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unorthodoxgeek/foreman/downloads","issues_url":"https://api.github.com/repos/unorthodoxgeek/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/unorthodoxgeek/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/unorthodoxgeek/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/unorthodoxgeek/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unorthodoxgeek/foreman/labels{/name}","releases_url":"https://api.github.com/repos/unorthodoxgeek/foreman/releases{/id}","created_at":"2014-12-01T08:46:29Z","updated_at":"2015-02-22T13:59:01Z","pushed_at":"2015-08-12T09:04:30Z","git_url":"git://github.com/unorthodoxgeek/foreman.git","ssh_url":"git@github.com:unorthodoxgeek/foreman.git","clone_url":"https://github.com/unorthodoxgeek/foreman.git","svn_url":"https://github.com/unorthodoxgeek/foreman","homepage":"http://theforeman.org","size":32655,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"cf043905057d77d00618d9b0c8c3c21b51a9d425","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":258750,"name":"foreman","full_name":"theforeman/foreman","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/foreman","description":"an application that automates the lifecycle of servers ","fork":false,"url":"https://api.github.com/repos/theforeman/foreman","forks_url":"https://api.github.com/repos/theforeman/foreman/forks","keys_url":"https://api.github.com/repos/theforeman/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman/events","assignees_url":"https://api.github.com/repos/theforeman/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman/merges","archive_url":"https://api.github.com/repos/theforeman/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman/releases{/id}","created_at":"2009-07-23T15:07:00Z","updated_at":"2015-08-11T20:57:34Z","pushed_at":"2015-08-12T10:51:39Z","git_url":"git://github.com/theforeman/foreman.git","ssh_url":"git@github.com:theforeman/foreman.git","clone_url":"https://github.com/theforeman/foreman.git","svn_url":"https://github.com/theforeman/foreman","homepage":"http://theforeman.org","size":86546,"stargazers_count":823,"watchers_count":823,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":421,"mirror_url":null,"open_issues_count":82,"forks":421,"open_issues":82,"watchers":823,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2399"},"html":{"href":"https://github.com/theforeman/foreman/pull/2399"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2399"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2399/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2399/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2399/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/4033ca568a9ffc7463695d0dd167292fde45168d"}}}}