{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments/121204635","pull_request_review_id":43241440,"id":121204635,"diff_hunk":"@@ -324,6 +324,34 @@ const MarathonAppValidators = {\n \n       return errors;\n     }, []);\n+  },\n+\n+  /**\n+   * @param {Object} app - The data to validate\n+   * @returns {Array} Returns an array with validation errors\n+   */\n+  validateLabels(app) {\n+    if (ValidatorUtil.isDefined(app.labels)) {\n+      return Object.keys(app.labels)\n+        .reduce(function(accumulator, labelKey) {\n+          if (/^\\s|\\s$/.test(labelKey)) {\n+            accumulator.push(`labels.${labelKey}`);\n+          }\n+\n+          return accumulator;\n+        }, [])\n+        .map(function(labelPath) {\n+          return {\n+            path: [labelPath],\n+            message: \"Keys must not start or end with whitespace characters\",","path":"plugins/services/src/js/validators/MarathonAppValidators.js","position":23,"original_position":23,"commit_id":"639c22cbcd34ac178611b7fadeba5f494c8dec7b","original_commit_id":"639c22cbcd34ac178611b7fadeba5f494c8dec7b","user":{"login":"weblancaster","id":549394,"avatar_url":"https://avatars2.githubusercontent.com/u/549394?v=3","gravatar_id":"","url":"https://api.github.com/users/weblancaster","html_url":"https://github.com/weblancaster","followers_url":"https://api.github.com/users/weblancaster/followers","following_url":"https://api.github.com/users/weblancaster/following{/other_user}","gists_url":"https://api.github.com/users/weblancaster/gists{/gist_id}","starred_url":"https://api.github.com/users/weblancaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weblancaster/subscriptions","organizations_url":"https://api.github.com/users/weblancaster/orgs","repos_url":"https://api.github.com/users/weblancaster/repos","events_url":"https://api.github.com/users/weblancaster/events{/privacy}","received_events_url":"https://api.github.com/users/weblancaster/received_events","type":"User","site_admin":false},"body":"Should we i18n this?","created_at":"2017-06-09T19:24:48Z","updated_at":"2017-06-09T19:24:48Z","html_url":"https://github.com/dcos/dcos-ui/pull/2245#discussion_r121204635","pull_request_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/2245","_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments/121204635"},"html":{"href":"https://github.com/dcos/dcos-ui/pull/2245#discussion_r121204635"},"pull_request":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/2245"}}},"pull_request":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/2245","id":124932136,"html_url":"https://github.com/dcos/dcos-ui/pull/2245","diff_url":"https://github.com/dcos/dcos-ui/pull/2245.diff","patch_url":"https://github.com/dcos/dcos-ui/pull/2245.patch","issue_url":"https://api.github.com/repos/dcos/dcos-ui/issues/2245","number":2245,"state":"open","locked":false,"title":"DCOS-11685: Disallow leading/trailing whitespace chars in label keys","user":{"login":"jfurrow","id":1134755,"avatar_url":"https://avatars0.githubusercontent.com/u/1134755?v=3","gravatar_id":"","url":"https://api.github.com/users/jfurrow","html_url":"https://github.com/jfurrow","followers_url":"https://api.github.com/users/jfurrow/followers","following_url":"https://api.github.com/users/jfurrow/following{/other_user}","gists_url":"https://api.github.com/users/jfurrow/gists{/gist_id}","starred_url":"https://api.github.com/users/jfurrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfurrow/subscriptions","organizations_url":"https://api.github.com/users/jfurrow/orgs","repos_url":"https://api.github.com/users/jfurrow/repos","events_url":"https://api.github.com/users/jfurrow/events{/privacy}","received_events_url":"https://api.github.com/users/jfurrow/received_events","type":"User","site_admin":false},"body":"This PR disallows leading & trailing whitespace characters in label keys.\r\n\r\n![](https://cl.ly/3T383C0R090K/Screen%20Shot%202017-06-09%20at%2012.10.43%20PM.png)\r\n\r\n**Checklist**\r\n- [x] Did you add a JIRA issue in a commit message or as part of the branch name?\r\n- [x] Did you add new unit tests?\r\n- [ ] Did you add new integration tests?\r\n- [ ] If this is a regression, did you write a test to catch this in the future?","created_at":"2017-06-09T19:11:04Z","updated_at":"2017-06-09T19:24:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03c7e8de012130dcf969bc01ee77ddc1285ffb5d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/2245/commits","review_comments_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/2245/comments","review_comment_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/issues/2245/comments","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/639c22cbcd34ac178611b7fadeba5f494c8dec7b","head":{"label":"dcos:john/feat/dcos-11685/disallow-leading-trailing-whitespace-chars-in-label-keys","ref":"john/feat/dcos-11685/disallow-leading-trailing-whitespace-chars-in-label-keys","sha":"639c22cbcd34ac178611b7fadeba5f494c8dec7b","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars2.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":56547504,"name":"dcos-ui","full_name":"dcos/dcos-ui","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars2.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos-ui","description":"The UI for The Datacenter Operating System","fork":false,"url":"https://api.github.com/repos/dcos/dcos-ui","forks_url":"https://api.github.com/repos/dcos/dcos-ui/forks","keys_url":"https://api.github.com/repos/dcos/dcos-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos-ui/teams","hooks_url":"https://api.github.com/repos/dcos/dcos-ui/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos-ui/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos-ui/events","assignees_url":"https://api.github.com/repos/dcos/dcos-ui/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos-ui/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos-ui/tags","blobs_url":"https://api.github.com/repos/dcos/dcos-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos-ui/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos-ui/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos-ui/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos-ui/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos-ui/subscription","commits_url":"https://api.github.com/repos/dcos/dcos-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos-ui/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos-ui/merges","archive_url":"https://api.github.com/repos/dcos/dcos-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos-ui/downloads","issues_url":"https://api.github.com/repos/dcos/dcos-ui/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos-ui/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos-ui/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos-ui/deployments","created_at":"2016-04-18T22:48:06Z","updated_at":"2017-05-31T18:32:18Z","pushed_at":"2017-06-09T19:18:05Z","git_url":"git://github.com/dcos/dcos-ui.git","ssh_url":"git@github.com:dcos/dcos-ui.git","clone_url":"https://github.com/dcos/dcos-ui.git","svn_url":"https://github.com/dcos/dcos-ui","homepage":"https://dcos.io/","size":34880,"stargazers_count":130,"watchers_count":130,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":16,"forks":37,"open_issues":16,"watchers":130,"default_branch":"master"}},"base":{"label":"dcos:master","ref":"master","sha":"1bbe9b5a67780112c74b7c4522f3dd43a40a0fc0","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars2.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":56547504,"name":"dcos-ui","full_name":"dcos/dcos-ui","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars2.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos-ui","description":"The UI for The Datacenter Operating System","fork":false,"url":"https://api.github.com/repos/dcos/dcos-ui","forks_url":"https://api.github.com/repos/dcos/dcos-ui/forks","keys_url":"https://api.github.com/repos/dcos/dcos-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos-ui/teams","hooks_url":"https://api.github.com/repos/dcos/dcos-ui/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos-ui/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos-ui/events","assignees_url":"https://api.github.com/repos/dcos/dcos-ui/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos-ui/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos-ui/tags","blobs_url":"https://api.github.com/repos/dcos/dcos-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos-ui/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos-ui/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos-ui/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos-ui/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos-ui/subscription","commits_url":"https://api.github.com/repos/dcos/dcos-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos-ui/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos-ui/merges","archive_url":"https://api.github.com/repos/dcos/dcos-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos-ui/downloads","issues_url":"https://api.github.com/repos/dcos/dcos-ui/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos-ui/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos-ui/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos-ui/deployments","created_at":"2016-04-18T22:48:06Z","updated_at":"2017-05-31T18:32:18Z","pushed_at":"2017-06-09T19:18:05Z","git_url":"git://github.com/dcos/dcos-ui.git","ssh_url":"git@github.com:dcos/dcos-ui.git","clone_url":"https://github.com/dcos/dcos-ui.git","svn_url":"https://github.com/dcos/dcos-ui","homepage":"https://dcos.io/","size":34880,"stargazers_count":130,"watchers_count":130,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":16,"forks":37,"open_issues":16,"watchers":130,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/2245"},"html":{"href":"https://github.com/dcos/dcos-ui/pull/2245"},"issue":{"href":"https://api.github.com/repos/dcos/dcos-ui/issues/2245"},"comments":{"href":"https://api.github.com/repos/dcos/dcos-ui/issues/2245/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/2245/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/2245/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/dcos-ui/statuses/639c22cbcd34ac178611b7fadeba5f494c8dec7b"}}}}
{"actor":{"display_login":"weblancaster"}}