{"action":"created","comment":{"url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/comments/233608208","pull_request_review_id":175063532,"id":233608208,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzYwODIwOA==","diff_hunk":"@@ -51,14 +52,24 @@ class SamInitRunner(\n     }\n \n     companion object {\n+        private val expectedSamVersion = SemVer.parseFromText(\"0.6.0\") ?: throw RuntimeException(\"SemVer parse error\")\n         fun validate(path: String): String? {\n             val commandLine = GeneralCommandLine(path).withParameters(\"--version\")\n-            return try {\n+            try {\n                 val process = CapturingProcessHandler(commandLine).runProcess()\n-                if (process.exitCode != 0) process.stderr else null\n+                if (process.exitCode != 0) {\n+                    return process.stderr\n+                }\n+                val samVersionLine = process.stdoutLines.first()\n+                val parsedSemVer = SemVer.parseFromText(samVersionLine.split(\" \").last())","path":"jetbrains-core/src/software/aws/toolkits/jetbrains/services/lambda/execution/sam/SamInitRunner.kt","position":23,"original_position":23,"commit_id":"0d3612b3e85c933efa0df604289879177cc8d3b6","original_commit_id":"0d3612b3e85c933efa0df604289879177cc8d3b6","user":{"login":"zhangzhx","id":7167513,"node_id":"MDQ6VXNlcjcxNjc1MTM=","avatar_url":"https://avatars3.githubusercontent.com/u/7167513?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangzhx","html_url":"https://github.com/zhangzhx","followers_url":"https://api.github.com/users/zhangzhx/followers","following_url":"https://api.github.com/users/zhangzhx/following{/other_user}","gists_url":"https://api.github.com/users/zhangzhx/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangzhx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangzhx/subscriptions","organizations_url":"https://api.github.com/users/zhangzhx/orgs","repos_url":"https://api.github.com/users/zhangzhx/repos","events_url":"https://api.github.com/users/zhangzhx/events{/privacy}","received_events_url":"https://api.github.com/users/zhangzhx/received_events","type":"User","site_admin":false},"body":"It's better to move the version parse logic to a separate method that we can have a unit test for it.","created_at":"2018-11-14T20:29:22Z","updated_at":"2018-11-14T20:29:23Z","html_url":"https://github.com/aws/aws-toolkit-jetbrains/pull/459#discussion_r233608208","pull_request_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/459","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/comments/233608208"},"html":{"href":"https://github.com/aws/aws-toolkit-jetbrains/pull/459#discussion_r233608208"},"pull_request":{"href":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/459"}}},"pull_request":{"url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/459","id":230969100,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwOTY5MTAw","html_url":"https://github.com/aws/aws-toolkit-jetbrains/pull/459","diff_url":"https://github.com/aws/aws-toolkit-jetbrains/pull/459.diff","patch_url":"https://github.com/aws/aws-toolkit-jetbrains/pull/459.patch","issue_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues/459","number":459,"state":"open","locked":false,"title":"Add validation for SAM version","user":{"login":"rli","id":742829,"node_id":"MDQ6VXNlcjc0MjgyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/742829?v=4","gravatar_id":"","url":"https://api.github.com/users/rli","html_url":"https://github.com/rli","followers_url":"https://api.github.com/users/rli/followers","following_url":"https://api.github.com/users/rli/following{/other_user}","gists_url":"https://api.github.com/users/rli/gists{/gist_id}","starred_url":"https://api.github.com/users/rli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rli/subscriptions","organizations_url":"https://api.github.com/users/rli/orgs","repos_url":"https://api.github.com/users/rli/repos","events_url":"https://api.github.com/users/rli/events{/privacy}","received_events_url":"https://api.github.com/users/rli/received_events","type":"User","site_admin":false},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [x] Bug fix (non-breaking change which fixes an issue)\r\n- [ ] New feature (non-breaking change which adds functionality)\r\n\r\n## Screenshots (if appropriate)\r\n### Bad version\r\n![image](https://user-images.githubusercontent.com/742829/48509561-51863d80-e806-11e8-90a0-1a5db557f43a.png)\r\n### Couldn't parse\r\n![image](https://user-images.githubusercontent.com/742829/48509591-619e1d00-e806-11e8-9ae5-d2bf7bcaa836.png)\r\n\r\n## Checklist\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] I have read the **README** document\r\n- [x] I have read the **CONTRIBUTING** document\r\n- [x] Local run of `gradlew check` succeeds\r\n- [x] My code follows the code style of this project\r\n- [x] I have added tests to cover my changes\r\n- [x] All new and existing tests passed\r\n- [ ] A short description of the change has been added to the **CHANGELOG**\r\n\r\n## License\r\nI confirm that my contribution is made under the terms of the Apache 2.0 license.\r\n","created_at":"2018-11-14T20:21:15Z","updated_at":"2018-11-14T20:29:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2782fc884b3925957450394cf18f2ff4378aa320","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/459/commits","review_comments_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/459/comments","review_comment_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues/459/comments","statuses_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/statuses/0d3612b3e85c933efa0df604289879177cc8d3b6","head":{"label":"aws:richali-samPathBox","ref":"richali-samPathBox","sha":"0d3612b3e85c933efa0df604289879177cc8d3b6","user":{"login":"aws","id":2232217,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzIyMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":91485909,"node_id":"MDEwOlJlcG9zaXRvcnk5MTQ4NTkwOQ==","name":"aws-toolkit-jetbrains","full_name":"aws/aws-toolkit-jetbrains","private":false,"owner":{"login":"aws","id":2232217,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzIyMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aws/aws-toolkit-jetbrains","description":"AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs","fork":false,"url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains","forks_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/forks","keys_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/teams","hooks_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/hooks","issue_events_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues/events{/number}","events_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/events","assignees_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/assignees{/user}","branches_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/branches{/branch}","tags_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/tags","blobs_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/languages","stargazers_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/stargazers","contributors_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/contributors","subscribers_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/subscribers","subscription_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/subscription","commits_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/contents/{+path}","compare_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/merges","archive_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/downloads","issues_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues{/number}","pulls_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/labels{/name}","releases_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/releases{/id}","deployments_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/deployments","created_at":"2017-05-16T17:28:34Z","updated_at":"2018-11-14T20:26:08Z","pushed_at":"2018-11-14T20:26:07Z","git_url":"git://github.com/aws/aws-toolkit-jetbrains.git","ssh_url":"git@github.com:aws/aws-toolkit-jetbrains.git","clone_url":"https://github.com/aws/aws-toolkit-jetbrains.git","svn_url":"https://github.com/aws/aws-toolkit-jetbrains","homepage":"","size":1224,"stargazers_count":61,"watchers_count":61,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":59,"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":10,"open_issues":59,"watchers":61,"default_branch":"master"}},"base":{"label":"aws:master","ref":"master","sha":"612a7001ba8c1685956651736542d2e60bdcaccc","user":{"login":"aws","id":2232217,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzIyMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":91485909,"node_id":"MDEwOlJlcG9zaXRvcnk5MTQ4NTkwOQ==","name":"aws-toolkit-jetbrains","full_name":"aws/aws-toolkit-jetbrains","private":false,"owner":{"login":"aws","id":2232217,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzIyMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aws/aws-toolkit-jetbrains","description":"AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs","fork":false,"url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains","forks_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/forks","keys_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/teams","hooks_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/hooks","issue_events_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues/events{/number}","events_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/events","assignees_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/assignees{/user}","branches_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/branches{/branch}","tags_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/tags","blobs_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/languages","stargazers_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/stargazers","contributors_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/contributors","subscribers_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/subscribers","subscription_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/subscription","commits_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/contents/{+path}","compare_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/merges","archive_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/downloads","issues_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues{/number}","pulls_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/labels{/name}","releases_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/releases{/id}","deployments_url":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/deployments","created_at":"2017-05-16T17:28:34Z","updated_at":"2018-11-14T20:26:08Z","pushed_at":"2018-11-14T20:26:07Z","git_url":"git://github.com/aws/aws-toolkit-jetbrains.git","ssh_url":"git@github.com:aws/aws-toolkit-jetbrains.git","clone_url":"https://github.com/aws/aws-toolkit-jetbrains.git","svn_url":"https://github.com/aws/aws-toolkit-jetbrains","homepage":"","size":1224,"stargazers_count":61,"watchers_count":61,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":59,"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":10,"open_issues":59,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/459"},"html":{"href":"https://github.com/aws/aws-toolkit-jetbrains/pull/459"},"issue":{"href":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues/459"},"comments":{"href":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/issues/459/comments"},"review_comments":{"href":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/459/comments"},"review_comment":{"href":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/pulls/459/commits"},"statuses":{"href":"https://api.github.com/repos/aws/aws-toolkit-jetbrains/statuses/0d3612b3e85c933efa0df604289879177cc8d3b6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zhangzhx"}}