{"action":"created","comment":{"url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/comments/58430457","id":58430457,"diff_hunk":"@@ -1,20 +1,23 @@\n // taken from https://github.com/taskcluster/taskcluster-queue/blob/0dd2b45b860836a2ef6c651c5499c9abfb5670ad/utils/aws-sdk-promise.js\n var aws = require('aws-sdk');\n-var Promise = require('promise');\n \n // XXX: This is a terrible hack but it should not break anything in horrible\n // ways.\n aws.Request.prototype.promise = function() {\n-  return new Promise(function(accept, reject) {\n-    this.on('complete', function(response) {\n+  var that = this;\n+  var Prom = aws.Promise || require('promise');\n+  return new Prom(function(accept, reject) {\n+    that.on('complete', function(response) {\n       if (response.error) {\n         reject(response.error);\n       } else {\n         accept(response);\n       }\n     });\n-    this.send();\n-  }.bind(this));\n+    that.send();\n+  });\n };\n \n+aws.Promise = undefined;","path":"index.js","position":26,"original_position":26,"commit_id":"3ab0cf0602099b3127fbe61654e2ad1115fa3027","original_commit_id":"326bb09e942c46a3e0853d82e56392e1b62772d9","user":{"login":"jonasfj","id":149732,"avatar_url":"https://avatars.githubusercontent.com/u/149732?v=3","gravatar_id":"","url":"https://api.github.com/users/jonasfj","html_url":"https://github.com/jonasfj","followers_url":"https://api.github.com/users/jonasfj/followers","following_url":"https://api.github.com/users/jonasfj/following{/other_user}","gists_url":"https://api.github.com/users/jonasfj/gists{/gist_id}","starred_url":"https://api.github.com/users/jonasfj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonasfj/subscriptions","organizations_url":"https://api.github.com/users/jonasfj/orgs","repos_url":"https://api.github.com/users/jonasfj/repos","events_url":"https://api.github.com/users/jonasfj/events{/privacy}","received_events_url":"https://api.github.com/users/jonasfj/received_events","type":"User","site_admin":false},"body":"hmm, I think this is overkill... if aws introduces a promise property and `promise()` method etc, (who knows) this library will break... There is no stopping that.. We're monkey-patching here :)","created_at":"2016-04-04T19:09:16Z","updated_at":"2016-04-04T19:09:16Z","html_url":"https://github.com/taskcluster/aws-sdk-promise/pull/2#discussion_r58430457","pull_request_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/comments/58430457"},"html":{"href":"https://github.com/taskcluster/aws-sdk-promise/pull/2#discussion_r58430457"},"pull_request":{"href":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/2","id":56063043,"html_url":"https://github.com/taskcluster/aws-sdk-promise/pull/2","diff_url":"https://github.com/taskcluster/aws-sdk-promise/pull/2.diff","patch_url":"https://github.com/taskcluster/aws-sdk-promise/pull/2.patch","issue_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/issues/2","number":2,"state":"open","locked":false,"title":"Allow promise libraries","user":{"login":"gaggle","id":2316447,"avatar_url":"https://avatars.githubusercontent.com/u/2316447?v=3","gravatar_id":"","url":"https://api.github.com/users/gaggle","html_url":"https://github.com/gaggle","followers_url":"https://api.github.com/users/gaggle/followers","following_url":"https://api.github.com/users/gaggle/following{/other_user}","gists_url":"https://api.github.com/users/gaggle/gists{/gist_id}","starred_url":"https://api.github.com/users/gaggle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaggle/subscriptions","organizations_url":"https://api.github.com/users/gaggle/orgs","repos_url":"https://api.github.com/users/gaggle/repos","events_url":"https://api.github.com/users/gaggle/events{/privacy}","received_events_url":"https://api.github.com/users/gaggle/received_events","type":"User","site_admin":false},"body":"I wanted this library to return Q promises for my own project, with this change user can pass in a custom constructor via `.Promise` property.","created_at":"2016-01-14T17:00:00Z","updated_at":"2016-04-04T19:09:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4f12b8f51a985a412cd0fd7dc2cf73bc2fab81e","assignee":{"login":"jhford","id":607353,"avatar_url":"https://avatars.githubusercontent.com/u/607353?v=3","gravatar_id":"","url":"https://api.github.com/users/jhford","html_url":"https://github.com/jhford","followers_url":"https://api.github.com/users/jhford/followers","following_url":"https://api.github.com/users/jhford/following{/other_user}","gists_url":"https://api.github.com/users/jhford/gists{/gist_id}","starred_url":"https://api.github.com/users/jhford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhford/subscriptions","organizations_url":"https://api.github.com/users/jhford/orgs","repos_url":"https://api.github.com/users/jhford/repos","events_url":"https://api.github.com/users/jhford/events{/privacy}","received_events_url":"https://api.github.com/users/jhford/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/2/commits","review_comments_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/2/comments","review_comment_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/issues/2/comments","statuses_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/statuses/3ab0cf0602099b3127fbe61654e2ad1115fa3027","head":{"label":"gaggle:allow-promise-libraries","ref":"allow-promise-libraries","sha":"3ab0cf0602099b3127fbe61654e2ad1115fa3027","user":{"login":"gaggle","id":2316447,"avatar_url":"https://avatars.githubusercontent.com/u/2316447?v=3","gravatar_id":"","url":"https://api.github.com/users/gaggle","html_url":"https://github.com/gaggle","followers_url":"https://api.github.com/users/gaggle/followers","following_url":"https://api.github.com/users/gaggle/following{/other_user}","gists_url":"https://api.github.com/users/gaggle/gists{/gist_id}","starred_url":"https://api.github.com/users/gaggle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaggle/subscriptions","organizations_url":"https://api.github.com/users/gaggle/orgs","repos_url":"https://api.github.com/users/gaggle/repos","events_url":"https://api.github.com/users/gaggle/events{/privacy}","received_events_url":"https://api.github.com/users/gaggle/received_events","type":"User","site_admin":false},"repo":{"id":49660322,"name":"aws-sdk-promise","full_name":"gaggle/aws-sdk-promise","owner":{"login":"gaggle","id":2316447,"avatar_url":"https://avatars.githubusercontent.com/u/2316447?v=3","gravatar_id":"","url":"https://api.github.com/users/gaggle","html_url":"https://github.com/gaggle","followers_url":"https://api.github.com/users/gaggle/followers","following_url":"https://api.github.com/users/gaggle/following{/other_user}","gists_url":"https://api.github.com/users/gaggle/gists{/gist_id}","starred_url":"https://api.github.com/users/gaggle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaggle/subscriptions","organizations_url":"https://api.github.com/users/gaggle/orgs","repos_url":"https://api.github.com/users/gaggle/repos","events_url":"https://api.github.com/users/gaggle/events{/privacy}","received_events_url":"https://api.github.com/users/gaggle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gaggle/aws-sdk-promise","description":"Hack for adding the .promise() method to all aws-sdk request objects (aws-sdk is a peerDependency)","fork":true,"url":"https://api.github.com/repos/gaggle/aws-sdk-promise","forks_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/forks","keys_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/teams","hooks_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/hooks","issue_events_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/issues/events{/number}","events_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/events","assignees_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/assignees{/user}","branches_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/branches{/branch}","tags_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/tags","blobs_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/statuses/{sha}","languages_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/languages","stargazers_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/stargazers","contributors_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/contributors","subscribers_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/subscribers","subscription_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/subscription","commits_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/contents/{+path}","compare_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/merges","archive_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/downloads","issues_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/issues{/number}","pulls_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/pulls{/number}","milestones_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/milestones{/number}","notifications_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/labels{/name}","releases_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/releases{/id}","deployments_url":"https://api.github.com/repos/gaggle/aws-sdk-promise/deployments","created_at":"2016-01-14T16:39:11Z","updated_at":"2016-01-14T16:39:12Z","pushed_at":"2016-04-04T12:38:03Z","git_url":"git://github.com/gaggle/aws-sdk-promise.git","ssh_url":"git@github.com:gaggle/aws-sdk-promise.git","clone_url":"https://github.com/gaggle/aws-sdk-promise.git","svn_url":"https://github.com/gaggle/aws-sdk-promise","homepage":null,"size":1972,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"taskcluster:master","ref":"master","sha":"5e0e05b67b92b7cbf0938b43fd1d12eb1d2f49d5","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"repo":{"id":16749771,"name":"aws-sdk-promise","full_name":"taskcluster/aws-sdk-promise","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskcluster/aws-sdk-promise","description":"Hack for adding the .promise() method to all aws-sdk request objects (aws-sdk is a peerDependency)","fork":false,"url":"https://api.github.com/repos/taskcluster/aws-sdk-promise","forks_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/forks","keys_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/teams","hooks_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/events","assignees_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/tags","blobs_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/languages","stargazers_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/subscription","commits_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/merges","archive_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/downloads","issues_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/releases{/id}","deployments_url":"https://api.github.com/repos/taskcluster/aws-sdk-promise/deployments","created_at":"2014-02-11T23:41:46Z","updated_at":"2016-03-29T23:54:21Z","pushed_at":"2016-04-04T12:38:03Z","git_url":"git://github.com/taskcluster/aws-sdk-promise.git","ssh_url":"git@github.com:taskcluster/aws-sdk-promise.git","clone_url":"https://github.com/taskcluster/aws-sdk-promise.git","svn_url":"https://github.com/taskcluster/aws-sdk-promise","homepage":null,"size":1970,"stargazers_count":13,"watchers_count":13,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":1,"forks":9,"open_issues":1,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/2"},"html":{"href":"https://github.com/taskcluster/aws-sdk-promise/pull/2"},"issue":{"href":"https://api.github.com/repos/taskcluster/aws-sdk-promise/issues/2"},"comments":{"href":"https://api.github.com/repos/taskcluster/aws-sdk-promise/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taskcluster/aws-sdk-promise/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/taskcluster/aws-sdk-promise/statuses/3ab0cf0602099b3127fbe61654e2ad1115fa3027"}}}}