{"action":"created","comment":{"url":"https://api.github.com/repos/chef/chef/pulls/comments/30187387","id":30187387,"diff_hunk":"@@ -20,6 +20,93 @@\n require 'chef/platform/provider_priority_map'\n \n class Chef\n+  #\n+  # Provider Resolution\n+  # ===================\n+  #\n+  # When you type `service 'myservice' { action :restart }` in a recipe, a whole\n+  # string of events happens eventually leading to convergence.  The overview of\n+  # that process is described in `Chef::DSL::Recipe`.  Provider resolution is\n+  # the process of taking a Resource object and an action, and determining the\n+  # Provider class that should be instantiated to handle the action.\n+  #\n+  # The process happens in three steps:\n+  #\n+  # Explicit Provider on the Resource\n+  # ---------------------------------\n+  # If the resource has its `provider` set, that is used.\n+  #\n+  # Dynamic Provider Matches\n+  # ------------------------\n+  # In this stage, we call `provides?` to see if the Provider supports the\n+  # resource on this platform, and then we call `supports?` to determine if it\n+  # can handle the action.  It's a little more complicated than that, though:\n+  #\n+  # ### Provider.provides?\n+  #\n+  # First, we go through all known provider classes (all descendants of\n+  # `Chef::Provider`), and call `provides?(node, resource)` to determine if it\n+  # supports this action for this resource on this OS.  We get a list of all\n+  # matches.\n+  #\n+  # #### Defining provides\n+  #\n+  # The typical way of getting `provides?` is for the Provider class to call\n+  # `provides :name`.\n+  #\n+  # The Provider may pass the OS, platform family, platform, and platform version\n+  # to `provides`, and they will be matched against the values in the `node`\n+  # object.  The Provider may also pass a block, which allows for custom logic\n+  # to decide whether it provides the resource or not.\n+  #\n+  # Some Providers also override `provides?` with custom logic.\n+  #\n+  # ### Provider.supports?\n+  #\n+  # Once we have the list of willing providers, we filter it by calling their\n+  # `supports?(resource, action)` method to see if they support the specific\n+  # action (`:create`, `:delete`) or not.\n+  #\n+  # If no provider supports the specific action, we fall back to the full list\n+  # of matches from step 1.  (TODO The comment says it's for why run.  I'm not\n+  # sure what that means specifically yet.)\n+  #\n+  # ### Priority lists: Chef.get_provider_priority_array\n+  #\n+  # Once we have the list of matches, we look at `Chef.get_provider_priority_array(node, resource)`\n+  # to see if anyone has set a *priority list*.  This method takes\n+  # the the first matching priority list for this OS (which is the last list\n+  # that was registered).\n+  #\n+  # If any of our matches are on the priority list, we take the first one.\n+  #\n+  # If there is no priority list or no matches on it, we take the first result\n+  # alphabetically by class name.\n+  #\n+  # Chef::Platform Provider Map\n+  # ---------------------------\n+  # If we still have no matches, we try `Chef::Platform.find_provider_for_node(node, resource)`.\n+  # This does two new things:\n+  #\n+  # ### System Provider Map\n+  #\n+  # The system provider map is a large Hash loaded during `require` time,\n+  # which shows system-specific providers by os/platform, and platform_version.\n+  # It keys off of `node[:platform] || node[:os]`, and `node[:platform_version]\n+  # || node[:os_version] || node[:os_release]`.  The version uses typical gem\n+  # constraints like > and <=.\n+  #\n+  # The first platform+version match wins over the first platform-only match,\n+  # which wins over the default.\n+  #\n+  # ### Chef::Provider::FooBar\n+  #\n+  # As a last resort, if there are *still* no classes, the system transforms the\n+  # DSL name `foo_bar` into `Chef::Provider::FooBar`, and returns the class if\n+  # it is there and descends from `Chef::Provider`.\n+  #\n+  # NOTE: this behavior is now deprecated.\n+  #","path":"lib/chef/provider_resolver.rb","position":90,"original_position":90,"commit_id":"993e02415cf401b49e8bd93ba883b02c85d1aa66","original_commit_id":"993e02415cf401b49e8bd93ba883b02c85d1aa66","user":{"login":"lamont-granquist","id":454857,"avatar_url":"https://avatars.githubusercontent.com/u/454857?v=3","gravatar_id":"","url":"https://api.github.com/users/lamont-granquist","html_url":"https://github.com/lamont-granquist","followers_url":"https://api.github.com/users/lamont-granquist/followers","following_url":"https://api.github.com/users/lamont-granquist/following{/other_user}","gists_url":"https://api.github.com/users/lamont-granquist/gists{/gist_id}","starred_url":"https://api.github.com/users/lamont-granquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamont-granquist/subscriptions","organizations_url":"https://api.github.com/users/lamont-granquist/orgs","repos_url":"https://api.github.com/users/lamont-granquist/repos","events_url":"https://api.github.com/users/lamont-granquist/events{/privacy}","received_events_url":"https://api.github.com/users/lamont-granquist/received_events","type":"User","site_admin":false},"body":":+1:","created_at":"2015-05-12T22:26:43Z","updated_at":"2015-05-12T22:26:43Z","html_url":"https://github.com/chef/chef/pull/3269#discussion_r30187387","pull_request_url":"https://api.github.com/repos/chef/chef/pulls/3269","_links":{"self":{"href":"https://api.github.com/repos/chef/chef/pulls/comments/30187387"},"html":{"href":"https://github.com/chef/chef/pull/3269#discussion_r30187387"},"pull_request":{"href":"https://api.github.com/repos/chef/chef/pulls/3269"}}},"pull_request":{"url":"https://api.github.com/repos/chef/chef/pulls/3269","id":33969271,"html_url":"https://github.com/chef/chef/pull/3269","diff_url":"https://github.com/chef/chef/pull/3269.diff","patch_url":"https://github.com/chef/chef/pull/3269.patch","issue_url":"https://api.github.com/repos/chef/chef/issues/3269","number":3269,"state":"open","locked":false,"title":"Remove method_missing and make Chef::Resource unspecial","user":{"login":"jkeiser","id":654882,"avatar_url":"https://avatars.githubusercontent.com/u/654882?v=3","gravatar_id":"","url":"https://api.github.com/users/jkeiser","html_url":"https://github.com/jkeiser","followers_url":"https://api.github.com/users/jkeiser/followers","following_url":"https://api.github.com/users/jkeiser/following{/other_user}","gists_url":"https://api.github.com/users/jkeiser/gists{/gist_id}","starred_url":"https://api.github.com/users/jkeiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkeiser/subscriptions","organizations_url":"https://api.github.com/users/jkeiser/orgs","repos_url":"https://api.github.com/users/jkeiser/repos","events_url":"https://api.github.com/users/jkeiser/events{/privacy}","received_events_url":"https://api.github.com/users/jkeiser/received_events","type":"User","site_admin":false},"body":"Implements https://github.com/chef/chef-rfc/pull/117","created_at":"2015-04-23T15:51:23Z","updated_at":"2015-05-12T22:26:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c4927b87514ddddd47aec8ad2f9925a22bdf3d6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chef/chef/pulls/3269/commits","review_comments_url":"https://api.github.com/repos/chef/chef/pulls/3269/comments","review_comment_url":"https://api.github.com/repos/chef/chef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/chef/issues/3269/comments","statuses_url":"https://api.github.com/repos/chef/chef/statuses/993e02415cf401b49e8bd93ba883b02c85d1aa66","head":{"label":"chef:jk/missing_method_missing","ref":"jk/missing_method_missing","sha":"993e02415cf401b49e8bd93ba883b02c85d1aa66","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":108278,"name":"chef","full_name":"chef/chef","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef","description":"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.","fork":false,"url":"https://api.github.com/repos/chef/chef","forks_url":"https://api.github.com/repos/chef/chef/forks","keys_url":"https://api.github.com/repos/chef/chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef/teams","hooks_url":"https://api.github.com/repos/chef/chef/hooks","issue_events_url":"https://api.github.com/repos/chef/chef/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef/events","assignees_url":"https://api.github.com/repos/chef/chef/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef/tags","blobs_url":"https://api.github.com/repos/chef/chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef/languages","stargazers_url":"https://api.github.com/repos/chef/chef/stargazers","contributors_url":"https://api.github.com/repos/chef/chef/contributors","subscribers_url":"https://api.github.com/repos/chef/chef/subscribers","subscription_url":"https://api.github.com/repos/chef/chef/subscription","commits_url":"https://api.github.com/repos/chef/chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef/merges","archive_url":"https://api.github.com/repos/chef/chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef/downloads","issues_url":"https://api.github.com/repos/chef/chef/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef/releases{/id}","created_at":"2009-01-15T20:40:48Z","updated_at":"2015-05-12T21:00:19Z","pushed_at":"2015-05-12T21:54:53Z","git_url":"git://github.com/chef/chef.git","ssh_url":"git@github.com:chef/chef.git","clone_url":"https://github.com/chef/chef.git","svn_url":"https://github.com/chef/chef","homepage":"http://www.chef.io/chef/","size":168877,"stargazers_count":3585,"watchers_count":3585,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1458,"mirror_url":null,"open_issues_count":439,"forks":1458,"open_issues":439,"watchers":3585,"default_branch":"master"}},"base":{"label":"chef:master","ref":"master","sha":"e4bf480137d5e06aba7c9fee4ae1577361a44a47","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":108278,"name":"chef","full_name":"chef/chef","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef","description":"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.","fork":false,"url":"https://api.github.com/repos/chef/chef","forks_url":"https://api.github.com/repos/chef/chef/forks","keys_url":"https://api.github.com/repos/chef/chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef/teams","hooks_url":"https://api.github.com/repos/chef/chef/hooks","issue_events_url":"https://api.github.com/repos/chef/chef/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef/events","assignees_url":"https://api.github.com/repos/chef/chef/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef/tags","blobs_url":"https://api.github.com/repos/chef/chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef/languages","stargazers_url":"https://api.github.com/repos/chef/chef/stargazers","contributors_url":"https://api.github.com/repos/chef/chef/contributors","subscribers_url":"https://api.github.com/repos/chef/chef/subscribers","subscription_url":"https://api.github.com/repos/chef/chef/subscription","commits_url":"https://api.github.com/repos/chef/chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef/merges","archive_url":"https://api.github.com/repos/chef/chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef/downloads","issues_url":"https://api.github.com/repos/chef/chef/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef/releases{/id}","created_at":"2009-01-15T20:40:48Z","updated_at":"2015-05-12T21:00:19Z","pushed_at":"2015-05-12T21:54:53Z","git_url":"git://github.com/chef/chef.git","ssh_url":"git@github.com:chef/chef.git","clone_url":"https://github.com/chef/chef.git","svn_url":"https://github.com/chef/chef","homepage":"http://www.chef.io/chef/","size":168877,"stargazers_count":3585,"watchers_count":3585,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1458,"mirror_url":null,"open_issues_count":439,"forks":1458,"open_issues":439,"watchers":3585,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/chef/pulls/3269"},"html":{"href":"https://github.com/chef/chef/pull/3269"},"issue":{"href":"https://api.github.com/repos/chef/chef/issues/3269"},"comments":{"href":"https://api.github.com/repos/chef/chef/issues/3269/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/chef/pulls/3269/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/chef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/chef/pulls/3269/commits"},"statuses":{"href":"https://api.github.com/repos/chef/chef/statuses/993e02415cf401b49e8bd93ba883b02c85d1aa66"}}}}