{"action":"created","comment":{"url":"https://api.github.com/repos/chef/supermarket/pulls/comments/59910959","id":59910959,"diff_hunk":"@@ -21,9 +21,23 @@ def perform(cookbook_version_id)\n     data = {\n       'cookbook_name' => cookbook_version.name,\n       'cookbook_version' => cookbook_version.version,\n-      'cookbook_artifact_url' => cookbook_version.tarball.url\n+      'cookbook_artifact_url' => cookbook_artifact_url(cookbook_version)\n     }\n \n     response = Net::HTTP.post_form(uri, data)\n   end\n+\n+ def cookbook_artifact_url(cookbook_version)\n+    if s3_configured?\n+      cookbook_version.tarball.url\n+    else\n+      \"#{Supermarket::Host.full_url}#{cookbook_version.tarball.url}\"\n+    end\n+  end\n+\n+  def s3_configured?\n+    %w(S3_BUCKET S3_ACCESS_KEY_ID S3_SECRET_ACCESS_KEY).all? do |key|\n+      ENV[key].present?","path":"src/supermarket/app/workers/fieri_notify_worker.rb","position":21,"original_position":21,"commit_id":"5db18cf402582423d6a17032b0eea0cfcf2edf76","original_commit_id":"5db18cf402582423d6a17032b0eea0cfcf2edf76","user":{"login":"nellshamrell","id":813007,"avatar_url":"https://avatars.githubusercontent.com/u/813007?v=3","gravatar_id":"","url":"https://api.github.com/users/nellshamrell","html_url":"https://github.com/nellshamrell","followers_url":"https://api.github.com/users/nellshamrell/followers","following_url":"https://api.github.com/users/nellshamrell/following{/other_user}","gists_url":"https://api.github.com/users/nellshamrell/gists{/gist_id}","starred_url":"https://api.github.com/users/nellshamrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nellshamrell/subscriptions","organizations_url":"https://api.github.com/users/nellshamrell/orgs","repos_url":"https://api.github.com/users/nellshamrell/repos","events_url":"https://api.github.com/users/nellshamrell/events{/privacy}","received_events_url":"https://api.github.com/users/nellshamrell/received_events","type":"User","site_admin":false},"body":"Will investigate :)","created_at":"2016-04-15T17:34:40Z","updated_at":"2016-04-15T17:34:40Z","html_url":"https://github.com/chef/supermarket/pull/1270#discussion_r59910959","pull_request_url":"https://api.github.com/repos/chef/supermarket/pulls/1270","_links":{"self":{"href":"https://api.github.com/repos/chef/supermarket/pulls/comments/59910959"},"html":{"href":"https://github.com/chef/supermarket/pull/1270#discussion_r59910959"},"pull_request":{"href":"https://api.github.com/repos/chef/supermarket/pulls/1270"}}},"pull_request":{"url":"https://api.github.com/repos/chef/supermarket/pulls/1270","id":66408999,"html_url":"https://github.com/chef/supermarket/pull/1270","diff_url":"https://github.com/chef/supermarket/pull/1270.diff","patch_url":"https://github.com/chef/supermarket/pull/1270.patch","issue_url":"https://api.github.com/repos/chef/supermarket/issues/1270","number":1270,"state":"open","locked":false,"title":"Fieri use with on disk cookbooks","user":{"login":"nellshamrell","id":813007,"avatar_url":"https://avatars.githubusercontent.com/u/813007?v=3","gravatar_id":"","url":"https://api.github.com/users/nellshamrell","html_url":"https://github.com/nellshamrell","followers_url":"https://api.github.com/users/nellshamrell/followers","following_url":"https://api.github.com/users/nellshamrell/following{/other_user}","gists_url":"https://api.github.com/users/nellshamrell/gists{/gist_id}","starred_url":"https://api.github.com/users/nellshamrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nellshamrell/subscriptions","organizations_url":"https://api.github.com/users/nellshamrell/orgs","repos_url":"https://api.github.com/users/nellshamrell/repos","events_url":"https://api.github.com/users/nellshamrell/events{/privacy}","received_events_url":"https://api.github.com/users/nellshamrell/received_events","type":"User","site_admin":false},"body":"This alters the cookbook_version.tarball.url to point to the correct location when a Supermarket is storing its cookbook on disc.\r\n\r\nThis also corrects a typo in one of our routes \"cookbook_verisons\" (switched i and s) is now \"cookbook_versions.\"  I have left the old route in with a note in case anyone is still using it.  I have verified that both urls work with a live Private Supermarket and Fieri instance.","created_at":"2016-04-13T23:38:06Z","updated_at":"2016-04-15T17:34:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"155e5bdf051ada3db470e0e4f05fd0ce90c39756","assignee":{"login":"robbkidd","id":517302,"avatar_url":"https://avatars.githubusercontent.com/u/517302?v=3","gravatar_id":"","url":"https://api.github.com/users/robbkidd","html_url":"https://github.com/robbkidd","followers_url":"https://api.github.com/users/robbkidd/followers","following_url":"https://api.github.com/users/robbkidd/following{/other_user}","gists_url":"https://api.github.com/users/robbkidd/gists{/gist_id}","starred_url":"https://api.github.com/users/robbkidd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbkidd/subscriptions","organizations_url":"https://api.github.com/users/robbkidd/orgs","repos_url":"https://api.github.com/users/robbkidd/repos","events_url":"https://api.github.com/users/robbkidd/events{/privacy}","received_events_url":"https://api.github.com/users/robbkidd/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/chef/supermarket/pulls/1270/commits","review_comments_url":"https://api.github.com/repos/chef/supermarket/pulls/1270/comments","review_comment_url":"https://api.github.com/repos/chef/supermarket/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/supermarket/issues/1270/comments","statuses_url":"https://api.github.com/repos/chef/supermarket/statuses/5db18cf402582423d6a17032b0eea0cfcf2edf76","head":{"label":"nellshamrell:fieri-use-with-on-disk-cookbooks","ref":"fieri-use-with-on-disk-cookbooks","sha":"5db18cf402582423d6a17032b0eea0cfcf2edf76","user":{"login":"nellshamrell","id":813007,"avatar_url":"https://avatars.githubusercontent.com/u/813007?v=3","gravatar_id":"","url":"https://api.github.com/users/nellshamrell","html_url":"https://github.com/nellshamrell","followers_url":"https://api.github.com/users/nellshamrell/followers","following_url":"https://api.github.com/users/nellshamrell/following{/other_user}","gists_url":"https://api.github.com/users/nellshamrell/gists{/gist_id}","starred_url":"https://api.github.com/users/nellshamrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nellshamrell/subscriptions","organizations_url":"https://api.github.com/users/nellshamrell/orgs","repos_url":"https://api.github.com/users/nellshamrell/repos","events_url":"https://api.github.com/users/nellshamrell/events{/privacy}","received_events_url":"https://api.github.com/users/nellshamrell/received_events","type":"User","site_admin":false},"repo":{"id":24782030,"name":"supermarket","full_name":"nellshamrell/supermarket","owner":{"login":"nellshamrell","id":813007,"avatar_url":"https://avatars.githubusercontent.com/u/813007?v=3","gravatar_id":"","url":"https://api.github.com/users/nellshamrell","html_url":"https://github.com/nellshamrell","followers_url":"https://api.github.com/users/nellshamrell/followers","following_url":"https://api.github.com/users/nellshamrell/following{/other_user}","gists_url":"https://api.github.com/users/nellshamrell/gists{/gist_id}","starred_url":"https://api.github.com/users/nellshamrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nellshamrell/subscriptions","organizations_url":"https://api.github.com/users/nellshamrell/orgs","repos_url":"https://api.github.com/users/nellshamrell/repos","events_url":"https://api.github.com/users/nellshamrell/events{/privacy}","received_events_url":"https://api.github.com/users/nellshamrell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nellshamrell/supermarket","description":"Chef's community platform","fork":true,"url":"https://api.github.com/repos/nellshamrell/supermarket","forks_url":"https://api.github.com/repos/nellshamrell/supermarket/forks","keys_url":"https://api.github.com/repos/nellshamrell/supermarket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nellshamrell/supermarket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nellshamrell/supermarket/teams","hooks_url":"https://api.github.com/repos/nellshamrell/supermarket/hooks","issue_events_url":"https://api.github.com/repos/nellshamrell/supermarket/issues/events{/number}","events_url":"https://api.github.com/repos/nellshamrell/supermarket/events","assignees_url":"https://api.github.com/repos/nellshamrell/supermarket/assignees{/user}","branches_url":"https://api.github.com/repos/nellshamrell/supermarket/branches{/branch}","tags_url":"https://api.github.com/repos/nellshamrell/supermarket/tags","blobs_url":"https://api.github.com/repos/nellshamrell/supermarket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nellshamrell/supermarket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nellshamrell/supermarket/git/refs{/sha}","trees_url":"https://api.github.com/repos/nellshamrell/supermarket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nellshamrell/supermarket/statuses/{sha}","languages_url":"https://api.github.com/repos/nellshamrell/supermarket/languages","stargazers_url":"https://api.github.com/repos/nellshamrell/supermarket/stargazers","contributors_url":"https://api.github.com/repos/nellshamrell/supermarket/contributors","subscribers_url":"https://api.github.com/repos/nellshamrell/supermarket/subscribers","subscription_url":"https://api.github.com/repos/nellshamrell/supermarket/subscription","commits_url":"https://api.github.com/repos/nellshamrell/supermarket/commits{/sha}","git_commits_url":"https://api.github.com/repos/nellshamrell/supermarket/git/commits{/sha}","comments_url":"https://api.github.com/repos/nellshamrell/supermarket/comments{/number}","issue_comment_url":"https://api.github.com/repos/nellshamrell/supermarket/issues/comments{/number}","contents_url":"https://api.github.com/repos/nellshamrell/supermarket/contents/{+path}","compare_url":"https://api.github.com/repos/nellshamrell/supermarket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nellshamrell/supermarket/merges","archive_url":"https://api.github.com/repos/nellshamrell/supermarket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nellshamrell/supermarket/downloads","issues_url":"https://api.github.com/repos/nellshamrell/supermarket/issues{/number}","pulls_url":"https://api.github.com/repos/nellshamrell/supermarket/pulls{/number}","milestones_url":"https://api.github.com/repos/nellshamrell/supermarket/milestones{/number}","notifications_url":"https://api.github.com/repos/nellshamrell/supermarket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nellshamrell/supermarket/labels{/name}","releases_url":"https://api.github.com/repos/nellshamrell/supermarket/releases{/id}","deployments_url":"https://api.github.com/repos/nellshamrell/supermarket/deployments","created_at":"2014-10-04T04:49:00Z","updated_at":"2016-01-19T19:49:28Z","pushed_at":"2016-04-13T19:50:35Z","git_url":"git://github.com/nellshamrell/supermarket.git","ssh_url":"git@github.com:nellshamrell/supermarket.git","clone_url":"https://github.com/nellshamrell/supermarket.git","svn_url":"https://github.com/nellshamrell/supermarket","homepage":"https://supermarket.getchef.com","size":4629,"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":"1c3c345535a3767f5a03528e6b0377c0139b5508","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":13633443,"name":"supermarket","full_name":"chef/supermarket","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/supermarket","description":"Chef's community platform","fork":false,"url":"https://api.github.com/repos/chef/supermarket","forks_url":"https://api.github.com/repos/chef/supermarket/forks","keys_url":"https://api.github.com/repos/chef/supermarket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/supermarket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/supermarket/teams","hooks_url":"https://api.github.com/repos/chef/supermarket/hooks","issue_events_url":"https://api.github.com/repos/chef/supermarket/issues/events{/number}","events_url":"https://api.github.com/repos/chef/supermarket/events","assignees_url":"https://api.github.com/repos/chef/supermarket/assignees{/user}","branches_url":"https://api.github.com/repos/chef/supermarket/branches{/branch}","tags_url":"https://api.github.com/repos/chef/supermarket/tags","blobs_url":"https://api.github.com/repos/chef/supermarket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/supermarket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/supermarket/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/supermarket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/supermarket/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/supermarket/languages","stargazers_url":"https://api.github.com/repos/chef/supermarket/stargazers","contributors_url":"https://api.github.com/repos/chef/supermarket/contributors","subscribers_url":"https://api.github.com/repos/chef/supermarket/subscribers","subscription_url":"https://api.github.com/repos/chef/supermarket/subscription","commits_url":"https://api.github.com/repos/chef/supermarket/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/supermarket/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/supermarket/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/supermarket/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/supermarket/contents/{+path}","compare_url":"https://api.github.com/repos/chef/supermarket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/supermarket/merges","archive_url":"https://api.github.com/repos/chef/supermarket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/supermarket/downloads","issues_url":"https://api.github.com/repos/chef/supermarket/issues{/number}","pulls_url":"https://api.github.com/repos/chef/supermarket/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/supermarket/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/supermarket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/supermarket/labels{/name}","releases_url":"https://api.github.com/repos/chef/supermarket/releases{/id}","deployments_url":"https://api.github.com/repos/chef/supermarket/deployments","created_at":"2013-10-16T22:54:53Z","updated_at":"2016-04-12T16:13:20Z","pushed_at":"2016-04-14T23:14:23Z","git_url":"git://github.com/chef/supermarket.git","ssh_url":"git@github.com:chef/supermarket.git","clone_url":"https://github.com/chef/supermarket.git","svn_url":"https://github.com/chef/supermarket","homepage":"https://supermarket.chef.io/","size":6141,"stargazers_count":146,"watchers_count":146,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":58,"mirror_url":null,"open_issues_count":52,"forks":58,"open_issues":52,"watchers":146,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/supermarket/pulls/1270"},"html":{"href":"https://github.com/chef/supermarket/pull/1270"},"issue":{"href":"https://api.github.com/repos/chef/supermarket/issues/1270"},"comments":{"href":"https://api.github.com/repos/chef/supermarket/issues/1270/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/supermarket/pulls/1270/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/supermarket/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/supermarket/pulls/1270/commits"},"statuses":{"href":"https://api.github.com/repos/chef/supermarket/statuses/5db18cf402582423d6a17032b0eea0cfcf2edf76"}}}}