{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments/92623756","pull_request_review_id":13142927,"id":92623756,"diff_hunk":"@@ -178,24 +178,25 @@ angular.module(\"openshiftConsole\")\n             };\n             return false;\n           }\n-          if (!item.metadata) {\n-            $scope.error = {\n-              message: \"Resource is missing metadata field.\"\n-            };\n-            return false;\n-          }\n-          // Validate if resource has 'name' field in its 'metadata', but it's not a List\n-          if (!item.metadata.name && !item.kind.endsWith(\"List\")) {\n-            $scope.error = {\n-              message: \"Resource name is missing in metadata field.\"\n-            };\n-            return false;\n-          }\n-          if (item.metadata.namespace && item.metadata.namespace !== $scope.projectName) {\n-            $scope.error = {\n-              message: item.kind + \" \" + item.metadata.name + \" can't be created in project \" + item.metadata.namespace + \". Can't create resource in different projects.\"\n-            };\n-            return false;\n+          if (!item.kind.endsWith(\"List\")) {","path":"app/scripts/directives/fromFile.js","position":22,"original_position":22,"commit_id":"c3d9de80f062f4bb6deb25441bbac9d6a138e1c0","original_commit_id":"c3d9de80f062f4bb6deb25441bbac9d6a138e1c0","user":{"login":"spadgett","id":1167259,"avatar_url":"https://avatars.githubusercontent.com/u/1167259?v=3","gravatar_id":"","url":"https://api.github.com/users/spadgett","html_url":"https://github.com/spadgett","followers_url":"https://api.github.com/users/spadgett/followers","following_url":"https://api.github.com/users/spadgett/following{/other_user}","gists_url":"https://api.github.com/users/spadgett/gists{/gist_id}","starred_url":"https://api.github.com/users/spadgett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spadgett/subscriptions","organizations_url":"https://api.github.com/users/spadgett/orgs","repos_url":"https://api.github.com/users/spadgett/repos","events_url":"https://api.github.com/users/spadgett/events{/privacy}","received_events_url":"https://api.github.com/users/spadgett/received_events","type":"User","site_admin":false},"body":"I'd rather return early here.\r\n\r\n```js\r\nif (item.kind.endsWith(\"List\")) {\r\n  // Nothing else to check for lists.\r\n  return true;\r\n}\r\n```\r\n\r\nInstead of having a large `if` block. It's easier to reason about this way.","created_at":"2016-12-15T14:54:50Z","updated_at":"2016-12-15T14:54:50Z","html_url":"https://github.com/openshift/origin-web-console/pull/1043#discussion_r92623756","pull_request_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/1043","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments/92623756"},"html":{"href":"https://github.com/openshift/origin-web-console/pull/1043#discussion_r92623756"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/1043"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin-web-console/pulls/1043","id":98158704,"html_url":"https://github.com/openshift/origin-web-console/pull/1043","diff_url":"https://github.com/openshift/origin-web-console/pull/1043.diff","patch_url":"https://github.com/openshift/origin-web-console/pull/1043.patch","issue_url":"https://api.github.com/repos/openshift/origin-web-console/issues/1043","number":1043,"state":"open","locked":false,"title":"Create List without metadata field on fromFile page","user":{"login":"jhadvig","id":1668218,"avatar_url":"https://avatars.githubusercontent.com/u/1668218?v=3","gravatar_id":"","url":"https://api.github.com/users/jhadvig","html_url":"https://github.com/jhadvig","followers_url":"https://api.github.com/users/jhadvig/followers","following_url":"https://api.github.com/users/jhadvig/following{/other_user}","gists_url":"https://api.github.com/users/jhadvig/gists{/gist_id}","starred_url":"https://api.github.com/users/jhadvig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhadvig/subscriptions","organizations_url":"https://api.github.com/users/jhadvig/orgs","repos_url":"https://api.github.com/users/jhadvig/repos","events_url":"https://api.github.com/users/jhadvig/events{/privacy}","received_events_url":"https://api.github.com/users/jhadvig/received_events","type":"User","site_admin":false},"body":"@spadgett PTAL\r\n\r\ncloses https://github.com/openshift/origin-web-console/issues/1038","created_at":"2016-12-15T14:19:00Z","updated_at":"2016-12-15T14:54:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9441d73e64fed9758c91b9729bea2286620c506b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/1043/commits","review_comments_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/1043/comments","review_comment_url":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin-web-console/issues/1043/comments","statuses_url":"https://api.github.com/repos/openshift/origin-web-console/statuses/c3d9de80f062f4bb6deb25441bbac9d6a138e1c0","head":{"label":"jhadvig:listWithoutMeta","ref":"listWithoutMeta","sha":"c3d9de80f062f4bb6deb25441bbac9d6a138e1c0","user":{"login":"jhadvig","id":1668218,"avatar_url":"https://avatars.githubusercontent.com/u/1668218?v=3","gravatar_id":"","url":"https://api.github.com/users/jhadvig","html_url":"https://github.com/jhadvig","followers_url":"https://api.github.com/users/jhadvig/followers","following_url":"https://api.github.com/users/jhadvig/following{/other_user}","gists_url":"https://api.github.com/users/jhadvig/gists{/gist_id}","starred_url":"https://api.github.com/users/jhadvig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhadvig/subscriptions","organizations_url":"https://api.github.com/users/jhadvig/orgs","repos_url":"https://api.github.com/users/jhadvig/repos","events_url":"https://api.github.com/users/jhadvig/events{/privacy}","received_events_url":"https://api.github.com/users/jhadvig/received_events","type":"User","site_admin":false},"repo":{"id":58534077,"name":"origin-web-console","full_name":"jhadvig/origin-web-console","owner":{"login":"jhadvig","id":1668218,"avatar_url":"https://avatars.githubusercontent.com/u/1668218?v=3","gravatar_id":"","url":"https://api.github.com/users/jhadvig","html_url":"https://github.com/jhadvig","followers_url":"https://api.github.com/users/jhadvig/followers","following_url":"https://api.github.com/users/jhadvig/following{/other_user}","gists_url":"https://api.github.com/users/jhadvig/gists{/gist_id}","starred_url":"https://api.github.com/users/jhadvig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhadvig/subscriptions","organizations_url":"https://api.github.com/users/jhadvig/orgs","repos_url":"https://api.github.com/users/jhadvig/repos","events_url":"https://api.github.com/users/jhadvig/events{/privacy}","received_events_url":"https://api.github.com/users/jhadvig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhadvig/origin-web-console","description":null,"fork":true,"url":"https://api.github.com/repos/jhadvig/origin-web-console","forks_url":"https://api.github.com/repos/jhadvig/origin-web-console/forks","keys_url":"https://api.github.com/repos/jhadvig/origin-web-console/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhadvig/origin-web-console/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhadvig/origin-web-console/teams","hooks_url":"https://api.github.com/repos/jhadvig/origin-web-console/hooks","issue_events_url":"https://api.github.com/repos/jhadvig/origin-web-console/issues/events{/number}","events_url":"https://api.github.com/repos/jhadvig/origin-web-console/events","assignees_url":"https://api.github.com/repos/jhadvig/origin-web-console/assignees{/user}","branches_url":"https://api.github.com/repos/jhadvig/origin-web-console/branches{/branch}","tags_url":"https://api.github.com/repos/jhadvig/origin-web-console/tags","blobs_url":"https://api.github.com/repos/jhadvig/origin-web-console/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhadvig/origin-web-console/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhadvig/origin-web-console/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhadvig/origin-web-console/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhadvig/origin-web-console/statuses/{sha}","languages_url":"https://api.github.com/repos/jhadvig/origin-web-console/languages","stargazers_url":"https://api.github.com/repos/jhadvig/origin-web-console/stargazers","contributors_url":"https://api.github.com/repos/jhadvig/origin-web-console/contributors","subscribers_url":"https://api.github.com/repos/jhadvig/origin-web-console/subscribers","subscription_url":"https://api.github.com/repos/jhadvig/origin-web-console/subscription","commits_url":"https://api.github.com/repos/jhadvig/origin-web-console/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhadvig/origin-web-console/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhadvig/origin-web-console/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhadvig/origin-web-console/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhadvig/origin-web-console/contents/{+path}","compare_url":"https://api.github.com/repos/jhadvig/origin-web-console/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhadvig/origin-web-console/merges","archive_url":"https://api.github.com/repos/jhadvig/origin-web-console/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhadvig/origin-web-console/downloads","issues_url":"https://api.github.com/repos/jhadvig/origin-web-console/issues{/number}","pulls_url":"https://api.github.com/repos/jhadvig/origin-web-console/pulls{/number}","milestones_url":"https://api.github.com/repos/jhadvig/origin-web-console/milestones{/number}","notifications_url":"https://api.github.com/repos/jhadvig/origin-web-console/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhadvig/origin-web-console/labels{/name}","releases_url":"https://api.github.com/repos/jhadvig/origin-web-console/releases{/id}","deployments_url":"https://api.github.com/repos/jhadvig/origin-web-console/deployments","created_at":"2016-05-11T10:03:41Z","updated_at":"2016-05-11T10:03:42Z","pushed_at":"2016-12-15T14:19:50Z","git_url":"git://github.com/jhadvig/origin-web-console.git","ssh_url":"git@github.com:jhadvig/origin-web-console.git","clone_url":"https://github.com/jhadvig/origin-web-console.git","svn_url":"https://github.com/jhadvig/origin-web-console","homepage":null,"size":21520,"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":"openshift:master","ref":"master","sha":"8e405523fe7ca626000bbd6fbb69ad79c1fce453","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":58488264,"name":"origin-web-console","full_name":"openshift/origin-web-console","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin-web-console","description":null,"fork":false,"url":"https://api.github.com/repos/openshift/origin-web-console","forks_url":"https://api.github.com/repos/openshift/origin-web-console/forks","keys_url":"https://api.github.com/repos/openshift/origin-web-console/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin-web-console/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin-web-console/teams","hooks_url":"https://api.github.com/repos/openshift/origin-web-console/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin-web-console/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin-web-console/events","assignees_url":"https://api.github.com/repos/openshift/origin-web-console/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin-web-console/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin-web-console/tags","blobs_url":"https://api.github.com/repos/openshift/origin-web-console/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin-web-console/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin-web-console/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin-web-console/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin-web-console/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin-web-console/languages","stargazers_url":"https://api.github.com/repos/openshift/origin-web-console/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin-web-console/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin-web-console/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin-web-console/subscription","commits_url":"https://api.github.com/repos/openshift/origin-web-console/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin-web-console/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin-web-console/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin-web-console/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin-web-console/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin-web-console/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin-web-console/merges","archive_url":"https://api.github.com/repos/openshift/origin-web-console/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin-web-console/downloads","issues_url":"https://api.github.com/repos/openshift/origin-web-console/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin-web-console/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin-web-console/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin-web-console/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin-web-console/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin-web-console/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin-web-console/deployments","created_at":"2016-05-10T19:31:50Z","updated_at":"2016-12-14T06:01:10Z","pushed_at":"2016-12-15T14:52:38Z","git_url":"git://github.com/openshift/origin-web-console.git","ssh_url":"git@github.com:openshift/origin-web-console.git","clone_url":"https://github.com/openshift/origin-web-console.git","svn_url":"https://github.com/openshift/origin-web-console","homepage":null,"size":22271,"stargazers_count":25,"watchers_count":25,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":80,"forks":62,"open_issues":80,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/1043"},"html":{"href":"https://github.com/openshift/origin-web-console/pull/1043"},"issue":{"href":"https://api.github.com/repos/openshift/origin-web-console/issues/1043"},"comments":{"href":"https://api.github.com/repos/openshift/origin-web-console/issues/1043/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/1043/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin-web-console/pulls/1043/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin-web-console/statuses/c3d9de80f062f4bb6deb25441bbac9d6a138e1c0"}}}}
{"actor":{"display_login":"spadgett"}}