{"action":"created","comment":{"url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/comments/172987966","pull_request_review_id":102100557,"id":172987966,"diff_hunk":"@@ -106,16 +109,26 @@ async function documenter(options) {\n   if (options.publish) {\n     let creds = options.aws;\n     if (!creds) {\n-      let auth = new client.Auth({\n-        credentials: options.credentials,\n-        baseUrl: options.authBaseUrl,\n-      });\n-\n-      creds = await auth.awsS3Credentials('read-write', options.bucket, options.project + '/');\n+      //Bypassing Tascluster credentials if none are provided in the config file.\n+      // For testing purposes only.\n+      if (options.credentials['clientId'] === 'bypassTcCreds') {\n+        creds = options.credentials;\n+      } else {\n+        let auth = new client.Auth({\n+          credentials: options.credentials,\n+          baseUrl: options.authBaseUrl,\n+        });\n+        creds = await auth.awsS3Credentials(\n+          'read-write',\n+          options.bucket,\n+          options.project + '/'\n+        );\n+      }\n     }\n \n     let s3 = new aws.S3(creds.credentials);\n-    let s3Stream = S3UploadStream(s3);\n+\n+    let s3Stream = (options.module || S3UploadStream)(s3);","path":"src/docs.js","position":49,"original_position":49,"commit_id":"a13fd7f8b677b41c12b6fe5ab3fefe5816db1e22","original_commit_id":"a13fd7f8b677b41c12b6fe5ab3fefe5816db1e22","user":{"login":"djmitche","id":28673,"avatar_url":"https://avatars3.githubusercontent.com/u/28673?v=4","gravatar_id":"","url":"https://api.github.com/users/djmitche","html_url":"https://github.com/djmitche","followers_url":"https://api.github.com/users/djmitche/followers","following_url":"https://api.github.com/users/djmitche/following{/other_user}","gists_url":"https://api.github.com/users/djmitche/gists{/gist_id}","starred_url":"https://api.github.com/users/djmitche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djmitche/subscriptions","organizations_url":"https://api.github.com/users/djmitche/orgs","repos_url":"https://api.github.com/users/djmitche/repos","events_url":"https://api.github.com/users/djmitche/events{/privacy}","received_events_url":"https://api.github.com/users/djmitche/received_events","type":"User","site_admin":false},"body":"I like this, but the identifier `module` is a little vague.. module for what??  How about\r\n```javascript\r\n// allow use of S3UploadStream from the caller (for testing)\r\nlet s3Stream = (options.S3UploadStream || S3UploadStream)(s3);\r\n```","created_at":"2018-03-07T21:19:33Z","updated_at":"2018-03-07T21:23:12Z","html_url":"https://github.com/taskcluster/taskcluster-lib-docs/pull/32#discussion_r172987966","pull_request_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/32","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/comments/172987966"},"html":{"href":"https://github.com/taskcluster/taskcluster-lib-docs/pull/32#discussion_r172987966"},"pull_request":{"href":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/32","id":173422481,"html_url":"https://github.com/taskcluster/taskcluster-lib-docs/pull/32","diff_url":"https://github.com/taskcluster/taskcluster-lib-docs/pull/32.diff","patch_url":"https://github.com/taskcluster/taskcluster-lib-docs/pull/32.patch","issue_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/issues/32","number":32,"state":"open","locked":false,"title":"Mock aws library","user":{"login":"MynahMarie","id":24983802,"avatar_url":"https://avatars3.githubusercontent.com/u/24983802?v=4","gravatar_id":"","url":"https://api.github.com/users/MynahMarie","html_url":"https://github.com/MynahMarie","followers_url":"https://api.github.com/users/MynahMarie/followers","following_url":"https://api.github.com/users/MynahMarie/following{/other_user}","gists_url":"https://api.github.com/users/MynahMarie/gists{/gist_id}","starred_url":"https://api.github.com/users/MynahMarie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MynahMarie/subscriptions","organizations_url":"https://api.github.com/users/MynahMarie/orgs","repos_url":"https://api.github.com/users/MynahMarie/repos","events_url":"https://api.github.com/users/MynahMarie/events{/privacy}","received_events_url":"https://api.github.com/users/MynahMarie/received_events","type":"User","site_admin":false},"body":"References Bugzilla 1443019\r\n\r\nIn this PR I have:\r\n- Implemented a fake S3UploadStream module to be used during testing so that we don't need to make calls to the aws service every time we run the tests.\r\n- To do that, I had to bypass the Taskcluster credentials because I don't have the appropriate scope in for the taskcluster auth function to pass... (I tried to set up a Taskcluster client but was unable to add the appropriate scope needed as explained in the user-config-example.yml file...).\r\n\r\nIf I should rewrite this to include proper Taskcluster credentials, let me know :)","created_at":"2018-03-07T11:20:07Z","updated_at":"2018-03-07T21:23:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34d7b3da1f42bcbf2a25d03a10453f7af0eeca00","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/32/commits","review_comments_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/32/comments","review_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/issues/32/comments","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/statuses/a13fd7f8b677b41c12b6fe5ab3fefe5816db1e22","head":{"label":"MynahMarie:mock_aws_library","ref":"mock_aws_library","sha":"a13fd7f8b677b41c12b6fe5ab3fefe5816db1e22","user":{"login":"MynahMarie","id":24983802,"avatar_url":"https://avatars3.githubusercontent.com/u/24983802?v=4","gravatar_id":"","url":"https://api.github.com/users/MynahMarie","html_url":"https://github.com/MynahMarie","followers_url":"https://api.github.com/users/MynahMarie/followers","following_url":"https://api.github.com/users/MynahMarie/following{/other_user}","gists_url":"https://api.github.com/users/MynahMarie/gists{/gist_id}","starred_url":"https://api.github.com/users/MynahMarie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MynahMarie/subscriptions","organizations_url":"https://api.github.com/users/MynahMarie/orgs","repos_url":"https://api.github.com/users/MynahMarie/repos","events_url":"https://api.github.com/users/MynahMarie/events{/privacy}","received_events_url":"https://api.github.com/users/MynahMarie/received_events","type":"User","site_admin":false},"repo":{"id":123948905,"name":"taskcluster-lib-docs","full_name":"MynahMarie/taskcluster-lib-docs","owner":{"login":"MynahMarie","id":24983802,"avatar_url":"https://avatars3.githubusercontent.com/u/24983802?v=4","gravatar_id":"","url":"https://api.github.com/users/MynahMarie","html_url":"https://github.com/MynahMarie","followers_url":"https://api.github.com/users/MynahMarie/followers","following_url":"https://api.github.com/users/MynahMarie/following{/other_user}","gists_url":"https://api.github.com/users/MynahMarie/gists{/gist_id}","starred_url":"https://api.github.com/users/MynahMarie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MynahMarie/subscriptions","organizations_url":"https://api.github.com/users/MynahMarie/orgs","repos_url":"https://api.github.com/users/MynahMarie/repos","events_url":"https://api.github.com/users/MynahMarie/events{/privacy}","received_events_url":"https://api.github.com/users/MynahMarie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MynahMarie/taskcluster-lib-docs","description":"Utility to deal with per-project documentation generation, uploading, and building.","fork":true,"url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs","forks_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/forks","keys_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/teams","hooks_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/hooks","issue_events_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/issues/events{/number}","events_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/events","assignees_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/assignees{/user}","branches_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/branches{/branch}","tags_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/tags","blobs_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/languages","stargazers_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/stargazers","contributors_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/contributors","subscribers_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/subscribers","subscription_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/subscription","commits_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/contents/{+path}","compare_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/merges","archive_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/downloads","issues_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/issues{/number}","pulls_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/labels{/name}","releases_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/releases{/id}","deployments_url":"https://api.github.com/repos/MynahMarie/taskcluster-lib-docs/deployments","created_at":"2018-03-05T16:43:52Z","updated_at":"2018-03-05T16:43:54Z","pushed_at":"2018-03-07T11:13:13Z","git_url":"git://github.com/MynahMarie/taskcluster-lib-docs.git","ssh_url":"git@github.com:MynahMarie/taskcluster-lib-docs.git","clone_url":"https://github.com/MynahMarie/taskcluster-lib-docs.git","svn_url":"https://github.com/MynahMarie/taskcluster-lib-docs","homepage":null,"size":178,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"taskcluster:master","ref":"master","sha":"8b235ff18325335b8075cc0db3cf1a2b610e4ea9","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars2.githubusercontent.com/u/6257436?v=4","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":60293963,"name":"taskcluster-lib-docs","full_name":"taskcluster/taskcluster-lib-docs","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars2.githubusercontent.com/u/6257436?v=4","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/taskcluster-lib-docs","description":"Utility to deal with per-project documentation generation, uploading, and building.","fork":false,"url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs","forks_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/forks","keys_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/teams","hooks_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/events","assignees_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/tags","blobs_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/languages","stargazers_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/subscription","commits_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/merges","archive_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/downloads","issues_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/releases{/id}","deployments_url":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/deployments","created_at":"2016-06-02T20:09:11Z","updated_at":"2016-06-08T17:29:46Z","pushed_at":"2018-03-07T11:20:08Z","git_url":"git://github.com/taskcluster/taskcluster-lib-docs.git","ssh_url":"git@github.com:taskcluster/taskcluster-lib-docs.git","clone_url":"https://github.com/taskcluster/taskcluster-lib-docs.git","svn_url":"https://github.com/taskcluster/taskcluster-lib-docs","homepage":null,"size":169,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/32"},"html":{"href":"https://github.com/taskcluster/taskcluster-lib-docs/pull/32"},"issue":{"href":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/issues/32"},"comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/taskcluster/taskcluster-lib-docs/statuses/a13fd7f8b677b41c12b6fe5ab3fefe5816db1e22"}},"author_association":"NONE"}}
{"actor":{"display_login":"djmitche"}}