{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/rfcs/pulls/comments/75806716","id":75806716,"diff_hunk":"@@ -0,0 +1,182 @@\n+- Feature Name: pluggable_host_info\n+- Start Date: 2016-08-18\n+- RFC PR:\n+- Issue:\n+\n+# Summary\n+[summary]: #summary\n+\n+Make the ENC output produced by Foreman extendable by plugins.\n+\n+# Motivation\n+[motivation]: #motivation\n+\n+As part of the effort to remove puppet from core, I found that the ENC output\n+represented by `Host#info` method contains elements from different parts of\n+the system. To break this monolith, I want to introduce providers registry so\n+the info output will be constructed by aggregation of the output from each\n+provider.\n+\n+One of the most vital constructs in the core that should be taken into account\n+in this redesign is the parameters framework represented by the `Classification`\n+module. This module is responsible for dealing with key-value storage offered\n+by the core and extended in modules like puppet. Basically it is responsible\n+for defining which value is relevant to each one of selected keys, given a\n+`Host` instance.\n+\n+Today I am aware of two more requirements that could be implemented with the\n+help of the suggested framework:\n+1. Chef plugin would like to extend the ENC by its unique information.\n+2. OpenSCAP wants to enrich the info from puppet provider.\n+\n+# Detailed design\n+[design]: #detailed-design\n+\n+## Registry\n+We will start with a simple registry to store the list of registered providers.\n+The registry will be a simple module with a property to hold the list of\n+providers and a valid accessor method.\n+\n+``` ruby\n+module HostInfo\n+  class << self\n+    def info_providers\n+      @info_providers ||= []\n+    end\n+\n+    def register_info_provider(provider)\n+      info_providers << provider\n+    end\n+  end\n+end\n+```\n+\n+The registry should also be available through the plugin declaration, in order\n+to ease the usage in the framework:\n+\n+``` ruby\n+\n+plugin :puppet do\n+  provides_info PuppetHostInfoProvider\n+end\n+\n+```\n+\n+## Provider\n+All providers should inherit a base class that will define the semi-formal\n+interface for interactions with the provider:\n+\n+``` ruby\n+class HostInfo::Provider\n+  def initialize(host)\n+    @host = host\n+  end\n+\n+  # Will return provider-specific portion of the info hash.\n+  def host_info\n+    throw 'Provider is not implemented'\n+  end\n+\n+  protected","path":"text/0012-open-host-info-to-plugins.md","position":80,"original_position":80,"commit_id":"f5dad3996f0fefacae71021f6f7e496bf0ac084f","original_commit_id":"f5dad3996f0fefacae71021f6f7e496bf0ac084f","user":{"login":"ShimShtein","id":10046168,"avatar_url":"https://avatars.githubusercontent.com/u/10046168?v=3","gravatar_id":"","url":"https://api.github.com/users/ShimShtein","html_url":"https://github.com/ShimShtein","followers_url":"https://api.github.com/users/ShimShtein/followers","following_url":"https://api.github.com/users/ShimShtein/following{/other_user}","gists_url":"https://api.github.com/users/ShimShtein/gists{/gist_id}","starred_url":"https://api.github.com/users/ShimShtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShimShtein/subscriptions","organizations_url":"https://api.github.com/users/ShimShtein/orgs","repos_url":"https://api.github.com/users/ShimShtein/repos","events_url":"https://api.github.com/users/ShimShtein/events{/privacy}","received_events_url":"https://api.github.com/users/ShimShtein/received_events","type":"User","site_admin":false},"body":"To reduce the public interface to a minimum. The `:host` attribute is there for the implementers to be able to access the host. It's part of the class context, rather than a property that it manages.","created_at":"2016-08-23T06:02:07Z","updated_at":"2016-08-23T06:02:07Z","html_url":"https://github.com/theforeman/rfcs/pull/12#discussion_r75806716","pull_request_url":"https://api.github.com/repos/theforeman/rfcs/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/theforeman/rfcs/pulls/comments/75806716"},"html":{"href":"https://github.com/theforeman/rfcs/pull/12#discussion_r75806716"},"pull_request":{"href":"https://api.github.com/repos/theforeman/rfcs/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/rfcs/pulls/12","id":82105648,"html_url":"https://github.com/theforeman/rfcs/pull/12","diff_url":"https://github.com/theforeman/rfcs/pull/12.diff","patch_url":"https://github.com/theforeman/rfcs/pull/12.patch","issue_url":"https://api.github.com/repos/theforeman/rfcs/issues/12","number":12,"state":"open","locked":false,"title":"Open host info to plugins","user":{"login":"ShimShtein","id":10046168,"avatar_url":"https://avatars.githubusercontent.com/u/10046168?v=3","gravatar_id":"","url":"https://api.github.com/users/ShimShtein","html_url":"https://github.com/ShimShtein","followers_url":"https://api.github.com/users/ShimShtein/followers","following_url":"https://api.github.com/users/ShimShtein/following{/other_user}","gists_url":"https://api.github.com/users/ShimShtein/gists{/gist_id}","starred_url":"https://api.github.com/users/ShimShtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShimShtein/subscriptions","organizations_url":"https://api.github.com/users/ShimShtein/orgs","repos_url":"https://api.github.com/users/ShimShtein/repos","events_url":"https://api.github.com/users/ShimShtein/events{/privacy}","received_events_url":"https://api.github.com/users/ShimShtein/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-21T13:24:34Z","updated_at":"2016-08-23T06:02:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e23853c8747d49c0645cefe942b53233b9db8ba","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/rfcs/pulls/12/commits","review_comments_url":"https://api.github.com/repos/theforeman/rfcs/pulls/12/comments","review_comment_url":"https://api.github.com/repos/theforeman/rfcs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/rfcs/issues/12/comments","statuses_url":"https://api.github.com/repos/theforeman/rfcs/statuses/f5dad3996f0fefacae71021f6f7e496bf0ac084f","head":{"label":"ShimShtein:host_info","ref":"host_info","sha":"f5dad3996f0fefacae71021f6f7e496bf0ac084f","user":{"login":"ShimShtein","id":10046168,"avatar_url":"https://avatars.githubusercontent.com/u/10046168?v=3","gravatar_id":"","url":"https://api.github.com/users/ShimShtein","html_url":"https://github.com/ShimShtein","followers_url":"https://api.github.com/users/ShimShtein/followers","following_url":"https://api.github.com/users/ShimShtein/following{/other_user}","gists_url":"https://api.github.com/users/ShimShtein/gists{/gist_id}","starred_url":"https://api.github.com/users/ShimShtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShimShtein/subscriptions","organizations_url":"https://api.github.com/users/ShimShtein/orgs","repos_url":"https://api.github.com/users/ShimShtein/repos","events_url":"https://api.github.com/users/ShimShtein/events{/privacy}","received_events_url":"https://api.github.com/users/ShimShtein/received_events","type":"User","site_admin":false},"repo":{"id":62121871,"name":"rfcs","full_name":"ShimShtein/rfcs","owner":{"login":"ShimShtein","id":10046168,"avatar_url":"https://avatars.githubusercontent.com/u/10046168?v=3","gravatar_id":"","url":"https://api.github.com/users/ShimShtein","html_url":"https://github.com/ShimShtein","followers_url":"https://api.github.com/users/ShimShtein/followers","following_url":"https://api.github.com/users/ShimShtein/following{/other_user}","gists_url":"https://api.github.com/users/ShimShtein/gists{/gist_id}","starred_url":"https://api.github.com/users/ShimShtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShimShtein/subscriptions","organizations_url":"https://api.github.com/users/ShimShtein/orgs","repos_url":"https://api.github.com/users/ShimShtein/repos","events_url":"https://api.github.com/users/ShimShtein/events{/privacy}","received_events_url":"https://api.github.com/users/ShimShtein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ShimShtein/rfcs","description":"RFCs for TheForeman","fork":true,"url":"https://api.github.com/repos/ShimShtein/rfcs","forks_url":"https://api.github.com/repos/ShimShtein/rfcs/forks","keys_url":"https://api.github.com/repos/ShimShtein/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShimShtein/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShimShtein/rfcs/teams","hooks_url":"https://api.github.com/repos/ShimShtein/rfcs/hooks","issue_events_url":"https://api.github.com/repos/ShimShtein/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/ShimShtein/rfcs/events","assignees_url":"https://api.github.com/repos/ShimShtein/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/ShimShtein/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/ShimShtein/rfcs/tags","blobs_url":"https://api.github.com/repos/ShimShtein/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShimShtein/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShimShtein/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShimShtein/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShimShtein/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/ShimShtein/rfcs/languages","stargazers_url":"https://api.github.com/repos/ShimShtein/rfcs/stargazers","contributors_url":"https://api.github.com/repos/ShimShtein/rfcs/contributors","subscribers_url":"https://api.github.com/repos/ShimShtein/rfcs/subscribers","subscription_url":"https://api.github.com/repos/ShimShtein/rfcs/subscription","commits_url":"https://api.github.com/repos/ShimShtein/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShimShtein/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShimShtein/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShimShtein/rfcs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShimShtein/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/ShimShtein/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShimShtein/rfcs/merges","archive_url":"https://api.github.com/repos/ShimShtein/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShimShtein/rfcs/downloads","issues_url":"https://api.github.com/repos/ShimShtein/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/ShimShtein/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/ShimShtein/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/ShimShtein/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShimShtein/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/ShimShtein/rfcs/releases{/id}","deployments_url":"https://api.github.com/repos/ShimShtein/rfcs/deployments","created_at":"2016-06-28T08:01:32Z","updated_at":"2016-06-15T19:54:45Z","pushed_at":"2016-08-21T13:24:17Z","git_url":"git://github.com/ShimShtein/rfcs.git","ssh_url":"git@github.com:ShimShtein/rfcs.git","clone_url":"https://github.com/ShimShtein/rfcs.git","svn_url":"https://github.com/ShimShtein/rfcs","homepage":null,"size":32,"stargazers_count":0,"watchers_count":0,"language":null,"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":"theforeman:master","ref":"master","sha":"46ec3ff0ba7f499ff766ac47665708a48916302f","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":55964639,"name":"rfcs","full_name":"theforeman/rfcs","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/rfcs","description":"RFCs for TheForeman","fork":false,"url":"https://api.github.com/repos/theforeman/rfcs","forks_url":"https://api.github.com/repos/theforeman/rfcs/forks","keys_url":"https://api.github.com/repos/theforeman/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/rfcs/teams","hooks_url":"https://api.github.com/repos/theforeman/rfcs/hooks","issue_events_url":"https://api.github.com/repos/theforeman/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/rfcs/events","assignees_url":"https://api.github.com/repos/theforeman/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/rfcs/tags","blobs_url":"https://api.github.com/repos/theforeman/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/rfcs/languages","stargazers_url":"https://api.github.com/repos/theforeman/rfcs/stargazers","contributors_url":"https://api.github.com/repos/theforeman/rfcs/contributors","subscribers_url":"https://api.github.com/repos/theforeman/rfcs/subscribers","subscription_url":"https://api.github.com/repos/theforeman/rfcs/subscription","commits_url":"https://api.github.com/repos/theforeman/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/rfcs/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/rfcs/merges","archive_url":"https://api.github.com/repos/theforeman/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/rfcs/downloads","issues_url":"https://api.github.com/repos/theforeman/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/rfcs/releases{/id}","deployments_url":"https://api.github.com/repos/theforeman/rfcs/deployments","created_at":"2016-04-11T10:53:53Z","updated_at":"2016-07-25T16:19:39Z","pushed_at":"2016-08-22T11:18:33Z","git_url":"git://github.com/theforeman/rfcs.git","ssh_url":"git@github.com:theforeman/rfcs.git","clone_url":"https://github.com/theforeman/rfcs.git","svn_url":"https://github.com/theforeman/rfcs","homepage":null,"size":49,"stargazers_count":7,"watchers_count":7,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":7,"forks":9,"open_issues":7,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/rfcs/pulls/12"},"html":{"href":"https://github.com/theforeman/rfcs/pull/12"},"issue":{"href":"https://api.github.com/repos/theforeman/rfcs/issues/12"},"comments":{"href":"https://api.github.com/repos/theforeman/rfcs/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/rfcs/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/rfcs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/rfcs/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/rfcs/statuses/f5dad3996f0fefacae71021f6f7e496bf0ac084f"}}}}
{"actor":{"display_login":"ShimShtein"}}