{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/36132300","id":36132300,"diff_hunk":"@@ -91,31 +91,43 @@ ViewModel.prototype.updateBucketList = function(){\n \n ViewModel.prototype.selectBucket = function() {\n     var self = this;\n+\n+    // The current version of boto does not handle bucket names containing periods\n+    var isValidBotoBucket = /^(?!.*(\\.\\.|-\\.))[^.][a-z0-9\\d-]{2,61}[^.]$/;\n+\n     self.loading(true);\n-    return $osf.postJSON(\n+\n+    if (isValidBotoBucket.exec(self.selectedBucket()) == null) {\n+        self.loading(false);\n+        bootbox.alert({\n+            title: 'Invalid bucket name',\n+            message: 'Sorry, the S3 addon only supports bucket names without periods.'\n+        });\n+    } else {\n+        return $osf.postJSON(\n             self.urls().set_bucket, {\n                 's3_bucket': self.selectedBucket(),\n                 'encrypt_uploads': self.encryptUploads()\n             }\n         )\n-        .done(function(response) {\n-            self.updateFromData(response);\n-            self.changeMessage('Successfully linked S3 bucket \"' + self.currentBucket() + '\". Go to the <a href=\"' +\n-                               self.urls().files + '\">Files page</a> to view your content.', 'text-success');\n-            self.loading(false);\n-        })\n-        .fail(function(xhr, status, error) {\n-            self.loading(false);\n-            var message = 'Could not change S3 bucket at this time. ' +\n-                'Please refresh the page. If the problem persists, email ' +\n-                '<a href=\"mailto:support@osf.io\">support@osf.io</a>.';\n-            self.changeMessage(message, 'text-warning');\n-            Raven.captureMessage('Could not set S3 bucket', {\n-                url: self.urls().setBucket,\n-                textStatus: status,\n-                error: error\n+            .done(function (response) {\n+                self.updateFromData(response);\n+                self.changeMessage('Successfully linked S3 bucket \"' + self.currentBucket() + '\". Go to the <a href=\"' +\n+                    self.urls().files + '\">Files page</a> to view your content.', 'text-success');\n+            })\n+            .fail(function (xhr, status, error) {\n+                var message = 'Could not change S3 bucket at this time. ' +\n+                    'Please refresh the page. If the problem persists, email ' +\n+                    '<a href=\"mailto:support@osf.io\">support@osf.io</a>.';\n+                self.changeMessage(message, 'text-warning');\n+                Raven.captureMessage('Could not set S3 bucket', {\n+                    url: self.urls().setBucket,\n+                    textStatus: status,\n+                    error: error\n+            })","path":"website/addons/s3/static/s3NodeConfig.js","position":54,"original_position":54,"commit_id":"ebf97752cbb824210af7b44da58ff2f82fbccdd1","original_commit_id":"ebf97752cbb824210af7b44da58ff2f82fbccdd1","user":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"body":"Missing semicolon (please make sure this file passes jshint checks before pushing).","created_at":"2015-08-03T21:11:18Z","updated_at":"2015-08-03T21:11:18Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3921#discussion_r36132300","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3921","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/36132300"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/3921#discussion_r36132300"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3921"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3921","id":41506606,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3921","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/3921.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/3921.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3921","number":3921,"state":"open","locked":false,"title":"[Feature Fix] Disallow selection of S3 bucket names containing periods","user":{"login":"HarryRybacki","id":2614670,"avatar_url":"https://avatars.githubusercontent.com/u/2614670?v=3","gravatar_id":"","url":"https://api.github.com/users/HarryRybacki","html_url":"https://github.com/HarryRybacki","followers_url":"https://api.github.com/users/HarryRybacki/followers","following_url":"https://api.github.com/users/HarryRybacki/following{/other_user}","gists_url":"https://api.github.com/users/HarryRybacki/gists{/gist_id}","starred_url":"https://api.github.com/users/HarryRybacki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HarryRybacki/subscriptions","organizations_url":"https://api.github.com/users/HarryRybacki/orgs","repos_url":"https://api.github.com/users/HarryRybacki/repos","events_url":"https://api.github.com/users/HarryRybacki/events{/privacy}","received_events_url":"https://api.github.com/users/HarryRybacki/received_events","type":"User","site_admin":false},"body":"## Purpose\r\nThere is a [known issue](https://github.com/boto/boto/issues/2836) with boto which prevents our use of S3 bucket names that contain periods. We should not allow users to select buckets whose name contain periods until this is fixed within boto or we have moved to boto3 and ensured this is no longer an issue.\r\n\r\n## Changes\r\n- Hijack s3NodeConfig.selectBucket and prompt user with an alert if they have selected a bucket that contains a period in its name.\r\n- Added test.\r\n\r\n## Side Effects:\r\nUsers cannot select buckets with names containing one or more `.`","created_at":"2015-08-03T20:32:07Z","updated_at":"2015-08-03T21:11:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3921/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3921/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3921/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/ebf97752cbb824210af7b44da58ff2f82fbccdd1","head":{"label":"HarryRybacki:feature/add_s3_encryption","ref":"feature/add_s3_encryption","sha":"ebf97752cbb824210af7b44da58ff2f82fbccdd1","user":{"login":"HarryRybacki","id":2614670,"avatar_url":"https://avatars.githubusercontent.com/u/2614670?v=3","gravatar_id":"","url":"https://api.github.com/users/HarryRybacki","html_url":"https://github.com/HarryRybacki","followers_url":"https://api.github.com/users/HarryRybacki/followers","following_url":"https://api.github.com/users/HarryRybacki/following{/other_user}","gists_url":"https://api.github.com/users/HarryRybacki/gists{/gist_id}","starred_url":"https://api.github.com/users/HarryRybacki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HarryRybacki/subscriptions","organizations_url":"https://api.github.com/users/HarryRybacki/orgs","repos_url":"https://api.github.com/users/HarryRybacki/repos","events_url":"https://api.github.com/users/HarryRybacki/events{/privacy}","received_events_url":"https://api.github.com/users/HarryRybacki/received_events","type":"User","site_admin":false},"repo":{"id":30415497,"name":"osf.io","full_name":"HarryRybacki/osf.io","owner":{"login":"HarryRybacki","id":2614670,"avatar_url":"https://avatars.githubusercontent.com/u/2614670?v=3","gravatar_id":"","url":"https://api.github.com/users/HarryRybacki","html_url":"https://github.com/HarryRybacki","followers_url":"https://api.github.com/users/HarryRybacki/followers","following_url":"https://api.github.com/users/HarryRybacki/following{/other_user}","gists_url":"https://api.github.com/users/HarryRybacki/gists{/gist_id}","starred_url":"https://api.github.com/users/HarryRybacki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HarryRybacki/subscriptions","organizations_url":"https://api.github.com/users/HarryRybacki/orgs","repos_url":"https://api.github.com/users/HarryRybacki/repos","events_url":"https://api.github.com/users/HarryRybacki/events{/privacy}","received_events_url":"https://api.github.com/users/HarryRybacki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HarryRybacki/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/HarryRybacki/osf.io","forks_url":"https://api.github.com/repos/HarryRybacki/osf.io/forks","keys_url":"https://api.github.com/repos/HarryRybacki/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HarryRybacki/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HarryRybacki/osf.io/teams","hooks_url":"https://api.github.com/repos/HarryRybacki/osf.io/hooks","issue_events_url":"https://api.github.com/repos/HarryRybacki/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/HarryRybacki/osf.io/events","assignees_url":"https://api.github.com/repos/HarryRybacki/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/HarryRybacki/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/HarryRybacki/osf.io/tags","blobs_url":"https://api.github.com/repos/HarryRybacki/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HarryRybacki/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HarryRybacki/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/HarryRybacki/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HarryRybacki/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/HarryRybacki/osf.io/languages","stargazers_url":"https://api.github.com/repos/HarryRybacki/osf.io/stargazers","contributors_url":"https://api.github.com/repos/HarryRybacki/osf.io/contributors","subscribers_url":"https://api.github.com/repos/HarryRybacki/osf.io/subscribers","subscription_url":"https://api.github.com/repos/HarryRybacki/osf.io/subscription","commits_url":"https://api.github.com/repos/HarryRybacki/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/HarryRybacki/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/HarryRybacki/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/HarryRybacki/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/HarryRybacki/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/HarryRybacki/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HarryRybacki/osf.io/merges","archive_url":"https://api.github.com/repos/HarryRybacki/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HarryRybacki/osf.io/downloads","issues_url":"https://api.github.com/repos/HarryRybacki/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/HarryRybacki/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/HarryRybacki/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/HarryRybacki/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HarryRybacki/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/HarryRybacki/osf.io/releases{/id}","created_at":"2015-02-06T14:18:39Z","updated_at":"2015-04-20T13:52:21Z","pushed_at":"2015-08-03T21:03:19Z","git_url":"git://github.com/HarryRybacki/osf.io.git","ssh_url":"git@github.com:HarryRybacki/osf.io.git","clone_url":"https://github.com/HarryRybacki/osf.io.git","svn_url":"https://github.com/HarryRybacki/osf.io","homepage":"http://osf.io","size":97773,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"fbe50be9759b6ee8a9bc41390590725702cf7ce8","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","created_at":"2013-05-21T15:53:37Z","updated_at":"2015-08-03T14:53:09Z","pushed_at":"2015-08-03T21:09:11Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"http://osf.io","size":220860,"stargazers_count":123,"watchers_count":123,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":106,"mirror_url":null,"open_issues_count":509,"forks":106,"open_issues":509,"watchers":123,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3921"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/3921"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3921"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3921/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3921/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3921/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/ebf97752cbb824210af7b44da58ff2f82fbccdd1"}}}}