{"action":"created","comment":{"url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/comments/204606124","pull_request_review_id":139714736,"id":204606124,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDYwNjEyNA==","diff_hunk":"@@ -105,6 +105,17 @@ std::string Environment::GetMetadataString(const std::string& path) const {\n   }\n }\n \n+bool Environment::IsGcpLocationZonal(const std::string& location) const {\n+  // Use the number of dashes to distinguish between zones (e.g.\n+  // \"us-central1-a\", \"us-east1-b\") and regions (e.g.\"us-central1\", \"us-east1\").\n+  int num_dashes = std::count(location.begin(), location.end(), '-');\n+  if (num_dashes > 2) {\n+    LOG(WARNING) << \"Found more than two dashes in the GCP location: \"","path":"src/environment.cc","position":null,"original_position":9,"commit_id":"faab413faf43575cc645b6a7e6a6dc5a5feac1af","original_commit_id":"3fdcc7bbca10e9df53eaf5491b0b30fc2fea876d","user":{"login":"supriyagarg","id":11726936,"node_id":"MDQ6VXNlcjExNzI2OTM2","avatar_url":"https://avatars2.githubusercontent.com/u/11726936?v=4","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2018-07-24T02:17:50Z","updated_at":"2018-07-24T02:19:09Z","html_url":"https://github.com/Stackdriver/metadata-agent/pull/172#discussion_r204606124","pull_request_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/172","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/comments/204606124"},"html":{"href":"https://github.com/Stackdriver/metadata-agent/pull/172#discussion_r204606124"},"pull_request":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/172"}},"in_reply_to_id":204595577},"pull_request":{"url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/172","id":203360444,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMzYwNDQ0","html_url":"https://github.com/Stackdriver/metadata-agent/pull/172","diff_url":"https://github.com/Stackdriver/metadata-agent/pull/172.diff","patch_url":"https://github.com/Stackdriver/metadata-agent/pull/172.patch","issue_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/172","number":172,"state":"open","locked":false,"title":"Add GCP helper functions to environment.cc","user":{"login":"supriyagarg","id":11726936,"node_id":"MDQ6VXNlcjExNzI2OTM2","avatar_url":"https://avatars2.githubusercontent.com/u/11726936?v=4","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-23T22:22:01Z","updated_at":"2018-07-24T02:19:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce942428522116309faefa7bfd1b354d3bf7f71f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":971766958,"node_id":"MDU6TGFiZWw5NzE3NjY5NTg=","url":"https://api.github.com/repos/Stackdriver/metadata-agent/labels/v1beta3","name":"v1beta3","color":"d3a03b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/172/commits","review_comments_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/172/comments","review_comment_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/172/comments","statuses_url":"https://api.github.com/repos/Stackdriver/metadata-agent/statuses/faab413faf43575cc645b6a7e6a6dc5a5feac1af","head":{"label":"supriyagarg:gcp_locations","ref":"gcp_locations","sha":"faab413faf43575cc645b6a7e6a6dc5a5feac1af","user":{"login":"supriyagarg","id":11726936,"node_id":"MDQ6VXNlcjExNzI2OTM2","avatar_url":"https://avatars2.githubusercontent.com/u/11726936?v=4","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"repo":{"id":118942349,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg5NDIzNDk=","name":"metadata-agent","full_name":"supriyagarg/metadata-agent","owner":{"login":"supriyagarg","id":11726936,"node_id":"MDQ6VXNlcjExNzI2OTM2","avatar_url":"https://avatars2.githubusercontent.com/u/11726936?v=4","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/supriyagarg/metadata-agent","description":"Stackdriver metadata agent","fork":true,"url":"https://api.github.com/repos/supriyagarg/metadata-agent","forks_url":"https://api.github.com/repos/supriyagarg/metadata-agent/forks","keys_url":"https://api.github.com/repos/supriyagarg/metadata-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/supriyagarg/metadata-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/supriyagarg/metadata-agent/teams","hooks_url":"https://api.github.com/repos/supriyagarg/metadata-agent/hooks","issue_events_url":"https://api.github.com/repos/supriyagarg/metadata-agent/issues/events{/number}","events_url":"https://api.github.com/repos/supriyagarg/metadata-agent/events","assignees_url":"https://api.github.com/repos/supriyagarg/metadata-agent/assignees{/user}","branches_url":"https://api.github.com/repos/supriyagarg/metadata-agent/branches{/branch}","tags_url":"https://api.github.com/repos/supriyagarg/metadata-agent/tags","blobs_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/supriyagarg/metadata-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/supriyagarg/metadata-agent/languages","stargazers_url":"https://api.github.com/repos/supriyagarg/metadata-agent/stargazers","contributors_url":"https://api.github.com/repos/supriyagarg/metadata-agent/contributors","subscribers_url":"https://api.github.com/repos/supriyagarg/metadata-agent/subscribers","subscription_url":"https://api.github.com/repos/supriyagarg/metadata-agent/subscription","commits_url":"https://api.github.com/repos/supriyagarg/metadata-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/supriyagarg/metadata-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/supriyagarg/metadata-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/supriyagarg/metadata-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/supriyagarg/metadata-agent/contents/{+path}","compare_url":"https://api.github.com/repos/supriyagarg/metadata-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/supriyagarg/metadata-agent/merges","archive_url":"https://api.github.com/repos/supriyagarg/metadata-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/supriyagarg/metadata-agent/downloads","issues_url":"https://api.github.com/repos/supriyagarg/metadata-agent/issues{/number}","pulls_url":"https://api.github.com/repos/supriyagarg/metadata-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/supriyagarg/metadata-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/supriyagarg/metadata-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/supriyagarg/metadata-agent/labels{/name}","releases_url":"https://api.github.com/repos/supriyagarg/metadata-agent/releases{/id}","deployments_url":"https://api.github.com/repos/supriyagarg/metadata-agent/deployments","created_at":"2018-01-25T17:03:49Z","updated_at":"2018-07-23T21:50:16Z","pushed_at":"2018-07-24T02:18:48Z","git_url":"git://github.com/supriyagarg/metadata-agent.git","ssh_url":"git@github.com:supriyagarg/metadata-agent.git","clone_url":"https://github.com/supriyagarg/metadata-agent.git","svn_url":"https://github.com/supriyagarg/metadata-agent","homepage":"","size":538,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Stackdriver:v1beta3-working-branch","ref":"v1beta3-working-branch","sha":"4acdb705c86ea71370a7204a691981b948e8aceb","user":{"login":"Stackdriver","id":2104369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDQzNjk=","avatar_url":"https://avatars3.githubusercontent.com/u/2104369?v=4","gravatar_id":"","url":"https://api.github.com/users/Stackdriver","html_url":"https://github.com/Stackdriver","followers_url":"https://api.github.com/users/Stackdriver/followers","following_url":"https://api.github.com/users/Stackdriver/following{/other_user}","gists_url":"https://api.github.com/users/Stackdriver/gists{/gist_id}","starred_url":"https://api.github.com/users/Stackdriver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stackdriver/subscriptions","organizations_url":"https://api.github.com/users/Stackdriver/orgs","repos_url":"https://api.github.com/users/Stackdriver/repos","events_url":"https://api.github.com/users/Stackdriver/events{/privacy}","received_events_url":"https://api.github.com/users/Stackdriver/received_events","type":"Organization","site_admin":false},"repo":{"id":81396310,"node_id":"MDEwOlJlcG9zaXRvcnk4MTM5NjMxMA==","name":"metadata-agent","full_name":"Stackdriver/metadata-agent","owner":{"login":"Stackdriver","id":2104369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDQzNjk=","avatar_url":"https://avatars3.githubusercontent.com/u/2104369?v=4","gravatar_id":"","url":"https://api.github.com/users/Stackdriver","html_url":"https://github.com/Stackdriver","followers_url":"https://api.github.com/users/Stackdriver/followers","following_url":"https://api.github.com/users/Stackdriver/following{/other_user}","gists_url":"https://api.github.com/users/Stackdriver/gists{/gist_id}","starred_url":"https://api.github.com/users/Stackdriver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stackdriver/subscriptions","organizations_url":"https://api.github.com/users/Stackdriver/orgs","repos_url":"https://api.github.com/users/Stackdriver/repos","events_url":"https://api.github.com/users/Stackdriver/events{/privacy}","received_events_url":"https://api.github.com/users/Stackdriver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Stackdriver/metadata-agent","description":"Stackdriver metadata agent","fork":false,"url":"https://api.github.com/repos/Stackdriver/metadata-agent","forks_url":"https://api.github.com/repos/Stackdriver/metadata-agent/forks","keys_url":"https://api.github.com/repos/Stackdriver/metadata-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Stackdriver/metadata-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Stackdriver/metadata-agent/teams","hooks_url":"https://api.github.com/repos/Stackdriver/metadata-agent/hooks","issue_events_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/events{/number}","events_url":"https://api.github.com/repos/Stackdriver/metadata-agent/events","assignees_url":"https://api.github.com/repos/Stackdriver/metadata-agent/assignees{/user}","branches_url":"https://api.github.com/repos/Stackdriver/metadata-agent/branches{/branch}","tags_url":"https://api.github.com/repos/Stackdriver/metadata-agent/tags","blobs_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Stackdriver/metadata-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/Stackdriver/metadata-agent/languages","stargazers_url":"https://api.github.com/repos/Stackdriver/metadata-agent/stargazers","contributors_url":"https://api.github.com/repos/Stackdriver/metadata-agent/contributors","subscribers_url":"https://api.github.com/repos/Stackdriver/metadata-agent/subscribers","subscription_url":"https://api.github.com/repos/Stackdriver/metadata-agent/subscription","commits_url":"https://api.github.com/repos/Stackdriver/metadata-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Stackdriver/metadata-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Stackdriver/metadata-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Stackdriver/metadata-agent/contents/{+path}","compare_url":"https://api.github.com/repos/Stackdriver/metadata-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Stackdriver/metadata-agent/merges","archive_url":"https://api.github.com/repos/Stackdriver/metadata-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Stackdriver/metadata-agent/downloads","issues_url":"https://api.github.com/repos/Stackdriver/metadata-agent/issues{/number}","pulls_url":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/Stackdriver/metadata-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/Stackdriver/metadata-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Stackdriver/metadata-agent/labels{/name}","releases_url":"https://api.github.com/repos/Stackdriver/metadata-agent/releases{/id}","deployments_url":"https://api.github.com/repos/Stackdriver/metadata-agent/deployments","created_at":"2017-02-09T01:48:50Z","updated_at":"2018-07-23T22:45:49Z","pushed_at":"2018-07-24T02:18:50Z","git_url":"git://github.com/Stackdriver/metadata-agent.git","ssh_url":"git@github.com:Stackdriver/metadata-agent.git","clone_url":"https://github.com/Stackdriver/metadata-agent.git","svn_url":"https://github.com/Stackdriver/metadata-agent","homepage":"","size":541,"stargazers_count":10,"watchers_count":10,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":6,"open_issues":12,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/172"},"html":{"href":"https://github.com/Stackdriver/metadata-agent/pull/172"},"issue":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/172"},"comments":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/issues/172/comments"},"review_comments":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/172/comments"},"review_comment":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/pulls/172/commits"},"statuses":{"href":"https://api.github.com/repos/Stackdriver/metadata-agent/statuses/faab413faf43575cc645b6a7e6a6dc5a5feac1af"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"supriyagarg"}}