{"action":"created","comment":{"url":"https://api.github.com/repos/google/startup-os/pulls/comments/188321795","pull_request_review_id":120275990,"id":188321795,"diff_hunk":"@@ -43,10 +43,29 @@\n \n   @Provides\n   public static Config getConfig(FileUtils fileUtils, @Named(\"Base path\") String basePath) {\n-    Config config = (Config) fileUtils.readPrototxtUnchecked(\n-        fileUtils.joinPaths(basePath, InitCommand.BASE_FILENAME),\n-        Config.newBuilder());\n+    Config config =\n+        (Config)\n+            fileUtils.readPrototxtUnchecked(\n+                fileUtils.joinPaths(basePath, InitCommand.BASE_FILENAME), Config.newBuilder());\n     config = config.toBuilder().setBasePath(basePath).build();\n     return config;\n   }\n+\n+  @Provides\n+  @Named(\"Current workspace name\")\n+  public static String getCurrentWorkspaceName(\n+      FileUtils fileUtils, @Named(\"Base path\") String basePath) {\n+    Path currentFolder = Paths.get(fileUtils.getCurrentWorkingDirectory());\n+    Path wsFolder = Paths.get(fileUtils.joinPaths(basePath, \"ws\"));\n+    try {\n+      Path currentWsFolder = wsFolder.relativize(currentFolder).normalize();\n+      String wsName = currentWsFolder.subpath(0, 1).toString();\n+      if (wsName.equals(\"..\")) {\n+        throw new RuntimeException(\"You're inside base folder but not in a workspace\");\n+      }\n+      return wsName;\n+    } catch (IllegalArgumentException ex) {","path":"tools/aa/AaModule.java","position":41,"original_position":41,"commit_id":"9a449d9dff7af0578c0024ffe50ffea53107b69e","original_commit_id":"9a449d9dff7af0578c0024ffe50ffea53107b69e","user":{"login":"vmax","id":499267,"avatar_url":"https://avatars1.githubusercontent.com/u/499267?v=4","gravatar_id":"","url":"https://api.github.com/users/vmax","html_url":"https://github.com/vmax","followers_url":"https://api.github.com/users/vmax/followers","following_url":"https://api.github.com/users/vmax/following{/other_user}","gists_url":"https://api.github.com/users/vmax/gists{/gist_id}","starred_url":"https://api.github.com/users/vmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmax/subscriptions","organizations_url":"https://api.github.com/users/vmax/orgs","repos_url":"https://api.github.com/users/vmax/repos","events_url":"https://api.github.com/users/vmax/events{/privacy}","received_events_url":"https://api.github.com/users/vmax/received_events","type":"User","site_admin":false},"body":"@oferb \r\nit's not thrown, see [here](https://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html#subpath(int,%20int)) 🙂\r\n ```\r\nThrows:\r\nIllegalArgumentException - if beginIndex is negative, or greater than or equal to the number of elements. If endIndex is less than or equal to beginIndex, or larger than the number of elements.\r\n```","created_at":"2018-05-15T15:01:05Z","updated_at":"2018-05-15T15:01:05Z","html_url":"https://github.com/google/startup-os/pull/65#discussion_r188321795","pull_request_url":"https://api.github.com/repos/google/startup-os/pulls/65","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/google/startup-os/pulls/comments/188321795"},"html":{"href":"https://github.com/google/startup-os/pull/65#discussion_r188321795"},"pull_request":{"href":"https://api.github.com/repos/google/startup-os/pulls/65"}},"in_reply_to_id":188310901},"pull_request":{"url":"https://api.github.com/repos/google/startup-os/pulls/65","id":188138692,"html_url":"https://github.com/google/startup-os/pull/65","diff_url":"https://github.com/google/startup-os/pull/65.diff","patch_url":"https://github.com/google/startup-os/pull/65.patch","issue_url":"https://api.github.com/repos/google/startup-os/issues/65","number":65,"state":"open","locked":false,"title":"Current workspace name provider","user":{"login":"vmax","id":499267,"avatar_url":"https://avatars1.githubusercontent.com/u/499267?v=4","gravatar_id":"","url":"https://api.github.com/users/vmax","html_url":"https://github.com/vmax","followers_url":"https://api.github.com/users/vmax/followers","following_url":"https://api.github.com/users/vmax/following{/other_user}","gists_url":"https://api.github.com/users/vmax/gists{/gist_id}","starred_url":"https://api.github.com/users/vmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmax/subscriptions","organizations_url":"https://api.github.com/users/vmax/orgs","repos_url":"https://api.github.com/users/vmax/repos","events_url":"https://api.github.com/users/vmax/events{/privacy}","received_events_url":"https://api.github.com/users/vmax/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-15T14:00:53Z","updated_at":"2018-05-15T15:01:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3df80f499d5b115fcc4f3cbb3f3b601359744e8b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/startup-os/pulls/65/commits","review_comments_url":"https://api.github.com/repos/google/startup-os/pulls/65/comments","review_comment_url":"https://api.github.com/repos/google/startup-os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/startup-os/issues/65/comments","statuses_url":"https://api.github.com/repos/google/startup-os/statuses/9a449d9dff7af0578c0024ffe50ffea53107b69e","head":{"label":"google:current-ws-name","ref":"current-ws-name","sha":"9a449d9dff7af0578c0024ffe50ffea53107b69e","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":122602787,"name":"startup-os","full_name":"google/startup-os","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/startup-os","description":"Working examples of Google's Open Source tools and Cloud","fork":false,"url":"https://api.github.com/repos/google/startup-os","forks_url":"https://api.github.com/repos/google/startup-os/forks","keys_url":"https://api.github.com/repos/google/startup-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/startup-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/startup-os/teams","hooks_url":"https://api.github.com/repos/google/startup-os/hooks","issue_events_url":"https://api.github.com/repos/google/startup-os/issues/events{/number}","events_url":"https://api.github.com/repos/google/startup-os/events","assignees_url":"https://api.github.com/repos/google/startup-os/assignees{/user}","branches_url":"https://api.github.com/repos/google/startup-os/branches{/branch}","tags_url":"https://api.github.com/repos/google/startup-os/tags","blobs_url":"https://api.github.com/repos/google/startup-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/startup-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/startup-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/startup-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/startup-os/statuses/{sha}","languages_url":"https://api.github.com/repos/google/startup-os/languages","stargazers_url":"https://api.github.com/repos/google/startup-os/stargazers","contributors_url":"https://api.github.com/repos/google/startup-os/contributors","subscribers_url":"https://api.github.com/repos/google/startup-os/subscribers","subscription_url":"https://api.github.com/repos/google/startup-os/subscription","commits_url":"https://api.github.com/repos/google/startup-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/startup-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/startup-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/startup-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/startup-os/contents/{+path}","compare_url":"https://api.github.com/repos/google/startup-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/startup-os/merges","archive_url":"https://api.github.com/repos/google/startup-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/startup-os/downloads","issues_url":"https://api.github.com/repos/google/startup-os/issues{/number}","pulls_url":"https://api.github.com/repos/google/startup-os/pulls{/number}","milestones_url":"https://api.github.com/repos/google/startup-os/milestones{/number}","notifications_url":"https://api.github.com/repos/google/startup-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/startup-os/labels{/name}","releases_url":"https://api.github.com/repos/google/startup-os/releases{/id}","deployments_url":"https://api.github.com/repos/google/startup-os/deployments","created_at":"2018-02-23T09:48:29Z","updated_at":"2018-05-15T13:57:41Z","pushed_at":"2018-05-15T14:00:54Z","git_url":"git://github.com/google/startup-os.git","ssh_url":"git@github.com:google/startup-os.git","clone_url":"https://github.com/google/startup-os.git","svn_url":"https://github.com/google/startup-os","homepage":"","size":624,"stargazers_count":34,"watchers_count":34,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":7,"open_issues":8,"watchers":34,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"7cb882818aeae40d8bc7d52cff4318526e3f7539","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":122602787,"name":"startup-os","full_name":"google/startup-os","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/startup-os","description":"Working examples of Google's Open Source tools and Cloud","fork":false,"url":"https://api.github.com/repos/google/startup-os","forks_url":"https://api.github.com/repos/google/startup-os/forks","keys_url":"https://api.github.com/repos/google/startup-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/startup-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/startup-os/teams","hooks_url":"https://api.github.com/repos/google/startup-os/hooks","issue_events_url":"https://api.github.com/repos/google/startup-os/issues/events{/number}","events_url":"https://api.github.com/repos/google/startup-os/events","assignees_url":"https://api.github.com/repos/google/startup-os/assignees{/user}","branches_url":"https://api.github.com/repos/google/startup-os/branches{/branch}","tags_url":"https://api.github.com/repos/google/startup-os/tags","blobs_url":"https://api.github.com/repos/google/startup-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/startup-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/startup-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/startup-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/startup-os/statuses/{sha}","languages_url":"https://api.github.com/repos/google/startup-os/languages","stargazers_url":"https://api.github.com/repos/google/startup-os/stargazers","contributors_url":"https://api.github.com/repos/google/startup-os/contributors","subscribers_url":"https://api.github.com/repos/google/startup-os/subscribers","subscription_url":"https://api.github.com/repos/google/startup-os/subscription","commits_url":"https://api.github.com/repos/google/startup-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/startup-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/startup-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/startup-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/startup-os/contents/{+path}","compare_url":"https://api.github.com/repos/google/startup-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/startup-os/merges","archive_url":"https://api.github.com/repos/google/startup-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/startup-os/downloads","issues_url":"https://api.github.com/repos/google/startup-os/issues{/number}","pulls_url":"https://api.github.com/repos/google/startup-os/pulls{/number}","milestones_url":"https://api.github.com/repos/google/startup-os/milestones{/number}","notifications_url":"https://api.github.com/repos/google/startup-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/startup-os/labels{/name}","releases_url":"https://api.github.com/repos/google/startup-os/releases{/id}","deployments_url":"https://api.github.com/repos/google/startup-os/deployments","created_at":"2018-02-23T09:48:29Z","updated_at":"2018-05-15T13:57:41Z","pushed_at":"2018-05-15T14:00:54Z","git_url":"git://github.com/google/startup-os.git","ssh_url":"git@github.com:google/startup-os.git","clone_url":"https://github.com/google/startup-os.git","svn_url":"https://github.com/google/startup-os","homepage":"","size":624,"stargazers_count":34,"watchers_count":34,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":7,"open_issues":8,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/startup-os/pulls/65"},"html":{"href":"https://github.com/google/startup-os/pull/65"},"issue":{"href":"https://api.github.com/repos/google/startup-os/issues/65"},"comments":{"href":"https://api.github.com/repos/google/startup-os/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/google/startup-os/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/google/startup-os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/startup-os/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/google/startup-os/statuses/9a449d9dff7af0578c0024ffe50ffea53107b69e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"vmax"}}