{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/239660663","pull_request_review_id":182506885,"id":239660663,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTY2MDY2Mw==","diff_hunk":"@@ -130,6 +141,36 @@ def associate_features\n       errors.add(:base, _('Unable to communicate with the proxy: %s') % e)\n       errors.add(:base, _('Please check the proxy is configured and running on the host.'))\n     end\n-    throw :abort if features.empty?\n+    throw :abort if smart_proxy_features.empty?\n+  end\n+\n+  def import_features(name_map, features_json)\n+    new_feature_classes = features_json.keys.map {|feature| name_map[feature]}\n+    smart_proxy_features.where.not(feature_id: new_feature_classes).destroy_all\n+    features_json.each do |name, feature_json|\n+      import_feature_json(name_map[name], feature_json)\n+    end\n+  end\n+\n+  def import_feature_json(feature_class, feature_json)\n+    smart_proxy_feature = smart_proxy_features.to_a.find{|spf| spf.feature_id == feature_class.id}","path":"app/models/smart_proxy.rb","position":84,"original_position":84,"commit_id":"438da697a162f2a09cbc569292b619e96de94e90","original_commit_id":"438da697a162f2a09cbc569292b619e96de94e90","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Layout/SpaceBeforeBlockBraces: Space missing to the left of {.","created_at":"2018-12-07T00:13:20Z","updated_at":"2018-12-07T00:13:20Z","html_url":"https://github.com/theforeman/foreman/pull/6314#discussion_r239660663","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/6314","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/239660663"},"html":{"href":"https://github.com/theforeman/foreman/pull/6314#discussion_r239660663"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/6314"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/6314","id":236715389,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2NzE1Mzg5","html_url":"https://github.com/theforeman/foreman/pull/6314","diff_url":"https://github.com/theforeman/foreman/pull/6314.diff","patch_url":"https://github.com/theforeman/foreman/pull/6314.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/6314","number":6314,"state":"open","locked":false,"title":"Fixes #25642 - Introduce proxy registration protocol version 2","user":{"login":"jlsherrill","id":395077,"node_id":"MDQ6VXNlcjM5NTA3Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/395077?v=4","gravatar_id":"","url":"https://api.github.com/users/jlsherrill","html_url":"https://github.com/jlsherrill","followers_url":"https://api.github.com/users/jlsherrill/followers","following_url":"https://api.github.com/users/jlsherrill/following{/other_user}","gists_url":"https://api.github.com/users/jlsherrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jlsherrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlsherrill/subscriptions","organizations_url":"https://api.github.com/users/jlsherrill/orgs","repos_url":"https://api.github.com/users/jlsherrill/repos","events_url":"https://api.github.com/users/jlsherrill/events{/privacy}","received_events_url":"https://api.github.com/users/jlsherrill/received_events","type":"User","site_admin":false},"body":"Part of https://community.theforeman.org/t/exposing-capabilities-in-the-smart-proxy/9860\r\nThis adds the ability to use the new v2 smart proxy features api that includes \r\ncapabilities and exposed settings which are stored on the Foreman side.\r\n\r\n<!---\r\n\r\nThank you for contributing to The Foreman, please read the\r\n[following guide](https://www.theforeman.org/contribute.html), in short:\r\n\r\n* [Create an issue](https://projects.theforeman.org/projects/foreman/issues)\r\n* Reference the issue via `Fixes #1234` in the commit message\r\n* Prefer present-tense, imperative-style commit messages\r\n* Mark all strings for translation, see [Translating section in the guide]\r\n(https://projects.theforeman.org/projects/foreman/wiki/Translating)\r\n* Prepend `[WIP]` for work in progress to prevent bots from triggering actions\r\n* Be patient, we will do our best to take a look as soon as we can\r\n* Explain the purpose of the PR, attach screenshots if applicable\r\n* Be nice and respectful\r\n\r\nWe are running bots that will poke you if you miss an item from the list :-)\r\n\r\n--->\r\n","created_at":"2018-12-07T00:12:56Z","updated_at":"2018-12-07T00:13:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"856c117a90de1c0caa991edf735d40eb37aad30f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":79040689,"node_id":"MDU6TGFiZWw3OTA0MDY4OQ==","url":"https://api.github.com/repos/theforeman/foreman/labels/Needs%20testing","name":"Needs testing","color":"fbca04","default":false},{"id":79040085,"node_id":"MDU6TGFiZWw3OTA0MDA4NQ==","url":"https://api.github.com/repos/theforeman/foreman/labels/Not%20yet%20reviewed","name":"Not yet reviewed","color":"0e8a16","default":false},{"id":79040111,"node_id":"MDU6TGFiZWw3OTA0MDExMQ==","url":"https://api.github.com/repos/theforeman/foreman/labels/Waiting%20on%20contributor","name":"Waiting on contributor","color":"f7c6c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/6314/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/6314/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/6314/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/438da697a162f2a09cbc569292b619e96de94e90","head":{"label":"jlsherrill:v2","ref":"v2","sha":"438da697a162f2a09cbc569292b619e96de94e90","user":{"login":"jlsherrill","id":395077,"node_id":"MDQ6VXNlcjM5NTA3Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/395077?v=4","gravatar_id":"","url":"https://api.github.com/users/jlsherrill","html_url":"https://github.com/jlsherrill","followers_url":"https://api.github.com/users/jlsherrill/followers","following_url":"https://api.github.com/users/jlsherrill/following{/other_user}","gists_url":"https://api.github.com/users/jlsherrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jlsherrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlsherrill/subscriptions","organizations_url":"https://api.github.com/users/jlsherrill/orgs","repos_url":"https://api.github.com/users/jlsherrill/repos","events_url":"https://api.github.com/users/jlsherrill/events{/privacy}","received_events_url":"https://api.github.com/users/jlsherrill/received_events","type":"User","site_admin":false},"repo":{"id":9306701,"node_id":"MDEwOlJlcG9zaXRvcnk5MzA2NzAx","name":"foreman","full_name":"jlsherrill/foreman","private":false,"owner":{"login":"jlsherrill","id":395077,"node_id":"MDQ6VXNlcjM5NTA3Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/395077?v=4","gravatar_id":"","url":"https://api.github.com/users/jlsherrill","html_url":"https://github.com/jlsherrill","followers_url":"https://api.github.com/users/jlsherrill/followers","following_url":"https://api.github.com/users/jlsherrill/following{/other_user}","gists_url":"https://api.github.com/users/jlsherrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jlsherrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlsherrill/subscriptions","organizations_url":"https://api.github.com/users/jlsherrill/orgs","repos_url":"https://api.github.com/users/jlsherrill/repos","events_url":"https://api.github.com/users/jlsherrill/events{/privacy}","received_events_url":"https://api.github.com/users/jlsherrill/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jlsherrill/foreman","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/jlsherrill/foreman","forks_url":"https://api.github.com/repos/jlsherrill/foreman/forks","keys_url":"https://api.github.com/repos/jlsherrill/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlsherrill/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlsherrill/foreman/teams","hooks_url":"https://api.github.com/repos/jlsherrill/foreman/hooks","issue_events_url":"https://api.github.com/repos/jlsherrill/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/jlsherrill/foreman/events","assignees_url":"https://api.github.com/repos/jlsherrill/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/jlsherrill/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/jlsherrill/foreman/tags","blobs_url":"https://api.github.com/repos/jlsherrill/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlsherrill/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlsherrill/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlsherrill/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlsherrill/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/jlsherrill/foreman/languages","stargazers_url":"https://api.github.com/repos/jlsherrill/foreman/stargazers","contributors_url":"https://api.github.com/repos/jlsherrill/foreman/contributors","subscribers_url":"https://api.github.com/repos/jlsherrill/foreman/subscribers","subscription_url":"https://api.github.com/repos/jlsherrill/foreman/subscription","commits_url":"https://api.github.com/repos/jlsherrill/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlsherrill/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlsherrill/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlsherrill/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/jlsherrill/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/jlsherrill/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlsherrill/foreman/merges","archive_url":"https://api.github.com/repos/jlsherrill/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlsherrill/foreman/downloads","issues_url":"https://api.github.com/repos/jlsherrill/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/jlsherrill/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/jlsherrill/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/jlsherrill/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlsherrill/foreman/labels{/name}","releases_url":"https://api.github.com/repos/jlsherrill/foreman/releases{/id}","deployments_url":"https://api.github.com/repos/jlsherrill/foreman/deployments","created_at":"2013-04-08T20:59:00Z","updated_at":"2014-04-09T23:29:09Z","pushed_at":"2018-12-07T00:10:47Z","git_url":"git://github.com/jlsherrill/foreman.git","ssh_url":"git@github.com:jlsherrill/foreman.git","clone_url":"https://github.com/jlsherrill/foreman.git","svn_url":"https://github.com/jlsherrill/foreman","homepage":"http://theforeman.org","size":46459,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"3ed61ff70c099d71e2f440eb18a7dcd1811a0ce7","user":{"login":"theforeman","id":1439844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Mzk4NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1439844?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkyNTg3NTA=","name":"foreman","full_name":"theforeman/foreman","private":false,"owner":{"login":"theforeman","id":1439844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Mzk4NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1439844?v=4","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},"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}","deployments_url":"https://api.github.com/repos/theforeman/foreman/deployments","created_at":"2009-07-23T15:07:00Z","updated_at":"2018-12-06T16:20:49Z","pushed_at":"2018-12-07T00:12:57Z","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":85568,"stargazers_count":1537,"watchers_count":1537,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":771,"mirror_url":null,"archived":false,"open_issues_count":134,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":771,"open_issues":134,"watchers":1537,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/6314"},"html":{"href":"https://github.com/theforeman/foreman/pull/6314"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/6314"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/6314/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/6314/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/6314/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/438da697a162f2a09cbc569292b619e96de94e90"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}