{"action":"created","comment":{"url":"https://api.github.com/repos/chef/chef-dk/pulls/comments/85622829","pull_request_review_id":6331504,"id":85622829,"diff_hunk":"@@ -47,8 +64,19 @@ def desc\n         \"chef_server(#{uri})\"\n       end\n \n+      private\n+\n+      def http_connection_for(base_url)\n+        @http_connections[base_url] ||= ChefDK::AuthenticatedHTTP::Simple.new(base_url)\n+      end\n+\n+      def full_chef_server_graph\n+        @full_chef_server_graph ||=\n+          begin\n+            graph_json = http_connection_for(uri.to_s).get('/universe')\n+            JSON.parse(graph_json)","path":"lib/chef-dk/policyfile/chef_server_cookbook_source.rb","position":64,"original_position":64,"commit_id":"a90e6fea01b6a04d71a502dd85d2042e1951a196","original_commit_id":"a90e6fea01b6a04d71a502dd85d2042e1951a196","user":{"login":"danielsdeleo","id":37162,"avatar_url":"https://avatars.githubusercontent.com/u/37162?v=3","gravatar_id":"","url":"https://api.github.com/users/danielsdeleo","html_url":"https://github.com/danielsdeleo","followers_url":"https://api.github.com/users/danielsdeleo/followers","following_url":"https://api.github.com/users/danielsdeleo/following{/other_user}","gists_url":"https://api.github.com/users/danielsdeleo/gists{/gist_id}","starred_url":"https://api.github.com/users/danielsdeleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielsdeleo/subscriptions","organizations_url":"https://api.github.com/users/danielsdeleo/orgs","repos_url":"https://api.github.com/users/danielsdeleo/repos","events_url":"https://api.github.com/users/danielsdeleo/events{/privacy}","received_events_url":"https://api.github.com/users/danielsdeleo/received_events","type":"User","site_admin":false},"body":"Can we use FFI Yajl here for consistency?","created_at":"2016-10-28T22:56:26Z","updated_at":"2016-10-28T22:56:26Z","html_url":"https://github.com/chef/chef-dk/pull/947#discussion_r85622829","pull_request_url":"https://api.github.com/repos/chef/chef-dk/pulls/947","_links":{"self":{"href":"https://api.github.com/repos/chef/chef-dk/pulls/comments/85622829"},"html":{"href":"https://github.com/chef/chef-dk/pull/947#discussion_r85622829"},"pull_request":{"href":"https://api.github.com/repos/chef/chef-dk/pulls/947"}}},"pull_request":{"url":"https://api.github.com/repos/chef/chef-dk/pulls/947","id":79268022,"html_url":"https://github.com/chef/chef-dk/pull/947","diff_url":"https://github.com/chef/chef-dk/pull/947.diff","patch_url":"https://github.com/chef/chef-dk/pull/947.patch","issue_url":"https://api.github.com/repos/chef/chef-dk/issues/947","number":947,"state":"open","locked":false,"title":"Add chef server source to Policyfile.rb","user":{"login":"martinisoft","id":724,"avatar_url":"https://avatars.githubusercontent.com/u/724?v=3","gravatar_id":"","url":"https://api.github.com/users/martinisoft","html_url":"https://github.com/martinisoft","followers_url":"https://api.github.com/users/martinisoft/followers","following_url":"https://api.github.com/users/martinisoft/following{/other_user}","gists_url":"https://api.github.com/users/martinisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/martinisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinisoft/subscriptions","organizations_url":"https://api.github.com/users/martinisoft/orgs","repos_url":"https://api.github.com/users/martinisoft/repos","events_url":"https://api.github.com/users/martinisoft/events{/privacy}","received_events_url":"https://api.github.com/users/martinisoft/received_events","type":"User","site_admin":false},"body":"We're starting to finally dig into Policy Files at DNSimple and we love it, but we're also using a multi-repo Berkshelf setup which lends itself to using the Chef Server as an artifact repository for our cookbook versions. Since this was not implemented yet I thought I'd give it a try. Much of this code is an amalgamation of existing patterns in Berkshelf and ChefDK so putting this together was easier than I thought. It also lends itself to a future re-factor of the Supermarket/Community source class to use the borrowed SourceURI resolver from Berkshelf.\r\n\r\nLooking for some additional help, code review, and guidance on getting this merged in to ChefDK.","created_at":"2016-07-28T21:02:52Z","updated_at":"2016-10-28T22:56:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bf0c88de9da1f1aeb5b99f48749ca7fead83a86","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/chef/chef-dk/pulls/947/commits","review_comments_url":"https://api.github.com/repos/chef/chef-dk/pulls/947/comments","review_comment_url":"https://api.github.com/repos/chef/chef-dk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/chef-dk/issues/947/comments","statuses_url":"https://api.github.com/repos/chef/chef-dk/statuses/a90e6fea01b6a04d71a502dd85d2042e1951a196","head":{"label":"martinisoft:add_chef_server_to_policies","ref":"add_chef_server_to_policies","sha":"a90e6fea01b6a04d71a502dd85d2042e1951a196","user":{"login":"martinisoft","id":724,"avatar_url":"https://avatars.githubusercontent.com/u/724?v=3","gravatar_id":"","url":"https://api.github.com/users/martinisoft","html_url":"https://github.com/martinisoft","followers_url":"https://api.github.com/users/martinisoft/followers","following_url":"https://api.github.com/users/martinisoft/following{/other_user}","gists_url":"https://api.github.com/users/martinisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/martinisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinisoft/subscriptions","organizations_url":"https://api.github.com/users/martinisoft/orgs","repos_url":"https://api.github.com/users/martinisoft/repos","events_url":"https://api.github.com/users/martinisoft/events{/privacy}","received_events_url":"https://api.github.com/users/martinisoft/received_events","type":"User","site_admin":false},"repo":{"id":19509175,"name":"chef-dk","full_name":"martinisoft/chef-dk","owner":{"login":"martinisoft","id":724,"avatar_url":"https://avatars.githubusercontent.com/u/724?v=3","gravatar_id":"","url":"https://api.github.com/users/martinisoft","html_url":"https://github.com/martinisoft","followers_url":"https://api.github.com/users/martinisoft/followers","following_url":"https://api.github.com/users/martinisoft/following{/other_user}","gists_url":"https://api.github.com/users/martinisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/martinisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinisoft/subscriptions","organizations_url":"https://api.github.com/users/martinisoft/orgs","repos_url":"https://api.github.com/users/martinisoft/repos","events_url":"https://api.github.com/users/martinisoft/events{/privacy}","received_events_url":"https://api.github.com/users/martinisoft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martinisoft/chef-dk","description":"A streamlined development and deployment workflow for Chef platform.","fork":true,"url":"https://api.github.com/repos/martinisoft/chef-dk","forks_url":"https://api.github.com/repos/martinisoft/chef-dk/forks","keys_url":"https://api.github.com/repos/martinisoft/chef-dk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martinisoft/chef-dk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martinisoft/chef-dk/teams","hooks_url":"https://api.github.com/repos/martinisoft/chef-dk/hooks","issue_events_url":"https://api.github.com/repos/martinisoft/chef-dk/issues/events{/number}","events_url":"https://api.github.com/repos/martinisoft/chef-dk/events","assignees_url":"https://api.github.com/repos/martinisoft/chef-dk/assignees{/user}","branches_url":"https://api.github.com/repos/martinisoft/chef-dk/branches{/branch}","tags_url":"https://api.github.com/repos/martinisoft/chef-dk/tags","blobs_url":"https://api.github.com/repos/martinisoft/chef-dk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martinisoft/chef-dk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martinisoft/chef-dk/git/refs{/sha}","trees_url":"https://api.github.com/repos/martinisoft/chef-dk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martinisoft/chef-dk/statuses/{sha}","languages_url":"https://api.github.com/repos/martinisoft/chef-dk/languages","stargazers_url":"https://api.github.com/repos/martinisoft/chef-dk/stargazers","contributors_url":"https://api.github.com/repos/martinisoft/chef-dk/contributors","subscribers_url":"https://api.github.com/repos/martinisoft/chef-dk/subscribers","subscription_url":"https://api.github.com/repos/martinisoft/chef-dk/subscription","commits_url":"https://api.github.com/repos/martinisoft/chef-dk/commits{/sha}","git_commits_url":"https://api.github.com/repos/martinisoft/chef-dk/git/commits{/sha}","comments_url":"https://api.github.com/repos/martinisoft/chef-dk/comments{/number}","issue_comment_url":"https://api.github.com/repos/martinisoft/chef-dk/issues/comments{/number}","contents_url":"https://api.github.com/repos/martinisoft/chef-dk/contents/{+path}","compare_url":"https://api.github.com/repos/martinisoft/chef-dk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martinisoft/chef-dk/merges","archive_url":"https://api.github.com/repos/martinisoft/chef-dk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martinisoft/chef-dk/downloads","issues_url":"https://api.github.com/repos/martinisoft/chef-dk/issues{/number}","pulls_url":"https://api.github.com/repos/martinisoft/chef-dk/pulls{/number}","milestones_url":"https://api.github.com/repos/martinisoft/chef-dk/milestones{/number}","notifications_url":"https://api.github.com/repos/martinisoft/chef-dk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martinisoft/chef-dk/labels{/name}","releases_url":"https://api.github.com/repos/martinisoft/chef-dk/releases{/id}","deployments_url":"https://api.github.com/repos/martinisoft/chef-dk/deployments","created_at":"2014-05-06T20:14:34Z","updated_at":"2016-07-27T17:11:14Z","pushed_at":"2016-10-28T22:50:55Z","git_url":"git://github.com/martinisoft/chef-dk.git","ssh_url":"git@github.com:martinisoft/chef-dk.git","clone_url":"https://github.com/martinisoft/chef-dk.git","svn_url":"https://github.com/martinisoft/chef-dk","homepage":null,"size":4544,"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":"chef:master","ref":"master","sha":"f8be1f9d017f41d48ff1d4b8e9b40a98dc4f6634","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":17303641,"name":"chef-dk","full_name":"chef/chef-dk","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-dk","description":"A streamlined development and deployment workflow for Chef platform.","fork":false,"url":"https://api.github.com/repos/chef/chef-dk","forks_url":"https://api.github.com/repos/chef/chef-dk/forks","keys_url":"https://api.github.com/repos/chef/chef-dk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef-dk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef-dk/teams","hooks_url":"https://api.github.com/repos/chef/chef-dk/hooks","issue_events_url":"https://api.github.com/repos/chef/chef-dk/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef-dk/events","assignees_url":"https://api.github.com/repos/chef/chef-dk/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef-dk/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef-dk/tags","blobs_url":"https://api.github.com/repos/chef/chef-dk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef-dk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef-dk/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef-dk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef-dk/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef-dk/languages","stargazers_url":"https://api.github.com/repos/chef/chef-dk/stargazers","contributors_url":"https://api.github.com/repos/chef/chef-dk/contributors","subscribers_url":"https://api.github.com/repos/chef/chef-dk/subscribers","subscription_url":"https://api.github.com/repos/chef/chef-dk/subscription","commits_url":"https://api.github.com/repos/chef/chef-dk/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef-dk/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef-dk/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef-dk/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef-dk/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef-dk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef-dk/merges","archive_url":"https://api.github.com/repos/chef/chef-dk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef-dk/downloads","issues_url":"https://api.github.com/repos/chef/chef-dk/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef-dk/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef-dk/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef-dk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef-dk/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef-dk/releases{/id}","deployments_url":"https://api.github.com/repos/chef/chef-dk/deployments","created_at":"2014-02-28T23:59:39Z","updated_at":"2016-10-25T23:06:29Z","pushed_at":"2016-10-28T22:50:56Z","git_url":"git://github.com/chef/chef-dk.git","ssh_url":"git@github.com:chef/chef-dk.git","clone_url":"https://github.com/chef/chef-dk.git","svn_url":"https://github.com/chef/chef-dk","homepage":null,"size":5322,"stargazers_count":287,"watchers_count":287,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":109,"mirror_url":null,"open_issues_count":103,"forks":109,"open_issues":103,"watchers":287,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/chef-dk/pulls/947"},"html":{"href":"https://github.com/chef/chef-dk/pull/947"},"issue":{"href":"https://api.github.com/repos/chef/chef-dk/issues/947"},"comments":{"href":"https://api.github.com/repos/chef/chef-dk/issues/947/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/chef-dk/pulls/947/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/chef-dk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/chef-dk/pulls/947/commits"},"statuses":{"href":"https://api.github.com/repos/chef/chef-dk/statuses/a90e6fea01b6a04d71a502dd85d2042e1951a196"}}}}
{"actor":{"display_login":"danielsdeleo"}}