{"action":"created","comment":{"url":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/comments/59606259","id":59606259,"diff_hunk":"@@ -162,16 +163,10 @@ def action_handler\n     @action_handler ||= Chef::Provisioning::ChefProviderActionHandler.new(self)\n   end\n \n-  # TODO de-dup with driver or abstract to base class\n-  # TODO update to take the full operation body\n-  def wait_for_operation(operation_id)\n-    Retryable.retryable(:tries => 30, :sleep => 5, :matching => /Not done/) do |retries, exception|\n-      action_handler.report_progress(\"  waited #{retries*5}/#{30*5}s for operation #{operation_id} to complete\")\n-      # TODO it is really awesome that there are 3 types of operations, and the only way of telling\n-      # which is which is to parse the full `:selfLink` from the response body\n-      operation = driver.operations_client.global_get(operation_id)\n-      raise \"Not done\" unless operation[:body][:status] == \"DONE\"\n-      operation\n+  def reupload_metadata(metadata)\n+    converge_by 'reuploading changed metadata' do\n+      operation = driver.projects_client.set_common_instance_metadata(metadata)","path":"lib/chef/provider/google_key_pair.rb","position":null,"original_position":91,"commit_id":"9688fe7ba68e21160550a6315122b4faab0f9de1","original_commit_id":"991ac7266a71f101da8cb310e140dcd66bc0d43d","user":{"login":"Lykos","id":235985,"avatar_url":"https://avatars.githubusercontent.com/u/235985?v=3","gravatar_id":"","url":"https://api.github.com/users/Lykos","html_url":"https://github.com/Lykos","followers_url":"https://api.github.com/users/Lykos/followers","following_url":"https://api.github.com/users/Lykos/following{/other_user}","gists_url":"https://api.github.com/users/Lykos/gists{/gist_id}","starred_url":"https://api.github.com/users/Lykos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lykos/subscriptions","organizations_url":"https://api.github.com/users/Lykos/orgs","repos_url":"https://api.github.com/users/Lykos/repos","events_url":"https://api.github.com/users/Lykos/events{/privacy}","received_events_url":"https://api.github.com/users/Lykos/received_events","type":"User","site_admin":false},"body":"Fixed. I don't know what exactly I did, I thought I ran it and it worked, but apparently I ran something else... But now it works definitely.","created_at":"2016-04-13T19:02:43Z","updated_at":"2016-04-13T19:02:43Z","html_url":"https://github.com/chef/chef-provisioning-google/pull/5#discussion_r59606259","pull_request_url":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/comments/59606259"},"html":{"href":"https://github.com/chef/chef-provisioning-google/pull/5#discussion_r59606259"},"pull_request":{"href":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/5","id":59205194,"html_url":"https://github.com/chef/chef-provisioning-google/pull/5","diff_url":"https://github.com/chef/chef-provisioning-google/pull/5.diff","patch_url":"https://github.com/chef/chef-provisioning-google/pull/5.patch","issue_url":"https://api.github.com/repos/chef/chef-provisioning-google/issues/5","number":5,"state":"open","locked":false,"title":"Refactored the client code and added tests","user":{"login":"Lykos","id":235985,"avatar_url":"https://avatars.githubusercontent.com/u/235985?v=3","gravatar_id":"","url":"https://api.github.com/users/Lykos","html_url":"https://github.com/Lykos","followers_url":"https://api.github.com/users/Lykos/followers","following_url":"https://api.github.com/users/Lykos/following{/other_user}","gists_url":"https://api.github.com/users/Lykos/gists{/gist_id}","starred_url":"https://api.github.com/users/Lykos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lykos/subscriptions","organizations_url":"https://api.github.com/users/Lykos/orgs","repos_url":"https://api.github.com/users/Lykos/repos","events_url":"https://api.github.com/users/Lykos/events{/privacy}","received_events_url":"https://api.github.com/users/Lykos/received_events","type":"User","site_admin":false},"body":"- DRYed up the client code by moving some common stuff to the base class.\r\n- Introduced our own exception class. It still needs to be fleshed out to properly parse API responses, though.\r\n- Moved some logic that doesn't belong to the driver to the client code, e.g. the retry logic for API calls. There is still a bit more to be done on this point.\r\n- Made the connection between our client code and the google API easier to understand by having one class for one API service. Before, there was the operations client which wrapped both the global_operations and the zone_operations service.\r\n- Some of the client code returns relatively complicated hashes that are accessed in different places across the code. To make this more manageable, I created wrapper objects for those hashes, so the code to access the internals of those hashes is in one place. E.g. extracting an IP address for an instance from the hash returned by the API is a bit complicated, now the wrapper class Instance provides a method determine_remote_host that does this.\r\n- Refactored the way the metadata API works. Before, each metadata change triggered two API calls. Now you do one read call in the beginning, then apply all the changes you want to do and then reupload at the end.\r\n- Added unit tests for all the client classes.\r\n- Added more method and class comments.\r\n- Added \"provides :google_key_pair\" to GoogleKeyPair resource to resolve a warning.","created_at":"2016-02-12T17:35:09Z","updated_at":"2016-04-13T19:02:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e598c91691b8cb14b69fbfee52cd8e44d453f56","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/5/commits","review_comments_url":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/5/comments","review_comment_url":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/chef-provisioning-google/issues/5/comments","statuses_url":"https://api.github.com/repos/chef/chef-provisioning-google/statuses/9688fe7ba68e21160550a6315122b4faab0f9de1","head":{"label":"Lykos:work","ref":"work","sha":"9688fe7ba68e21160550a6315122b4faab0f9de1","user":{"login":"Lykos","id":235985,"avatar_url":"https://avatars.githubusercontent.com/u/235985?v=3","gravatar_id":"","url":"https://api.github.com/users/Lykos","html_url":"https://github.com/Lykos","followers_url":"https://api.github.com/users/Lykos/followers","following_url":"https://api.github.com/users/Lykos/following{/other_user}","gists_url":"https://api.github.com/users/Lykos/gists{/gist_id}","starred_url":"https://api.github.com/users/Lykos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lykos/subscriptions","organizations_url":"https://api.github.com/users/Lykos/orgs","repos_url":"https://api.github.com/users/Lykos/repos","events_url":"https://api.github.com/users/Lykos/events{/privacy}","received_events_url":"https://api.github.com/users/Lykos/received_events","type":"User","site_admin":false},"repo":{"id":49264630,"name":"chef-provisioning-google","full_name":"Lykos/chef-provisioning-google","owner":{"login":"Lykos","id":235985,"avatar_url":"https://avatars.githubusercontent.com/u/235985?v=3","gravatar_id":"","url":"https://api.github.com/users/Lykos","html_url":"https://github.com/Lykos","followers_url":"https://api.github.com/users/Lykos/followers","following_url":"https://api.github.com/users/Lykos/following{/other_user}","gists_url":"https://api.github.com/users/Lykos/gists{/gist_id}","starred_url":"https://api.github.com/users/Lykos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lykos/subscriptions","organizations_url":"https://api.github.com/users/Lykos/orgs","repos_url":"https://api.github.com/users/Lykos/repos","events_url":"https://api.github.com/users/Lykos/events{/privacy}","received_events_url":"https://api.github.com/users/Lykos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Lykos/chef-provisioning-google","description":"","fork":true,"url":"https://api.github.com/repos/Lykos/chef-provisioning-google","forks_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/forks","keys_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/teams","hooks_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/hooks","issue_events_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/issues/events{/number}","events_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/events","assignees_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/assignees{/user}","branches_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/branches{/branch}","tags_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/tags","blobs_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/statuses/{sha}","languages_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/languages","stargazers_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/stargazers","contributors_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/contributors","subscribers_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/subscribers","subscription_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/subscription","commits_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/contents/{+path}","compare_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/merges","archive_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/downloads","issues_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/issues{/number}","pulls_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/pulls{/number}","milestones_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/milestones{/number}","notifications_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/labels{/name}","releases_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/releases{/id}","deployments_url":"https://api.github.com/repos/Lykos/chef-provisioning-google/deployments","created_at":"2016-01-08T10:00:17Z","updated_at":"2016-01-29T16:12:48Z","pushed_at":"2016-04-13T19:01:47Z","git_url":"git://github.com/Lykos/chef-provisioning-google.git","ssh_url":"git@github.com:Lykos/chef-provisioning-google.git","clone_url":"https://github.com/Lykos/chef-provisioning-google.git","svn_url":"https://github.com/Lykos/chef-provisioning-google","homepage":null,"size":59,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"chef:master","ref":"master","sha":"b2b7b8889b146285cae095f58b851f7a54dd95a3","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":32171374,"name":"chef-provisioning-google","full_name":"chef/chef-provisioning-google","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef-provisioning-google","description":"","fork":false,"url":"https://api.github.com/repos/chef/chef-provisioning-google","forks_url":"https://api.github.com/repos/chef/chef-provisioning-google/forks","keys_url":"https://api.github.com/repos/chef/chef-provisioning-google/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef-provisioning-google/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef-provisioning-google/teams","hooks_url":"https://api.github.com/repos/chef/chef-provisioning-google/hooks","issue_events_url":"https://api.github.com/repos/chef/chef-provisioning-google/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef-provisioning-google/events","assignees_url":"https://api.github.com/repos/chef/chef-provisioning-google/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef-provisioning-google/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef-provisioning-google/tags","blobs_url":"https://api.github.com/repos/chef/chef-provisioning-google/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef-provisioning-google/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef-provisioning-google/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef-provisioning-google/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef-provisioning-google/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef-provisioning-google/languages","stargazers_url":"https://api.github.com/repos/chef/chef-provisioning-google/stargazers","contributors_url":"https://api.github.com/repos/chef/chef-provisioning-google/contributors","subscribers_url":"https://api.github.com/repos/chef/chef-provisioning-google/subscribers","subscription_url":"https://api.github.com/repos/chef/chef-provisioning-google/subscription","commits_url":"https://api.github.com/repos/chef/chef-provisioning-google/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef-provisioning-google/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef-provisioning-google/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef-provisioning-google/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef-provisioning-google/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef-provisioning-google/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef-provisioning-google/merges","archive_url":"https://api.github.com/repos/chef/chef-provisioning-google/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef-provisioning-google/downloads","issues_url":"https://api.github.com/repos/chef/chef-provisioning-google/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef-provisioning-google/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef-provisioning-google/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef-provisioning-google/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef-provisioning-google/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef-provisioning-google/releases{/id}","deployments_url":"https://api.github.com/repos/chef/chef-provisioning-google/deployments","created_at":"2015-03-13T17:46:41Z","updated_at":"2016-01-19T21:00:43Z","pushed_at":"2016-04-13T19:01:47Z","git_url":"git://github.com/chef/chef-provisioning-google.git","ssh_url":"git@github.com:chef/chef-provisioning-google.git","clone_url":"https://github.com/chef/chef-provisioning-google.git","svn_url":"https://github.com/chef/chef-provisioning-google","homepage":null,"size":41,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/5"},"html":{"href":"https://github.com/chef/chef-provisioning-google/pull/5"},"issue":{"href":"https://api.github.com/repos/chef/chef-provisioning-google/issues/5"},"comments":{"href":"https://api.github.com/repos/chef/chef-provisioning-google/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/chef-provisioning-google/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/chef/chef-provisioning-google/statuses/9688fe7ba68e21160550a6315122b4faab0f9de1"}}}}