{"action":"created","comment":{"url":"https://api.github.com/repos/juju/charm/pulls/comments/26843536","id":26843536,"diff_hunk":"@@ -63,11 +69,65 @@ func NewCharmStore(p NewCharmStoreParams) (Interface, error) {\n \t}, nil\n }\n \n-var notImplemented = errgo.New(\"not implemented\")\n-\n // Get implements Interface.Get.\n func (s *CharmStore) Get(curl *charm.URL) (charm.Charm, error) {\n-\treturn nil, notImplemented\n+\t// Disable bundle deployment.\n+\tif curl.Series == \"bundle\" {\n+\t\treturn nil, errgo.Newf(\"expected a charm URL, got bundle URL %q\", curl)\n+\t}\n+\n+\t// Prepare the cache directory and retrieve the charm.\n+\tif err := os.MkdirAll(s.cacheDir, os.FileMode(0755)); err != nil {\n+\t\treturn nil, errgo.Notef(err, \"cannot create the cache directory\")\n+\t}\n+\tr, id, expectHash, _, err := s.client.GetArchive(curl.Reference())","path":"charmrepo/charmstore.go","position":43,"original_position":43,"commit_id":"4240264219168785c6b3c0bc90046737c21b0f32","original_commit_id":"4240264219168785c6b3c0bc90046737c21b0f32","user":{"login":"rogpeppe","id":66491,"avatar_url":"https://avatars.githubusercontent.com/u/66491?v=3","gravatar_id":"","url":"https://api.github.com/users/rogpeppe","html_url":"https://github.com/rogpeppe","followers_url":"https://api.github.com/users/rogpeppe/followers","following_url":"https://api.github.com/users/rogpeppe/following{/other_user}","gists_url":"https://api.github.com/users/rogpeppe/gists{/gist_id}","starred_url":"https://api.github.com/users/rogpeppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogpeppe/subscriptions","organizations_url":"https://api.github.com/users/rogpeppe/orgs","repos_url":"https://api.github.com/users/rogpeppe/repos","events_url":"https://api.github.com/users/rogpeppe/events{/privacy}","received_events_url":"https://api.github.com/users/rogpeppe/received_events","type":"User","site_admin":false},"body":"I think you should use the size here and check that the number of bytes returned by io.Copy is as expected. An error message that says there's a size mismatch, giving expected and actual sizes, is going to be much more accessible than a hash mismatch message (which of course needs to be done too).","created_at":"2015-03-20T14:33:54Z","updated_at":"2015-03-20T14:33:54Z","html_url":"https://github.com/juju/charm/pull/97#discussion_r26843536","pull_request_url":"https://api.github.com/repos/juju/charm/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/juju/charm/pulls/comments/26843536"},"html":{"href":"https://github.com/juju/charm/pull/97#discussion_r26843536"},"pull_request":{"href":"https://api.github.com/repos/juju/charm/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/juju/charm/pulls/97","id":31617744,"html_url":"https://github.com/juju/charm/pull/97","diff_url":"https://github.com/juju/charm/pull/97.diff","patch_url":"https://github.com/juju/charm/pull/97.patch","issue_url":"https://api.github.com/repos/juju/charm/issues/97","number":97,"state":"open","locked":false,"title":"Implement CharmStore.Get.","user":{"login":"frankban","id":1408172,"avatar_url":"https://avatars.githubusercontent.com/u/1408172?v=3","gravatar_id":"","url":"https://api.github.com/users/frankban","html_url":"https://github.com/frankban","followers_url":"https://api.github.com/users/frankban/followers","following_url":"https://api.github.com/users/frankban/following{/other_user}","gists_url":"https://api.github.com/users/frankban/gists{/gist_id}","starred_url":"https://api.github.com/users/frankban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankban/subscriptions","organizations_url":"https://api.github.com/users/frankban/orgs","repos_url":"https://api.github.com/users/frankban/repos","events_url":"https://api.github.com/users/frankban/events{/privacy}","received_events_url":"https://api.github.com/users/frankban/received_events","type":"User","site_admin":false},"body":"CharmStore.Get is used to retrieve a charm\r\nfrom the charm store.","created_at":"2015-03-20T14:24:56Z","updated_at":"2015-03-20T14:33:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22574ab659a12f201e6785d990ba0661ba4a2177","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juju/charm/pulls/97/commits","review_comments_url":"https://api.github.com/repos/juju/charm/pulls/97/comments","review_comment_url":"https://api.github.com/repos/juju/charm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/charm/issues/97/comments","statuses_url":"https://api.github.com/repos/juju/charm/statuses/4240264219168785c6b3c0bc90046737c21b0f32","head":{"label":"frankban:implement-get","ref":"implement-get","sha":"4240264219168785c6b3c0bc90046737c21b0f32","user":{"login":"frankban","id":1408172,"avatar_url":"https://avatars.githubusercontent.com/u/1408172?v=3","gravatar_id":"","url":"https://api.github.com/users/frankban","html_url":"https://github.com/frankban","followers_url":"https://api.github.com/users/frankban/followers","following_url":"https://api.github.com/users/frankban/following{/other_user}","gists_url":"https://api.github.com/users/frankban/gists{/gist_id}","starred_url":"https://api.github.com/users/frankban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankban/subscriptions","organizations_url":"https://api.github.com/users/frankban/orgs","repos_url":"https://api.github.com/users/frankban/repos","events_url":"https://api.github.com/users/frankban/events{/privacy}","received_events_url":"https://api.github.com/users/frankban/received_events","type":"User","site_admin":false},"repo":{"id":20724275,"name":"juju-charm","full_name":"frankban/juju-charm","owner":{"login":"frankban","id":1408172,"avatar_url":"https://avatars.githubusercontent.com/u/1408172?v=3","gravatar_id":"","url":"https://api.github.com/users/frankban","html_url":"https://github.com/frankban","followers_url":"https://api.github.com/users/frankban/followers","following_url":"https://api.github.com/users/frankban/following{/other_user}","gists_url":"https://api.github.com/users/frankban/gists{/gist_id}","starred_url":"https://api.github.com/users/frankban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankban/subscriptions","organizations_url":"https://api.github.com/users/frankban/orgs","repos_url":"https://api.github.com/users/frankban/repos","events_url":"https://api.github.com/users/frankban/events{/privacy}","received_events_url":"https://api.github.com/users/frankban/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frankban/juju-charm","description":"Parsing and testing Juju charms","fork":true,"url":"https://api.github.com/repos/frankban/juju-charm","forks_url":"https://api.github.com/repos/frankban/juju-charm/forks","keys_url":"https://api.github.com/repos/frankban/juju-charm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frankban/juju-charm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frankban/juju-charm/teams","hooks_url":"https://api.github.com/repos/frankban/juju-charm/hooks","issue_events_url":"https://api.github.com/repos/frankban/juju-charm/issues/events{/number}","events_url":"https://api.github.com/repos/frankban/juju-charm/events","assignees_url":"https://api.github.com/repos/frankban/juju-charm/assignees{/user}","branches_url":"https://api.github.com/repos/frankban/juju-charm/branches{/branch}","tags_url":"https://api.github.com/repos/frankban/juju-charm/tags","blobs_url":"https://api.github.com/repos/frankban/juju-charm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frankban/juju-charm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frankban/juju-charm/git/refs{/sha}","trees_url":"https://api.github.com/repos/frankban/juju-charm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frankban/juju-charm/statuses/{sha}","languages_url":"https://api.github.com/repos/frankban/juju-charm/languages","stargazers_url":"https://api.github.com/repos/frankban/juju-charm/stargazers","contributors_url":"https://api.github.com/repos/frankban/juju-charm/contributors","subscribers_url":"https://api.github.com/repos/frankban/juju-charm/subscribers","subscription_url":"https://api.github.com/repos/frankban/juju-charm/subscription","commits_url":"https://api.github.com/repos/frankban/juju-charm/commits{/sha}","git_commits_url":"https://api.github.com/repos/frankban/juju-charm/git/commits{/sha}","comments_url":"https://api.github.com/repos/frankban/juju-charm/comments{/number}","issue_comment_url":"https://api.github.com/repos/frankban/juju-charm/issues/comments{/number}","contents_url":"https://api.github.com/repos/frankban/juju-charm/contents/{+path}","compare_url":"https://api.github.com/repos/frankban/juju-charm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frankban/juju-charm/merges","archive_url":"https://api.github.com/repos/frankban/juju-charm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frankban/juju-charm/downloads","issues_url":"https://api.github.com/repos/frankban/juju-charm/issues{/number}","pulls_url":"https://api.github.com/repos/frankban/juju-charm/pulls{/number}","milestones_url":"https://api.github.com/repos/frankban/juju-charm/milestones{/number}","notifications_url":"https://api.github.com/repos/frankban/juju-charm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frankban/juju-charm/labels{/name}","releases_url":"https://api.github.com/repos/frankban/juju-charm/releases{/id}","created_at":"2014-06-11T12:30:44Z","updated_at":"2015-03-18T10:53:41Z","pushed_at":"2015-03-20T14:23:29Z","git_url":"git://github.com/frankban/juju-charm.git","ssh_url":"git@github.com:frankban/juju-charm.git","clone_url":"https://github.com/frankban/juju-charm.git","svn_url":"https://github.com/frankban/juju-charm","homepage":null,"size":1028,"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":"master"}},"base":{"label":"juju:v5-unstable","ref":"v5-unstable","sha":"f6e7b8f62ac428425100685d080e932099a08147","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":20692246,"name":"charm","full_name":"juju/charm","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/charm","description":"Parsing and testing Juju charms","fork":false,"url":"https://api.github.com/repos/juju/charm","forks_url":"https://api.github.com/repos/juju/charm/forks","keys_url":"https://api.github.com/repos/juju/charm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju/charm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju/charm/teams","hooks_url":"https://api.github.com/repos/juju/charm/hooks","issue_events_url":"https://api.github.com/repos/juju/charm/issues/events{/number}","events_url":"https://api.github.com/repos/juju/charm/events","assignees_url":"https://api.github.com/repos/juju/charm/assignees{/user}","branches_url":"https://api.github.com/repos/juju/charm/branches{/branch}","tags_url":"https://api.github.com/repos/juju/charm/tags","blobs_url":"https://api.github.com/repos/juju/charm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju/charm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju/charm/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju/charm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju/charm/statuses/{sha}","languages_url":"https://api.github.com/repos/juju/charm/languages","stargazers_url":"https://api.github.com/repos/juju/charm/stargazers","contributors_url":"https://api.github.com/repos/juju/charm/contributors","subscribers_url":"https://api.github.com/repos/juju/charm/subscribers","subscription_url":"https://api.github.com/repos/juju/charm/subscription","commits_url":"https://api.github.com/repos/juju/charm/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju/charm/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju/charm/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju/charm/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju/charm/contents/{+path}","compare_url":"https://api.github.com/repos/juju/charm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju/charm/merges","archive_url":"https://api.github.com/repos/juju/charm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju/charm/downloads","issues_url":"https://api.github.com/repos/juju/charm/issues{/number}","pulls_url":"https://api.github.com/repos/juju/charm/pulls{/number}","milestones_url":"https://api.github.com/repos/juju/charm/milestones{/number}","notifications_url":"https://api.github.com/repos/juju/charm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju/charm/labels{/name}","releases_url":"https://api.github.com/repos/juju/charm/releases{/id}","created_at":"2014-06-10T16:11:32Z","updated_at":"2015-03-12T18:03:33Z","pushed_at":"2015-03-20T14:24:57Z","git_url":"git://github.com/juju/charm.git","ssh_url":"git@github.com:juju/charm.git","clone_url":"https://github.com/juju/charm.git","svn_url":"https://github.com/juju/charm","homepage":null,"size":1415,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":5,"forks":21,"open_issues":5,"watchers":0,"default_branch":"v4"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/charm/pulls/97"},"html":{"href":"https://github.com/juju/charm/pull/97"},"issue":{"href":"https://api.github.com/repos/juju/charm/issues/97"},"comments":{"href":"https://api.github.com/repos/juju/charm/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/charm/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/charm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/charm/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/juju/charm/statuses/4240264219168785c6b3c0bc90046737c21b0f32"}}}}