{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/comments/64444987","id":64444987,"diff_hunk":"@@ -0,0 +1,56 @@\n+/*\n+ * Copyright 2016 Google Inc.\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+\n+package com.google.cloud.tools.app.deploy;\n+\n+import com.google.cloud.tools.app.deploy.gcloud.GcloudAppDeploy;\n+import com.google.cloud.tools.app.deploy.process.LoggingOutputHandler;\n+import com.google.cloud.tools.app.impl.cloudsdk.internal.sdk.CloudSdk;\n+import com.google.cloud.tools.app.impl.config.DefaultDeployConfiguration;\n+\n+import java.io.File;\n+import java.util.concurrent.ExecutionException;\n+import java.util.concurrent.Future;\n+import java.util.logging.Level;\n+\n+public class DeployExample {\n+\n+  public static void howToUse() {\n+    // presumably the sdk object comes from somewhere else, but lets build it here\n+    // you can also set enviroment on it\n+    CloudSdk sdk = new CloudSdk.Builder().sdkPath(new File(\"some/path\")).build();\n+\n+    // create the deploy object\n+    Deploy deploy = GcloudAppDeploy.newBuilder(sdk).build();","path":"src/main/java/com/google/cloud/tools/app/deploy/DeployExample.java","position":37,"original_position":37,"commit_id":"e5b2626f1f518ee025204160f6d8f49097b8cb4e","original_commit_id":"e5b2626f1f518ee025204160f6d8f49097b8cb4e","user":{"login":"patflynn","id":7862557,"avatar_url":"https://avatars.githubusercontent.com/u/7862557?v=3","gravatar_id":"","url":"https://api.github.com/users/patflynn","html_url":"https://github.com/patflynn","followers_url":"https://api.github.com/users/patflynn/followers","following_url":"https://api.github.com/users/patflynn/following{/other_user}","gists_url":"https://api.github.com/users/patflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/patflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patflynn/subscriptions","organizations_url":"https://api.github.com/users/patflynn/orgs","repos_url":"https://api.github.com/users/patflynn/repos","events_url":"https://api.github.com/users/patflynn/events{/privacy}","received_events_url":"https://api.github.com/users/patflynn/received_events","type":"User","site_admin":false},"body":"it could be nice to have a global builder factory so that they only need to override the SDK path once for all commands used. \r\n\r\nConceivably all of the commands could implement something like StatusMessageEmitter or some such nonsense and the client could configure the global builder factory with a default StatusMessageHandler.  Not even sure if that's useful though.","created_at":"2016-05-24T18:09:40Z","updated_at":"2016-05-24T18:09:40Z","html_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java/pull/81#discussion_r64444987","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/81","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/comments/64444987"},"html":{"href":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java/pull/81#discussion_r64444987"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/81","id":71129586,"html_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java/pull/81","diff_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java/pull/81.diff","patch_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java/pull/81.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues/81","number":81,"state":"open","locked":false,"title":"Deploy restructuring idea, request for feedback","user":{"login":"loosebazooka","id":1304826,"avatar_url":"https://avatars.githubusercontent.com/u/1304826?v=3","gravatar_id":"","url":"https://api.github.com/users/loosebazooka","html_url":"https://github.com/loosebazooka","followers_url":"https://api.github.com/users/loosebazooka/followers","following_url":"https://api.github.com/users/loosebazooka/following{/other_user}","gists_url":"https://api.github.com/users/loosebazooka/gists{/gist_id}","starred_url":"https://api.github.com/users/loosebazooka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loosebazooka/subscriptions","organizations_url":"https://api.github.com/users/loosebazooka/orgs","repos_url":"https://api.github.com/users/loosebazooka/repos","events_url":"https://api.github.com/users/loosebazooka/events{/privacy}","received_events_url":"https://api.github.com/users/loosebazooka/received_events","type":"User","site_admin":false},"body":"@meltsufin @patflynn @etanshaul \r\n\r\nLooking at a review of the concept more than the actual code for this.\r\n\r\nTake a look at DeployExample.java to start\r\n\r\nthe structure of the composition is basically :\r\n\r\n- GcloudAppDeploy (Type: Deploy)\r\n  - [required] CloudSdk\r\n  - [optional] CliProcessStarter (Type: ProcesStarter)\r\n  - [optional] DeployConfigurationTranslator (Type: ConfigurationTranslator)\r\n\r\n1. CloudSdk right now if from the existing code, not much will change, execution is taken out of it though.\r\n1. CliProcessStarter can configure two things, the jvm shutdown hook (most only disabled when running the devappserver in background mode) and the process environment\r\n1. DeployConfigurationTranslator translates a deploy configuration to a cli\r\n\r\n\r\nTheres some notes in the source files too. You can ignore build errors, some methods I just made up.\r\n\r\nAlso some of this stuff might conflict with things I preferred in earlier code reviews (like: inheritted stdout/stderr in process builder), so, yeah, sorry.","created_at":"2016-05-23T22:16:07Z","updated_at":"2016-05-24T18:09:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31891f6231c813defa7afb318f5008027a13346f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/81/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/81/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues/81/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/statuses/e5b2626f1f518ee025204160f6d8f49097b8cb4e","head":{"label":"GoogleCloudPlatform:less-inheritance","ref":"less-inheritance","sha":"e5b2626f1f518ee025204160f6d8f49097b8cb4e","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":54120965,"name":"app-tools-lib-for-java","full_name":"GoogleCloudPlatform/app-tools-lib-for-java","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java","description":null,"fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/deployments","created_at":"2016-03-17T13:42:30Z","updated_at":"2016-05-09T13:40:58Z","pushed_at":"2016-05-24T15:00:27Z","git_url":"git://github.com/GoogleCloudPlatform/app-tools-lib-for-java.git","ssh_url":"git@github.com:GoogleCloudPlatform/app-tools-lib-for-java.git","clone_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java.git","svn_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java","homepage":null,"size":383,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":16,"forks":1,"open_issues":16,"watchers":4,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"acbca84de189c33116997a524ece2a48f3052097","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":54120965,"name":"app-tools-lib-for-java","full_name":"GoogleCloudPlatform/app-tools-lib-for-java","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java","description":null,"fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/deployments","created_at":"2016-03-17T13:42:30Z","updated_at":"2016-05-09T13:40:58Z","pushed_at":"2016-05-24T15:00:27Z","git_url":"git://github.com/GoogleCloudPlatform/app-tools-lib-for-java.git","ssh_url":"git@github.com:GoogleCloudPlatform/app-tools-lib-for-java.git","clone_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java.git","svn_url":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java","homepage":null,"size":383,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":16,"forks":1,"open_issues":16,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/81"},"html":{"href":"https://github.com/GoogleCloudPlatform/app-tools-lib-for-java/pull/81"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues/81"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/app-tools-lib-for-java/statuses/e5b2626f1f518ee025204160f6d8f49097b8cb4e"}}}}
{"actor":{"display_login":"patflynn"}}