{"action":"created","comment":{"url":"https://api.github.com/repos/juju/charmstore/pulls/comments/57784470","id":57784470,"diff_hunk":"@@ -0,0 +1,255 @@\n+// Copyright 2016 Canonical Ltd.\n+// Licensed under the AGPLv3, see LICENCE file for details.\n+\n+package charmstore // import \"gopkg.in/juju/charmstore.v5-unstable/internal/charmstore\"\n+\n+import (\n+\t\"io\"\n+\t\"time\"\n+\n+\t\"gopkg.in/errgo.v1\"\n+\t\"gopkg.in/juju/charm.v6-unstable\"\n+\t\"gopkg.in/juju/charmrepo.v2-unstable/csclient/params\"\n+\t\"gopkg.in/mgo.v2\"\n+\t\"gopkg.in/mgo.v2/bson\"\n+\n+\t\"gopkg.in/juju/charmstore.v5-unstable/internal/mongodoc\"\n+)\n+\n+var resourceNotFound = errgo.Newf(\"resource not found\")\n+\n+// ListResources returns the list of resources for the charm at the\n+// latest revision for each resource.\n+func (s Store) ListResources(entity *mongodoc.Entity, channel params.Channel) ([]*mongodoc.Resource, error) {\n+\tif entity.URL.Series == \"bundle\" {\n+\t\treturn nil, errgo.Newf(\"bundles do not have resources\")","path":"internal/charmstore/resources.go","position":25,"original_position":25,"commit_id":"f1091d9a5cc41005e6de06598305819ec9be4f3f","original_commit_id":"f1091d9a5cc41005e6de06598305819ec9be4f3f","user":{"login":"natefinch","id":3185864,"avatar_url":"https://avatars.githubusercontent.com/u/3185864?v=3","gravatar_id":"","url":"https://api.github.com/users/natefinch","html_url":"https://github.com/natefinch","followers_url":"https://api.github.com/users/natefinch/followers","following_url":"https://api.github.com/users/natefinch/following{/other_user}","gists_url":"https://api.github.com/users/natefinch/gists{/gist_id}","starred_url":"https://api.github.com/users/natefinch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natefinch/subscriptions","organizations_url":"https://api.github.com/users/natefinch/orgs","repos_url":"https://api.github.com/users/natefinch/repos","events_url":"https://api.github.com/users/natefinch/events{/privacy}","received_events_url":"https://api.github.com/users/natefinch/received_events","type":"User","site_admin":false},"body":"check with roger et. al. on this, but I think he mentioned that we should just return nothing for bundles, not an error.","created_at":"2016-03-29T19:24:21Z","updated_at":"2016-03-29T19:24:21Z","html_url":"https://github.com/juju/charmstore/pull/583#discussion_r57784470","pull_request_url":"https://api.github.com/repos/juju/charmstore/pulls/583","_links":{"self":{"href":"https://api.github.com/repos/juju/charmstore/pulls/comments/57784470"},"html":{"href":"https://github.com/juju/charmstore/pull/583#discussion_r57784470"},"pull_request":{"href":"https://api.github.com/repos/juju/charmstore/pulls/583"}}},"pull_request":{"url":"https://api.github.com/repos/juju/charmstore/pulls/583","id":64115844,"html_url":"https://github.com/juju/charmstore/pull/583","diff_url":"https://github.com/juju/charmstore/pull/583.diff","patch_url":"https://github.com/juju/charmstore/pull/583.patch","issue_url":"https://api.github.com/repos/juju/charmstore/issues/583","number":583,"state":"open","locked":false,"title":"Add Store.ListResources().","user":{"login":"ericsnowcurrently","id":1152074,"avatar_url":"https://avatars.githubusercontent.com/u/1152074?v=3","gravatar_id":"","url":"https://api.github.com/users/ericsnowcurrently","html_url":"https://github.com/ericsnowcurrently","followers_url":"https://api.github.com/users/ericsnowcurrently/followers","following_url":"https://api.github.com/users/ericsnowcurrently/following{/other_user}","gists_url":"https://api.github.com/users/ericsnowcurrently/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsnowcurrently/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsnowcurrently/subscriptions","organizations_url":"https://api.github.com/users/ericsnowcurrently/orgs","repos_url":"https://api.github.com/users/ericsnowcurrently/repos","events_url":"https://api.github.com/users/ericsnowcurrently/events{/privacy}","received_events_url":"https://api.github.com/users/ericsnowcurrently/received_events","type":"User","site_admin":false},"body":"This patch also sets the stage for adding the other resource-related methods.\r\n\r\nNote: This PR is based on another (#580).","created_at":"2016-03-24T23:55:00Z","updated_at":"2016-03-29T19:24:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"732ad33c09c628b62406e95dd980291d2cb81c22","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juju/charmstore/pulls/583/commits","review_comments_url":"https://api.github.com/repos/juju/charmstore/pulls/583/comments","review_comment_url":"https://api.github.com/repos/juju/charmstore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/charmstore/issues/583/comments","statuses_url":"https://api.github.com/repos/juju/charmstore/statuses/f1091d9a5cc41005e6de06598305819ec9be4f3f","head":{"label":"ericsnowcurrently:resources-store-methods-list","ref":"resources-store-methods-list","sha":"f1091d9a5cc41005e6de06598305819ec9be4f3f","user":{"login":"ericsnowcurrently","id":1152074,"avatar_url":"https://avatars.githubusercontent.com/u/1152074?v=3","gravatar_id":"","url":"https://api.github.com/users/ericsnowcurrently","html_url":"https://github.com/ericsnowcurrently","followers_url":"https://api.github.com/users/ericsnowcurrently/followers","following_url":"https://api.github.com/users/ericsnowcurrently/following{/other_user}","gists_url":"https://api.github.com/users/ericsnowcurrently/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsnowcurrently/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsnowcurrently/subscriptions","organizations_url":"https://api.github.com/users/ericsnowcurrently/orgs","repos_url":"https://api.github.com/users/ericsnowcurrently/repos","events_url":"https://api.github.com/users/ericsnowcurrently/events{/privacy}","received_events_url":"https://api.github.com/users/ericsnowcurrently/received_events","type":"User","site_admin":false},"repo":{"id":48457553,"name":"juju-charmstore","full_name":"ericsnowcurrently/juju-charmstore","owner":{"login":"ericsnowcurrently","id":1152074,"avatar_url":"https://avatars.githubusercontent.com/u/1152074?v=3","gravatar_id":"","url":"https://api.github.com/users/ericsnowcurrently","html_url":"https://github.com/ericsnowcurrently","followers_url":"https://api.github.com/users/ericsnowcurrently/followers","following_url":"https://api.github.com/users/ericsnowcurrently/following{/other_user}","gists_url":"https://api.github.com/users/ericsnowcurrently/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsnowcurrently/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsnowcurrently/subscriptions","organizations_url":"https://api.github.com/users/ericsnowcurrently/orgs","repos_url":"https://api.github.com/users/ericsnowcurrently/repos","events_url":"https://api.github.com/users/ericsnowcurrently/events{/privacy}","received_events_url":"https://api.github.com/users/ericsnowcurrently/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericsnowcurrently/juju-charmstore","description":"The charm store server.","fork":true,"url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore","forks_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/forks","keys_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/teams","hooks_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/hooks","issue_events_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/issues/events{/number}","events_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/events","assignees_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/assignees{/user}","branches_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/branches{/branch}","tags_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/tags","blobs_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/statuses/{sha}","languages_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/languages","stargazers_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/stargazers","contributors_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/contributors","subscribers_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/subscribers","subscription_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/subscription","commits_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/contents/{+path}","compare_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/merges","archive_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/downloads","issues_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/issues{/number}","pulls_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/pulls{/number}","milestones_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/milestones{/number}","notifications_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/labels{/name}","releases_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/releases{/id}","deployments_url":"https://api.github.com/repos/ericsnowcurrently/juju-charmstore/deployments","created_at":"2015-12-22T22:44:52Z","updated_at":"2016-03-01T18:37:24Z","pushed_at":"2016-03-29T16:22:36Z","git_url":"git://github.com/ericsnowcurrently/juju-charmstore.git","ssh_url":"git@github.com:ericsnowcurrently/juju-charmstore.git","clone_url":"https://github.com/ericsnowcurrently/juju-charmstore.git","svn_url":"https://github.com/ericsnowcurrently/juju-charmstore","homepage":null,"size":4279,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"v5-unstable"}},"base":{"label":"juju:v5-unstable","ref":"v5-unstable","sha":"dab0340f56958cb5f5ca007e9d15d4f3b1b1b3cb","user":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=3","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"repo":{"id":20720417,"name":"charmstore","full_name":"juju/charmstore","owner":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=3","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juju/charmstore","description":"The charm store server.","fork":false,"url":"https://api.github.com/repos/juju/charmstore","forks_url":"https://api.github.com/repos/juju/charmstore/forks","keys_url":"https://api.github.com/repos/juju/charmstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju/charmstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju/charmstore/teams","hooks_url":"https://api.github.com/repos/juju/charmstore/hooks","issue_events_url":"https://api.github.com/repos/juju/charmstore/issues/events{/number}","events_url":"https://api.github.com/repos/juju/charmstore/events","assignees_url":"https://api.github.com/repos/juju/charmstore/assignees{/user}","branches_url":"https://api.github.com/repos/juju/charmstore/branches{/branch}","tags_url":"https://api.github.com/repos/juju/charmstore/tags","blobs_url":"https://api.github.com/repos/juju/charmstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju/charmstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju/charmstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju/charmstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju/charmstore/statuses/{sha}","languages_url":"https://api.github.com/repos/juju/charmstore/languages","stargazers_url":"https://api.github.com/repos/juju/charmstore/stargazers","contributors_url":"https://api.github.com/repos/juju/charmstore/contributors","subscribers_url":"https://api.github.com/repos/juju/charmstore/subscribers","subscription_url":"https://api.github.com/repos/juju/charmstore/subscription","commits_url":"https://api.github.com/repos/juju/charmstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju/charmstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju/charmstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju/charmstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju/charmstore/contents/{+path}","compare_url":"https://api.github.com/repos/juju/charmstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju/charmstore/merges","archive_url":"https://api.github.com/repos/juju/charmstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju/charmstore/downloads","issues_url":"https://api.github.com/repos/juju/charmstore/issues{/number}","pulls_url":"https://api.github.com/repos/juju/charmstore/pulls{/number}","milestones_url":"https://api.github.com/repos/juju/charmstore/milestones{/number}","notifications_url":"https://api.github.com/repos/juju/charmstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju/charmstore/labels{/name}","releases_url":"https://api.github.com/repos/juju/charmstore/releases{/id}","deployments_url":"https://api.github.com/repos/juju/charmstore/deployments","created_at":"2014-06-11T09:53:37Z","updated_at":"2016-01-11T17:48:35Z","pushed_at":"2016-03-24T23:56:12Z","git_url":"git://github.com/juju/charmstore.git","ssh_url":"git@github.com:juju/charmstore.git","clone_url":"https://github.com/juju/charmstore.git","svn_url":"https://github.com/juju/charmstore","homepage":null,"size":5918,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":27,"forks":20,"open_issues":27,"watchers":7,"default_branch":"v5-unstable"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/charmstore/pulls/583"},"html":{"href":"https://github.com/juju/charmstore/pull/583"},"issue":{"href":"https://api.github.com/repos/juju/charmstore/issues/583"},"comments":{"href":"https://api.github.com/repos/juju/charmstore/issues/583/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/charmstore/pulls/583/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/charmstore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/charmstore/pulls/583/commits"},"statuses":{"href":"https://api.github.com/repos/juju/charmstore/statuses/f1091d9a5cc41005e6de06598305819ec9be4f3f"}}}}