{"action":"created","comment":{"url":"https://api.github.com/repos/juju/charm/pulls/comments/38939265","id":38939265,"diff_hunk":"@@ -151,18 +152,35 @@ func ParseReference(url string) (*Reference, error) {\n }\n \n func parseReference(url string) (*Reference, error) {\n+\t// Check if we're dealing with a v1 or v2 URL.\n+\tu, err := gourl.Parse(url)\n+\tif err != nil {\n+\t\treturn nil, fmt.Errorf(\"entity URL is not a valid url: %s\", url)\n+\t}","path":"url.go","position":16,"original_position":16,"commit_id":"49ed0a2ca89112c91397f5ccbc6f297e41ece26c","original_commit_id":"49ed0a2ca89112c91397f5ccbc6f297e41ece26c","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":"Perhaps:\r\n\r\n     if u.FawQuery != \"\" || u.Fragment != \"\" || u.User != nil {\r\n          return fmt.Errorf(\"entity URL %s has unrecognised parts\", url)\r\n     }\r\n\r\n?\r\n","created_at":"2015-09-08T15:24:53Z","updated_at":"2015-09-08T15:24:53Z","html_url":"https://github.com/juju/charm/pull/148#discussion_r38939265","pull_request_url":"https://api.github.com/repos/juju/charm/pulls/148","_links":{"self":{"href":"https://api.github.com/repos/juju/charm/pulls/comments/38939265"},"html":{"href":"https://github.com/juju/charm/pull/148#discussion_r38939265"},"pull_request":{"href":"https://api.github.com/repos/juju/charm/pulls/148"}}},"pull_request":{"url":"https://api.github.com/repos/juju/charm/pulls/148","id":43662992,"html_url":"https://github.com/juju/charm/pull/148","diff_url":"https://github.com/juju/charm/pull/148.diff","patch_url":"https://github.com/juju/charm/pull/148.patch","issue_url":"https://api.github.com/repos/juju/charm/issues/148","number":148,"state":"open","locked":false,"title":"Resolve fully qualified storefront URLs","user":{"login":"makyo","id":303761,"avatar_url":"https://avatars.githubusercontent.com/u/303761?v=3","gravatar_id":"","url":"https://api.github.com/users/makyo","html_url":"https://github.com/makyo","followers_url":"https://api.github.com/users/makyo/followers","following_url":"https://api.github.com/users/makyo/following{/other_user}","gists_url":"https://api.github.com/users/makyo/gists{/gist_id}","starred_url":"https://api.github.com/users/makyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makyo/subscriptions","organizations_url":"https://api.github.com/users/makyo/orgs","repos_url":"https://api.github.com/users/makyo/repos","events_url":"https://api.github.com/users/makyo/events{/privacy}","received_events_url":"https://api.github.com/users/makyo/received_events","type":"User","site_admin":false},"body":"This allows passing a storefront URL (eg: https://jujucharms.com/u/charmers/mysql/trusty/28 - see url_test.go for permutations) to parseReference.  This is the first step to supporting v2 charm/bundle URLs","created_at":"2015-08-28T19:26:48Z","updated_at":"2015-09-08T15:24:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7473374f8c1e0800e627bb149d55b727009da661","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juju/charm/pulls/148/commits","review_comments_url":"https://api.github.com/repos/juju/charm/pulls/148/comments","review_comment_url":"https://api.github.com/repos/juju/charm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/charm/issues/148/comments","statuses_url":"https://api.github.com/repos/juju/charm/statuses/49ed0a2ca89112c91397f5ccbc6f297e41ece26c","head":{"label":"makyo:resolve-fq-url","ref":"resolve-fq-url","sha":"49ed0a2ca89112c91397f5ccbc6f297e41ece26c","user":{"login":"makyo","id":303761,"avatar_url":"https://avatars.githubusercontent.com/u/303761?v=3","gravatar_id":"","url":"https://api.github.com/users/makyo","html_url":"https://github.com/makyo","followers_url":"https://api.github.com/users/makyo/followers","following_url":"https://api.github.com/users/makyo/following{/other_user}","gists_url":"https://api.github.com/users/makyo/gists{/gist_id}","starred_url":"https://api.github.com/users/makyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makyo/subscriptions","organizations_url":"https://api.github.com/users/makyo/orgs","repos_url":"https://api.github.com/users/makyo/repos","events_url":"https://api.github.com/users/makyo/events{/privacy}","received_events_url":"https://api.github.com/users/makyo/received_events","type":"User","site_admin":false},"repo":{"id":32425378,"name":"charm","full_name":"makyo/charm","owner":{"login":"makyo","id":303761,"avatar_url":"https://avatars.githubusercontent.com/u/303761?v=3","gravatar_id":"","url":"https://api.github.com/users/makyo","html_url":"https://github.com/makyo","followers_url":"https://api.github.com/users/makyo/followers","following_url":"https://api.github.com/users/makyo/following{/other_user}","gists_url":"https://api.github.com/users/makyo/gists{/gist_id}","starred_url":"https://api.github.com/users/makyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makyo/subscriptions","organizations_url":"https://api.github.com/users/makyo/orgs","repos_url":"https://api.github.com/users/makyo/repos","events_url":"https://api.github.com/users/makyo/events{/privacy}","received_events_url":"https://api.github.com/users/makyo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/makyo/charm","description":"Parsing and testing Juju charms","fork":true,"url":"https://api.github.com/repos/makyo/charm","forks_url":"https://api.github.com/repos/makyo/charm/forks","keys_url":"https://api.github.com/repos/makyo/charm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makyo/charm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makyo/charm/teams","hooks_url":"https://api.github.com/repos/makyo/charm/hooks","issue_events_url":"https://api.github.com/repos/makyo/charm/issues/events{/number}","events_url":"https://api.github.com/repos/makyo/charm/events","assignees_url":"https://api.github.com/repos/makyo/charm/assignees{/user}","branches_url":"https://api.github.com/repos/makyo/charm/branches{/branch}","tags_url":"https://api.github.com/repos/makyo/charm/tags","blobs_url":"https://api.github.com/repos/makyo/charm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makyo/charm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makyo/charm/git/refs{/sha}","trees_url":"https://api.github.com/repos/makyo/charm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makyo/charm/statuses/{sha}","languages_url":"https://api.github.com/repos/makyo/charm/languages","stargazers_url":"https://api.github.com/repos/makyo/charm/stargazers","contributors_url":"https://api.github.com/repos/makyo/charm/contributors","subscribers_url":"https://api.github.com/repos/makyo/charm/subscribers","subscription_url":"https://api.github.com/repos/makyo/charm/subscription","commits_url":"https://api.github.com/repos/makyo/charm/commits{/sha}","git_commits_url":"https://api.github.com/repos/makyo/charm/git/commits{/sha}","comments_url":"https://api.github.com/repos/makyo/charm/comments{/number}","issue_comment_url":"https://api.github.com/repos/makyo/charm/issues/comments{/number}","contents_url":"https://api.github.com/repos/makyo/charm/contents/{+path}","compare_url":"https://api.github.com/repos/makyo/charm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makyo/charm/merges","archive_url":"https://api.github.com/repos/makyo/charm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makyo/charm/downloads","issues_url":"https://api.github.com/repos/makyo/charm/issues{/number}","pulls_url":"https://api.github.com/repos/makyo/charm/pulls{/number}","milestones_url":"https://api.github.com/repos/makyo/charm/milestones{/number}","notifications_url":"https://api.github.com/repos/makyo/charm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makyo/charm/labels{/name}","releases_url":"https://api.github.com/repos/makyo/charm/releases{/id}","created_at":"2015-03-17T23:01:04Z","updated_at":"2015-03-17T23:01:05Z","pushed_at":"2015-09-03T21:25:19Z","git_url":"git://github.com/makyo/charm.git","ssh_url":"git@github.com:makyo/charm.git","clone_url":"https://github.com/makyo/charm.git","svn_url":"https://github.com/makyo/charm","homepage":null,"size":966,"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":"v4"}},"base":{"label":"juju:v6-unstable","ref":"v6-unstable","sha":"15a30d22682843bc21a9d1aa2334b144fd3ae0fc","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-05-05T02:00:11Z","pushed_at":"2015-09-03T21:25:20Z","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":1706,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":4,"forks":25,"open_issues":4,"watchers":0,"default_branch":"v5"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/charm/pulls/148"},"html":{"href":"https://github.com/juju/charm/pull/148"},"issue":{"href":"https://api.github.com/repos/juju/charm/issues/148"},"comments":{"href":"https://api.github.com/repos/juju/charm/issues/148/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/charm/pulls/148/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/charm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/charm/pulls/148/commits"},"statuses":{"href":"https://api.github.com/repos/juju/charm/statuses/49ed0a2ca89112c91397f5ccbc6f297e41ece26c"}}}}