{"action":"created","comment":{"url":"https://api.github.com/repos/yarnpkg/yarn/pulls/comments/142988403","pull_request_review_id":67433527,"id":142988403,"diff_hunk":"@@ -7,6 +7,20 @@ export default class BitbucketResolver extends HostedGitResolver {\n   static hostname = 'bitbucket.org';\n   static protocol = 'bitbucket';\n \n+  static isVersion(pattern: string): boolean {\n+    // bitbucket proto\n+    if (pattern.startsWith('bitbucket:')) {\n+      return true;\n+    }\n+\n+    // bitbucket shorthand\n+    if (/^[^:@%/\\s.-][^:@%/\\s]*[/][^:@\\s/%]+(?:#.*)?$/.test(pattern)) {","path":"src/resolvers/exotics/bitbucket-resolver.js","position":11,"original_position":11,"commit_id":"23e9fddb2d728395c060fbea11ba19efc8650e7e","original_commit_id":"23e9fddb2d728395c060fbea11ba19efc8650e7e","user":{"login":"BYK","id":126780,"avatar_url":"https://avatars3.githubusercontent.com/u/126780?v=4","gravatar_id":"","url":"https://api.github.com/users/BYK","html_url":"https://github.com/BYK","followers_url":"https://api.github.com/users/BYK/followers","following_url":"https://api.github.com/users/BYK/following{/other_user}","gists_url":"https://api.github.com/users/BYK/gists{/gist_id}","starred_url":"https://api.github.com/users/BYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BYK/subscriptions","organizations_url":"https://api.github.com/users/BYK/orgs","repos_url":"https://api.github.com/users/BYK/repos","events_url":"https://api.github.com/users/BYK/events{/privacy}","received_events_url":"https://api.github.com/users/BYK/received_events","type":"User","site_admin":false},"body":"Can you move this outside of the function, make it ` const` and add some comments about this regular expression? It is not apparent what it is doing for someone not familiar with bitbucket.","created_at":"2017-10-05T16:25:20Z","updated_at":"2017-10-05T16:30:49Z","html_url":"https://github.com/yarnpkg/yarn/pull/4633#discussion_r142988403","pull_request_url":"https://api.github.com/repos/yarnpkg/yarn/pulls/4633","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/comments/142988403"},"html":{"href":"https://github.com/yarnpkg/yarn/pull/4633#discussion_r142988403"},"pull_request":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/4633"}}},"pull_request":{"url":"https://api.github.com/repos/yarnpkg/yarn/pulls/4633","id":144784470,"html_url":"https://github.com/yarnpkg/yarn/pull/4633","diff_url":"https://github.com/yarnpkg/yarn/pull/4633.diff","patch_url":"https://github.com/yarnpkg/yarn/pull/4633.patch","issue_url":"https://api.github.com/repos/yarnpkg/yarn/issues/4633","number":4633,"state":"open","locked":false,"title":"Fix exotic shortcut resolvers with private repositories","user":{"login":"bertho-zero","id":8525267,"avatar_url":"https://avatars0.githubusercontent.com/u/8525267?v=4","gravatar_id":"","url":"https://api.github.com/users/bertho-zero","html_url":"https://github.com/bertho-zero","followers_url":"https://api.github.com/users/bertho-zero/followers","following_url":"https://api.github.com/users/bertho-zero/following{/other_user}","gists_url":"https://api.github.com/users/bertho-zero/gists{/gist_id}","starred_url":"https://api.github.com/users/bertho-zero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertho-zero/subscriptions","organizations_url":"https://api.github.com/users/bertho-zero/orgs","repos_url":"https://api.github.com/users/bertho-zero/repos","events_url":"https://api.github.com/users/bertho-zero/events{/privacy}","received_events_url":"https://api.github.com/users/bertho-zero/received_events","type":"User","site_admin":false},"body":"<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->\r\n\r\n**Summary**\r\n\r\n* fix hasHTTPCapability issue with bitbucket shortcut resolver and private repo (#4393)\r\n  *bug with a private repo that used like `\"module\": \"bitbucket:team/repo\"`*\r\n* fix setRefRemote issue with exotic shortcut resolvers and branch/tag/commit\r\n  *bug with a repo that used like `\"module\": \"bitbucket:team/repo#tag\"`*\r\n\r\n<!-- Is the feature a substantial feature request? Please use https://github.com/yarnpkg/rfcs -->\r\n\r\n<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->\r\n\r\n**Test plan**\r\n\r\nIf I have a private dependency like `\"activities\": \"bitbucket:openagenda/activities\"` in my package.json, and I run `yarn install --verbose` then I have this error:\r\n\r\n```\r\n[1/4] Resolving packages...\r\nverbose 0.407 Performing \"HEAD\" request to \"https://bitbucket.org/openagenda/es-node\".\r\nverbose 0.867 Request \"https://bitbucket.org/openagenda/es-node\" finished with status code 302.\r\nverbose 0.873 Performing \"GET\" request to \"https://bitbucket.org/openagenda/es-node.git/info/refs?service=git-upload-pack\".\r\nverbose 0.98 Request \"https://bitbucket.org/openagenda/es-node.git/info/refs?service=git-upload-pack\" finished with status code 401.\r\nverbose 0.981 Error: Error connecting to repository. Please, check the url.\r\n    at /home/bertho/.config/yarn/global/node_modules/yarn/lib/cli.js:33269:15\r\n    at Generator.next (<anonymous>)\r\n    at step (/home/bertho/.config/yarn/global/node_modules/yarn/lib/cli.js:92:30)\r\n    at /home/bertho/.config/yarn/global/node_modules/yarn/lib/cli.js:103:13\r\n    at process._tickCallback (internal/process/next_tick.js:109:7)\r\nerror An unexpected error occurred: \"Error connecting to repository. Please, check the url.\".\r\ninfo If you think this is a bug, please open a bug report with the information provided in \"/home/bertho/OpenAgenda/cibul-node/yarn-error.log\".\r\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\r\n```\r\n\r\n<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->\r\n","created_at":"2017-10-04T21:50:26Z","updated_at":"2017-10-05T16:30:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96607869529606400f02e476448e16f608eb067f","assignee":{"login":"BYK","id":126780,"avatar_url":"https://avatars3.githubusercontent.com/u/126780?v=4","gravatar_id":"","url":"https://api.github.com/users/BYK","html_url":"https://github.com/BYK","followers_url":"https://api.github.com/users/BYK/followers","following_url":"https://api.github.com/users/BYK/following{/other_user}","gists_url":"https://api.github.com/users/BYK/gists{/gist_id}","starred_url":"https://api.github.com/users/BYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BYK/subscriptions","organizations_url":"https://api.github.com/users/BYK/orgs","repos_url":"https://api.github.com/users/BYK/repos","events_url":"https://api.github.com/users/BYK/events{/privacy}","received_events_url":"https://api.github.com/users/BYK/received_events","type":"User","site_admin":false},"assignees":[{"login":"BYK","id":126780,"avatar_url":"https://avatars3.githubusercontent.com/u/126780?v=4","gravatar_id":"","url":"https://api.github.com/users/BYK","html_url":"https://github.com/BYK","followers_url":"https://api.github.com/users/BYK/followers","following_url":"https://api.github.com/users/BYK/following{/other_user}","gists_url":"https://api.github.com/users/BYK/gists{/gist_id}","starred_url":"https://api.github.com/users/BYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BYK/subscriptions","organizations_url":"https://api.github.com/users/BYK/orgs","repos_url":"https://api.github.com/users/BYK/repos","events_url":"https://api.github.com/users/BYK/events{/privacy}","received_events_url":"https://api.github.com/users/BYK/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/yarnpkg/yarn/pulls/4633/commits","review_comments_url":"https://api.github.com/repos/yarnpkg/yarn/pulls/4633/comments","review_comment_url":"https://api.github.com/repos/yarnpkg/yarn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yarnpkg/yarn/issues/4633/comments","statuses_url":"https://api.github.com/repos/yarnpkg/yarn/statuses/23e9fddb2d728395c060fbea11ba19efc8650e7e","head":{"label":"bertho-zero:master","ref":"master","sha":"23e9fddb2d728395c060fbea11ba19efc8650e7e","user":{"login":"bertho-zero","id":8525267,"avatar_url":"https://avatars0.githubusercontent.com/u/8525267?v=4","gravatar_id":"","url":"https://api.github.com/users/bertho-zero","html_url":"https://github.com/bertho-zero","followers_url":"https://api.github.com/users/bertho-zero/followers","following_url":"https://api.github.com/users/bertho-zero/following{/other_user}","gists_url":"https://api.github.com/users/bertho-zero/gists{/gist_id}","starred_url":"https://api.github.com/users/bertho-zero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertho-zero/subscriptions","organizations_url":"https://api.github.com/users/bertho-zero/orgs","repos_url":"https://api.github.com/users/bertho-zero/repos","events_url":"https://api.github.com/users/bertho-zero/events{/privacy}","received_events_url":"https://api.github.com/users/bertho-zero/received_events","type":"User","site_admin":false},"repo":{"id":105820969,"name":"yarn","full_name":"bertho-zero/yarn","owner":{"login":"bertho-zero","id":8525267,"avatar_url":"https://avatars0.githubusercontent.com/u/8525267?v=4","gravatar_id":"","url":"https://api.github.com/users/bertho-zero","html_url":"https://github.com/bertho-zero","followers_url":"https://api.github.com/users/bertho-zero/followers","following_url":"https://api.github.com/users/bertho-zero/following{/other_user}","gists_url":"https://api.github.com/users/bertho-zero/gists{/gist_id}","starred_url":"https://api.github.com/users/bertho-zero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertho-zero/subscriptions","organizations_url":"https://api.github.com/users/bertho-zero/orgs","repos_url":"https://api.github.com/users/bertho-zero/repos","events_url":"https://api.github.com/users/bertho-zero/events{/privacy}","received_events_url":"https://api.github.com/users/bertho-zero/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bertho-zero/yarn","description":"📦🐈 Fast, reliable, and secure dependency management.","fork":true,"url":"https://api.github.com/repos/bertho-zero/yarn","forks_url":"https://api.github.com/repos/bertho-zero/yarn/forks","keys_url":"https://api.github.com/repos/bertho-zero/yarn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bertho-zero/yarn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bertho-zero/yarn/teams","hooks_url":"https://api.github.com/repos/bertho-zero/yarn/hooks","issue_events_url":"https://api.github.com/repos/bertho-zero/yarn/issues/events{/number}","events_url":"https://api.github.com/repos/bertho-zero/yarn/events","assignees_url":"https://api.github.com/repos/bertho-zero/yarn/assignees{/user}","branches_url":"https://api.github.com/repos/bertho-zero/yarn/branches{/branch}","tags_url":"https://api.github.com/repos/bertho-zero/yarn/tags","blobs_url":"https://api.github.com/repos/bertho-zero/yarn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bertho-zero/yarn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bertho-zero/yarn/git/refs{/sha}","trees_url":"https://api.github.com/repos/bertho-zero/yarn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bertho-zero/yarn/statuses/{sha}","languages_url":"https://api.github.com/repos/bertho-zero/yarn/languages","stargazers_url":"https://api.github.com/repos/bertho-zero/yarn/stargazers","contributors_url":"https://api.github.com/repos/bertho-zero/yarn/contributors","subscribers_url":"https://api.github.com/repos/bertho-zero/yarn/subscribers","subscription_url":"https://api.github.com/repos/bertho-zero/yarn/subscription","commits_url":"https://api.github.com/repos/bertho-zero/yarn/commits{/sha}","git_commits_url":"https://api.github.com/repos/bertho-zero/yarn/git/commits{/sha}","comments_url":"https://api.github.com/repos/bertho-zero/yarn/comments{/number}","issue_comment_url":"https://api.github.com/repos/bertho-zero/yarn/issues/comments{/number}","contents_url":"https://api.github.com/repos/bertho-zero/yarn/contents/{+path}","compare_url":"https://api.github.com/repos/bertho-zero/yarn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bertho-zero/yarn/merges","archive_url":"https://api.github.com/repos/bertho-zero/yarn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bertho-zero/yarn/downloads","issues_url":"https://api.github.com/repos/bertho-zero/yarn/issues{/number}","pulls_url":"https://api.github.com/repos/bertho-zero/yarn/pulls{/number}","milestones_url":"https://api.github.com/repos/bertho-zero/yarn/milestones{/number}","notifications_url":"https://api.github.com/repos/bertho-zero/yarn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bertho-zero/yarn/labels{/name}","releases_url":"https://api.github.com/repos/bertho-zero/yarn/releases{/id}","deployments_url":"https://api.github.com/repos/bertho-zero/yarn/deployments","created_at":"2017-10-04T21:36:13Z","updated_at":"2017-10-04T21:36:19Z","pushed_at":"2017-10-04T22:51:38Z","git_url":"git://github.com/bertho-zero/yarn.git","ssh_url":"git@github.com:bertho-zero/yarn.git","clone_url":"https://github.com/bertho-zero/yarn.git","svn_url":"https://github.com/bertho-zero/yarn","homepage":"https://yarnpkg.com","size":112790,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"yarnpkg:master","ref":"master","sha":"3178e076d4314849a50e0bf4d7619f3cd2904356","user":{"login":"yarnpkg","id":22247014,"avatar_url":"https://avatars3.githubusercontent.com/u/22247014?v=4","gravatar_id":"","url":"https://api.github.com/users/yarnpkg","html_url":"https://github.com/yarnpkg","followers_url":"https://api.github.com/users/yarnpkg/followers","following_url":"https://api.github.com/users/yarnpkg/following{/other_user}","gists_url":"https://api.github.com/users/yarnpkg/gists{/gist_id}","starred_url":"https://api.github.com/users/yarnpkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarnpkg/subscriptions","organizations_url":"https://api.github.com/users/yarnpkg/orgs","repos_url":"https://api.github.com/users/yarnpkg/repos","events_url":"https://api.github.com/users/yarnpkg/events{/privacy}","received_events_url":"https://api.github.com/users/yarnpkg/received_events","type":"Organization","site_admin":false},"repo":{"id":49970642,"name":"yarn","full_name":"yarnpkg/yarn","owner":{"login":"yarnpkg","id":22247014,"avatar_url":"https://avatars3.githubusercontent.com/u/22247014?v=4","gravatar_id":"","url":"https://api.github.com/users/yarnpkg","html_url":"https://github.com/yarnpkg","followers_url":"https://api.github.com/users/yarnpkg/followers","following_url":"https://api.github.com/users/yarnpkg/following{/other_user}","gists_url":"https://api.github.com/users/yarnpkg/gists{/gist_id}","starred_url":"https://api.github.com/users/yarnpkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarnpkg/subscriptions","organizations_url":"https://api.github.com/users/yarnpkg/orgs","repos_url":"https://api.github.com/users/yarnpkg/repos","events_url":"https://api.github.com/users/yarnpkg/events{/privacy}","received_events_url":"https://api.github.com/users/yarnpkg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yarnpkg/yarn","description":"📦🐈 Fast, reliable, and secure dependency management.","fork":false,"url":"https://api.github.com/repos/yarnpkg/yarn","forks_url":"https://api.github.com/repos/yarnpkg/yarn/forks","keys_url":"https://api.github.com/repos/yarnpkg/yarn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarnpkg/yarn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarnpkg/yarn/teams","hooks_url":"https://api.github.com/repos/yarnpkg/yarn/hooks","issue_events_url":"https://api.github.com/repos/yarnpkg/yarn/issues/events{/number}","events_url":"https://api.github.com/repos/yarnpkg/yarn/events","assignees_url":"https://api.github.com/repos/yarnpkg/yarn/assignees{/user}","branches_url":"https://api.github.com/repos/yarnpkg/yarn/branches{/branch}","tags_url":"https://api.github.com/repos/yarnpkg/yarn/tags","blobs_url":"https://api.github.com/repos/yarnpkg/yarn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarnpkg/yarn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarnpkg/yarn/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarnpkg/yarn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarnpkg/yarn/statuses/{sha}","languages_url":"https://api.github.com/repos/yarnpkg/yarn/languages","stargazers_url":"https://api.github.com/repos/yarnpkg/yarn/stargazers","contributors_url":"https://api.github.com/repos/yarnpkg/yarn/contributors","subscribers_url":"https://api.github.com/repos/yarnpkg/yarn/subscribers","subscription_url":"https://api.github.com/repos/yarnpkg/yarn/subscription","commits_url":"https://api.github.com/repos/yarnpkg/yarn/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarnpkg/yarn/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarnpkg/yarn/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarnpkg/yarn/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarnpkg/yarn/contents/{+path}","compare_url":"https://api.github.com/repos/yarnpkg/yarn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarnpkg/yarn/merges","archive_url":"https://api.github.com/repos/yarnpkg/yarn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarnpkg/yarn/downloads","issues_url":"https://api.github.com/repos/yarnpkg/yarn/issues{/number}","pulls_url":"https://api.github.com/repos/yarnpkg/yarn/pulls{/number}","milestones_url":"https://api.github.com/repos/yarnpkg/yarn/milestones{/number}","notifications_url":"https://api.github.com/repos/yarnpkg/yarn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarnpkg/yarn/labels{/name}","releases_url":"https://api.github.com/repos/yarnpkg/yarn/releases{/id}","deployments_url":"https://api.github.com/repos/yarnpkg/yarn/deployments","created_at":"2016-01-19T17:39:16Z","updated_at":"2017-10-05T16:22:59Z","pushed_at":"2017-10-05T16:19:39Z","git_url":"git://github.com/yarnpkg/yarn.git","ssh_url":"git@github.com:yarnpkg/yarn.git","clone_url":"https://github.com/yarnpkg/yarn.git","svn_url":"https://github.com/yarnpkg/yarn","homepage":"https://yarnpkg.com","size":112787,"stargazers_count":27727,"watchers_count":27727,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1440,"mirror_url":null,"open_issues_count":890,"forks":1440,"open_issues":890,"watchers":27727,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/4633"},"html":{"href":"https://github.com/yarnpkg/yarn/pull/4633"},"issue":{"href":"https://api.github.com/repos/yarnpkg/yarn/issues/4633"},"comments":{"href":"https://api.github.com/repos/yarnpkg/yarn/issues/4633/comments"},"review_comments":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/4633/comments"},"review_comment":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/4633/commits"},"statuses":{"href":"https://api.github.com/repos/yarnpkg/yarn/statuses/23e9fddb2d728395c060fbea11ba19efc8650e7e"}},"author_association":"NONE"}}
{"actor":{"display_login":"BYK"}}