{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments/147854382","pull_request_review_id":73009544,"id":147854382,"diff_hunk":"@@ -0,0 +1,54 @@\n+#!/bin/bash\n+\n+# Copyright 2014 The Kubernetes Authors.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+# This script makes sure each versioned API in service catalog\n+#has as json tag\n+\n+set -o errexit\n+set -o nounset\n+set -o pipefail\n+\n+result=0\n+\n+find_files() {\n+  find . -not \\( \\\n+      \\( \\\n+        -wholename './output' \\\n+        -o -wholename './_gopath' \\\n+        -o -wholename './release' \\\n+        -o -wholename './target' \\\n+        -o -wholename '*/vendor/*' \\\n+      \\) -prune \\\n+    \\) \\\n+    \\( -wholename '*pkg/api/v*/types.go' \\\n+       -o -wholename '*pkg/apis/*/v*/types.go' \\\n+       -o -wholename '*pkg/api/unversioned/types.go' \\\n+    \\)\n+}\n+\n+if [[ $# -eq 0 ]]; then\n+  versioned_api_files=$(find_files | egrep \"pkg/(.[^/]*)+/((v.[^/]*)|unversioned)/types\\.go\")\n+else\n+  versioned_api_files=\"${*}\"\n+fi\n+\n+for file in $versioned_api_files; do\n+  if cat -n \"${file}\" | tail -n +22 | grep -v \"^\\s*[0-9]*\\s$\" | egrep -v \"(\\/\\/|{|}|\\(|\\)|type|=)\" | grep -v json; then ","path":"build/verify-tags.sh","position":49,"original_position":49,"commit_id":"0fb3f326f4e459c3058ac43ee42304e0001b5d53","original_commit_id":"0fb3f326f4e459c3058ac43ee42304e0001b5d53","user":{"login":"crmejia","id":4006175,"avatar_url":"https://avatars2.githubusercontent.com/u/4006175?v=4","gravatar_id":"","url":"https://api.github.com/users/crmejia","html_url":"https://github.com/crmejia","followers_url":"https://api.github.com/users/crmejia/followers","following_url":"https://api.github.com/users/crmejia/following{/other_user}","gists_url":"https://api.github.com/users/crmejia/gists{/gist_id}","starred_url":"https://api.github.com/users/crmejia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crmejia/subscriptions","organizations_url":"https://api.github.com/users/crmejia/orgs","repos_url":"https://api.github.com/users/crmejia/repos","events_url":"https://api.github.com/users/crmejia/events{/privacy}","received_events_url":"https://api.github.com/users/crmejia/received_events","type":"User","site_admin":false},"body":"The number represents the line after the license and the import. I'll do `sed` instead so is more reliable.\r\n\r\nThe output would look like:\r\n```\r\n    43          metav1.TypeMeta\r\n    98          Basic *BasicAuthConfig\r\n   102          Bearer *BearerTokenAuthConfig\r\n   206          metav1.TypeMeta\r\nVersioned APIs should contain json tags for fields in file ./pkg/apis/servicecatalog/v1beta1/types.go\r\n```\r\n","created_at":"2017-10-30T22:39:33Z","updated_at":"2017-10-30T22:39:34Z","html_url":"https://github.com/kubernetes-incubator/service-catalog/pull/1480#discussion_r147854382","pull_request_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1480","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments/147854382"},"html":{"href":"https://github.com/kubernetes-incubator/service-catalog/pull/1480#discussion_r147854382"},"pull_request":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1480"}},"in_reply_to_id":147331519},"pull_request":{"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1480","id":148813571,"html_url":"https://github.com/kubernetes-incubator/service-catalog/pull/1480","diff_url":"https://github.com/kubernetes-incubator/service-catalog/pull/1480.diff","patch_url":"https://github.com/kubernetes-incubator/service-catalog/pull/1480.patch","issue_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/1480","number":1480,"state":"open","locked":false,"title":"make verify validates that versioned APIs contain json tags for fields, addresses #1303","user":{"login":"crmejia","id":4006175,"avatar_url":"https://avatars2.githubusercontent.com/u/4006175?v=4","gravatar_id":"","url":"https://api.github.com/users/crmejia","html_url":"https://github.com/crmejia","followers_url":"https://api.github.com/users/crmejia/followers","following_url":"https://api.github.com/users/crmejia/following{/other_user}","gists_url":"https://api.github.com/users/crmejia/gists{/gist_id}","starred_url":"https://api.github.com/users/crmejia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crmejia/subscriptions","organizations_url":"https://api.github.com/users/crmejia/orgs","repos_url":"https://api.github.com/users/crmejia/repos","events_url":"https://api.github.com/users/crmejia/events{/privacy}","received_events_url":"https://api.github.com/users/crmejia/received_events","type":"User","site_admin":false},"body":"Closes #1303 \r\n\r\nIt works. However, I'm looking for feedback on the way I went about it. See code comments.\r\n\r\nBased on a good ol' 'netes script https://github.com/kubernetes/kubernetes/blob/master/hack/verify-description.sh","created_at":"2017-10-26T00:41:25Z","updated_at":"2017-10-30T22:39:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9e9317afa1aa862bd7b961933e4457a7e887c0e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1480/commits","review_comments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1480/comments","review_comment_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/1480/comments","statuses_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/0fb3f326f4e459c3058ac43ee42304e0001b5d53","head":{"label":"crmejia:issue_1303","ref":"issue_1303","sha":"0fb3f326f4e459c3058ac43ee42304e0001b5d53","user":{"login":"crmejia","id":4006175,"avatar_url":"https://avatars2.githubusercontent.com/u/4006175?v=4","gravatar_id":"","url":"https://api.github.com/users/crmejia","html_url":"https://github.com/crmejia","followers_url":"https://api.github.com/users/crmejia/followers","following_url":"https://api.github.com/users/crmejia/following{/other_user}","gists_url":"https://api.github.com/users/crmejia/gists{/gist_id}","starred_url":"https://api.github.com/users/crmejia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crmejia/subscriptions","organizations_url":"https://api.github.com/users/crmejia/orgs","repos_url":"https://api.github.com/users/crmejia/repos","events_url":"https://api.github.com/users/crmejia/events{/privacy}","received_events_url":"https://api.github.com/users/crmejia/received_events","type":"User","site_admin":false},"repo":{"id":99742371,"name":"service-catalog","full_name":"crmejia/service-catalog","owner":{"login":"crmejia","id":4006175,"avatar_url":"https://avatars2.githubusercontent.com/u/4006175?v=4","gravatar_id":"","url":"https://api.github.com/users/crmejia","html_url":"https://github.com/crmejia","followers_url":"https://api.github.com/users/crmejia/followers","following_url":"https://api.github.com/users/crmejia/following{/other_user}","gists_url":"https://api.github.com/users/crmejia/gists{/gist_id}","starred_url":"https://api.github.com/users/crmejia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crmejia/subscriptions","organizations_url":"https://api.github.com/users/crmejia/orgs","repos_url":"https://api.github.com/users/crmejia/repos","events_url":"https://api.github.com/users/crmejia/events{/privacy}","received_events_url":"https://api.github.com/users/crmejia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/crmejia/service-catalog","description":"Consume services in Kubernetes using the Open Service Broker API","fork":true,"url":"https://api.github.com/repos/crmejia/service-catalog","forks_url":"https://api.github.com/repos/crmejia/service-catalog/forks","keys_url":"https://api.github.com/repos/crmejia/service-catalog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crmejia/service-catalog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crmejia/service-catalog/teams","hooks_url":"https://api.github.com/repos/crmejia/service-catalog/hooks","issue_events_url":"https://api.github.com/repos/crmejia/service-catalog/issues/events{/number}","events_url":"https://api.github.com/repos/crmejia/service-catalog/events","assignees_url":"https://api.github.com/repos/crmejia/service-catalog/assignees{/user}","branches_url":"https://api.github.com/repos/crmejia/service-catalog/branches{/branch}","tags_url":"https://api.github.com/repos/crmejia/service-catalog/tags","blobs_url":"https://api.github.com/repos/crmejia/service-catalog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crmejia/service-catalog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crmejia/service-catalog/git/refs{/sha}","trees_url":"https://api.github.com/repos/crmejia/service-catalog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crmejia/service-catalog/statuses/{sha}","languages_url":"https://api.github.com/repos/crmejia/service-catalog/languages","stargazers_url":"https://api.github.com/repos/crmejia/service-catalog/stargazers","contributors_url":"https://api.github.com/repos/crmejia/service-catalog/contributors","subscribers_url":"https://api.github.com/repos/crmejia/service-catalog/subscribers","subscription_url":"https://api.github.com/repos/crmejia/service-catalog/subscription","commits_url":"https://api.github.com/repos/crmejia/service-catalog/commits{/sha}","git_commits_url":"https://api.github.com/repos/crmejia/service-catalog/git/commits{/sha}","comments_url":"https://api.github.com/repos/crmejia/service-catalog/comments{/number}","issue_comment_url":"https://api.github.com/repos/crmejia/service-catalog/issues/comments{/number}","contents_url":"https://api.github.com/repos/crmejia/service-catalog/contents/{+path}","compare_url":"https://api.github.com/repos/crmejia/service-catalog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crmejia/service-catalog/merges","archive_url":"https://api.github.com/repos/crmejia/service-catalog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crmejia/service-catalog/downloads","issues_url":"https://api.github.com/repos/crmejia/service-catalog/issues{/number}","pulls_url":"https://api.github.com/repos/crmejia/service-catalog/pulls{/number}","milestones_url":"https://api.github.com/repos/crmejia/service-catalog/milestones{/number}","notifications_url":"https://api.github.com/repos/crmejia/service-catalog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crmejia/service-catalog/labels{/name}","releases_url":"https://api.github.com/repos/crmejia/service-catalog/releases{/id}","deployments_url":"https://api.github.com/repos/crmejia/service-catalog/deployments","created_at":"2017-08-08T22:44:29Z","updated_at":"2017-08-08T22:44:32Z","pushed_at":"2017-10-27T01:55:26Z","git_url":"git://github.com/crmejia/service-catalog.git","ssh_url":"git@github.com:crmejia/service-catalog.git","clone_url":"https://github.com/crmejia/service-catalog.git","svn_url":"https://github.com/crmejia/service-catalog","homepage":"","size":93665,"stargazers_count":0,"watchers_count":0,"language":"Go","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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes-incubator:master","ref":"master","sha":"8448f89d63459887e0d3f08219829fbc4d6b6f6a","user":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars2.githubusercontent.com/u/20862812?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":68024288,"name":"service-catalog","full_name":"kubernetes-incubator/service-catalog","owner":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars2.githubusercontent.com/u/20862812?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes-incubator/service-catalog","description":"Consume services in Kubernetes using the Open Service Broker API","fork":false,"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog","forks_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/forks","keys_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/teams","hooks_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/hooks","issue_events_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/events","assignees_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/tags","blobs_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/languages","stargazers_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/stargazers","contributors_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/contributors","subscribers_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/subscribers","subscription_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/subscription","commits_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/merges","archive_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/downloads","issues_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/deployments","created_at":"2016-09-12T15:58:39Z","updated_at":"2017-10-30T14:10:22Z","pushed_at":"2017-10-30T22:29:16Z","git_url":"git://github.com/kubernetes-incubator/service-catalog.git","ssh_url":"git@github.com:kubernetes-incubator/service-catalog.git","clone_url":"https://github.com/kubernetes-incubator/service-catalog.git","svn_url":"https://github.com/kubernetes-incubator/service-catalog","homepage":"","size":93735,"stargazers_count":277,"watchers_count":277,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":122,"mirror_url":null,"archived":false,"open_issues_count":175,"forks":122,"open_issues":175,"watchers":277,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1480"},"html":{"href":"https://github.com/kubernetes-incubator/service-catalog/pull/1480"},"issue":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/1480"},"comments":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/1480/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1480/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1480/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/0fb3f326f4e459c3058ac43ee42304e0001b5d53"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"crmejia"}}