{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/comments/56754481","id":56754481,"diff_hunk":"@@ -58,6 +29,81 @@ var testsWorkspace = process.env.CODE_TESTS_WORKSPACE || testsFolder;\n console.log('### VS Code Extension Test Run ###');\n console.log('Current working directory: ' + process.cwd());\n \n+function getTags(url, tags) {\n+    var tags = tags || [];\n+\n+    return ghGot(url || 'repos/Microsoft/vscode/tags')\n+        .then(function(result) {\n+            var link = parse(result.headers.link);\n+            tags = tags.concat(result.body);\n+\n+            // Recursively load the tags of all the pages\n+            if (link.next) {\n+                return getTags(link.next, tags);\n+            }\n+\n+            return tags;\n+        });\n+}\n+\n+function getDownloadUrl() {\n+    if (process.env.CODE_DOWNLOAD_URL) {\n+        return Promise.resolve(process.env.CODE_DOWNLOAD_URL);\n+    }\n+\n+    return getTags()\n+        .then(function(tags) {\n+            // Filter out invalid tags and prerelease tags\n+            tags = tags.filter(function(tag) {\n+                var parsed = semver.parse(tag.name);\n+                return parsed && parsed.prerelease.length === 0;\n+            });","path":"bin/test","position":88,"original_position":88,"commit_id":"3b49b56fd28171d157c4042d8c108eff0323eb39","original_commit_id":"3b49b56fd28171d157c4042d8c108eff0323eb39","user":{"login":"SamVerschueren","id":1913805,"avatar_url":"https://avatars.githubusercontent.com/u/1913805?v=3","gravatar_id":"","url":"https://api.github.com/users/SamVerschueren","html_url":"https://github.com/SamVerschueren","followers_url":"https://api.github.com/users/SamVerschueren/followers","following_url":"https://api.github.com/users/SamVerschueren/following{/other_user}","gists_url":"https://api.github.com/users/SamVerschueren/gists{/gist_id}","starred_url":"https://api.github.com/users/SamVerschueren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamVerschueren/subscriptions","organizations_url":"https://api.github.com/users/SamVerschueren/orgs","repos_url":"https://api.github.com/users/SamVerschueren/repos","events_url":"https://api.github.com/users/SamVerschueren/events{/privacy}","received_events_url":"https://api.github.com/users/SamVerschueren/received_events","type":"User","site_admin":false},"body":"It's correct that I can't install an insiders release right? I tried it with `0.10.7-insiders`, but it didn't work so that's why I'm filtering them here.","created_at":"2016-03-19T20:18:08Z","updated_at":"2016-03-19T20:18:08Z","html_url":"https://github.com/Microsoft/vscode-extension-vscode/pull/20#discussion_r56754481","pull_request_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/comments/56754481"},"html":{"href":"https://github.com/Microsoft/vscode-extension-vscode/pull/20#discussion_r56754481"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/20","id":63476842,"html_url":"https://github.com/Microsoft/vscode-extension-vscode/pull/20","diff_url":"https://github.com/Microsoft/vscode-extension-vscode/pull/20.diff","patch_url":"https://github.com/Microsoft/vscode-extension-vscode/pull/20.patch","issue_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/issues/20","number":20,"state":"open","locked":false,"title":"retrieve the commit hash from the tag of the vscode repository","user":{"login":"SamVerschueren","id":1913805,"avatar_url":"https://avatars.githubusercontent.com/u/1913805?v=3","gravatar_id":"","url":"https://api.github.com/users/SamVerschueren","html_url":"https://github.com/SamVerschueren","followers_url":"https://api.github.com/users/SamVerschueren/followers","following_url":"https://api.github.com/users/SamVerschueren/following{/other_user}","gists_url":"https://api.github.com/users/SamVerschueren/gists{/gist_id}","starred_url":"https://api.github.com/users/SamVerschueren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamVerschueren/subscriptions","organizations_url":"https://api.github.com/users/SamVerschueren/orgs","repos_url":"https://api.github.com/users/SamVerschueren/repos","events_url":"https://api.github.com/users/SamVerschueren/events{/privacy}","received_events_url":"https://api.github.com/users/SamVerschueren/received_events","type":"User","site_admin":false},"body":"As \"discussed\" in the commit [here](https://github.com/Microsoft/vscode-extension-vscode/commit/f621005b4edbac5a381e1ab97940e6c2c76644cb#commitcomment-16557298), I changed the implementation of the `test` file. Instead of hard-coding the commit hashes, I retrieve the tags via the GitHub API.\r\n\r\nI also refactored the flow to use promises (I hate callbacks to be honest :)). But this could be nice for the future if you want to extend the behaviour, you can just add extra steps in the promise chain.\r\n\r\nI also used [gh-got](https://github.com/sindresorhus/gh-got) to interact with the GitHub API. `gh-got` is a small wrapper around [got](https://github.com/sindresorhus/got) which serves the same purpose as `request` but was create because `request` got bloated with too many features. But it offers a nice interface to the GitHub API and has built-in support for the `GITHUB_TOKEN` environment variable.\r\n\r\nJust let me know what you think. Please provide feedback if you think things should be done differently, or in a better way. If you don't like it, no harm done :).","created_at":"2016-03-19T19:46:46Z","updated_at":"2016-03-19T20:18:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4269fe55c10cd4e86f9823188952662e4ffb0c3e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/20/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/20/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/issues/20/comments","statuses_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/statuses/3b49b56fd28171d157c4042d8c108eff0323eb39","head":{"label":"SamVerschueren:test-tags","ref":"test-tags","sha":"3b49b56fd28171d157c4042d8c108eff0323eb39","user":{"login":"SamVerschueren","id":1913805,"avatar_url":"https://avatars.githubusercontent.com/u/1913805?v=3","gravatar_id":"","url":"https://api.github.com/users/SamVerschueren","html_url":"https://github.com/SamVerschueren","followers_url":"https://api.github.com/users/SamVerschueren/followers","following_url":"https://api.github.com/users/SamVerschueren/following{/other_user}","gists_url":"https://api.github.com/users/SamVerschueren/gists{/gist_id}","starred_url":"https://api.github.com/users/SamVerschueren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamVerschueren/subscriptions","organizations_url":"https://api.github.com/users/SamVerschueren/orgs","repos_url":"https://api.github.com/users/SamVerschueren/repos","events_url":"https://api.github.com/users/SamVerschueren/events{/privacy}","received_events_url":"https://api.github.com/users/SamVerschueren/received_events","type":"User","site_admin":false},"repo":{"id":54281153,"name":"vscode-extension-vscode","full_name":"SamVerschueren/vscode-extension-vscode","owner":{"login":"SamVerschueren","id":1913805,"avatar_url":"https://avatars.githubusercontent.com/u/1913805?v=3","gravatar_id":"","url":"https://api.github.com/users/SamVerschueren","html_url":"https://github.com/SamVerschueren","followers_url":"https://api.github.com/users/SamVerschueren/followers","following_url":"https://api.github.com/users/SamVerschueren/following{/other_user}","gists_url":"https://api.github.com/users/SamVerschueren/gists{/gist_id}","starred_url":"https://api.github.com/users/SamVerschueren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamVerschueren/subscriptions","organizations_url":"https://api.github.com/users/SamVerschueren/orgs","repos_url":"https://api.github.com/users/SamVerschueren/repos","events_url":"https://api.github.com/users/SamVerschueren/events{/privacy}","received_events_url":"https://api.github.com/users/SamVerschueren/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SamVerschueren/vscode-extension-vscode","description":"The vscode.d.ts node module","fork":true,"url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode","forks_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/forks","keys_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/teams","hooks_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/hooks","issue_events_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/issues/events{/number}","events_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/events","assignees_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/assignees{/user}","branches_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/branches{/branch}","tags_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/tags","blobs_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/git/refs{/sha}","trees_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/statuses/{sha}","languages_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/languages","stargazers_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/stargazers","contributors_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/contributors","subscribers_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/subscribers","subscription_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/subscription","commits_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/commits{/sha}","git_commits_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/git/commits{/sha}","comments_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/comments{/number}","issue_comment_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/issues/comments{/number}","contents_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/contents/{+path}","compare_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/merges","archive_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/downloads","issues_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/issues{/number}","pulls_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/pulls{/number}","milestones_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/milestones{/number}","notifications_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/labels{/name}","releases_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/releases{/id}","deployments_url":"https://api.github.com/repos/SamVerschueren/vscode-extension-vscode/deployments","created_at":"2016-03-19T18:32:46Z","updated_at":"2016-03-19T18:32:48Z","pushed_at":"2016-03-19T20:17:17Z","git_url":"git://github.com/SamVerschueren/vscode-extension-vscode.git","ssh_url":"git@github.com:SamVerschueren/vscode-extension-vscode.git","clone_url":"https://github.com/SamVerschueren/vscode-extension-vscode.git","svn_url":"https://github.com/SamVerschueren/vscode-extension-vscode","homepage":null,"size":228,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"Microsoft:master","ref":"master","sha":"e7869b578d4486383f5384b69c98bb5d4ec25d31","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":43924169,"name":"vscode-extension-vscode","full_name":"Microsoft/vscode-extension-vscode","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vscode-extension-vscode","description":"The vscode.d.ts node module","fork":false,"url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode","forks_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/forks","keys_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/teams","hooks_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/events","assignees_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/tags","blobs_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/subscription","commits_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/merges","archive_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/downloads","issues_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/deployments","created_at":"2015-10-09T00:43:42Z","updated_at":"2016-03-14T15:03:56Z","pushed_at":"2016-03-19T20:17:17Z","git_url":"git://github.com/Microsoft/vscode-extension-vscode.git","ssh_url":"git@github.com:Microsoft/vscode-extension-vscode.git","clone_url":"https://github.com/Microsoft/vscode-extension-vscode.git","svn_url":"https://github.com/Microsoft/vscode-extension-vscode","homepage":null,"size":229,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":2,"forks":9,"open_issues":2,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/20"},"html":{"href":"https://github.com/Microsoft/vscode-extension-vscode/pull/20"},"issue":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/issues/20"},"comments":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-vscode/statuses/3b49b56fd28171d157c4042d8c108eff0323eb39"}}}}