{"action":"created","comment":{"url":"https://api.github.com/repos/cafejojo/schaapi/pulls/comments/229252663","pull_request_review_id":169704829,"id":229252663,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTI1MjY2Mw==","diff_hunk":"@@ -0,0 +1,53 @@\n+package org.cafejojo.schaapi.miningpipeline.miner.github\n+\n+import mu.KLogging\n+import org.apache.maven.shared.invoker.DefaultInvocationRequest\n+import org.apache.maven.shared.invoker.DefaultInvoker\n+import org.cafejojo.schaapi.models.project.JavaMavenProject\n+import java.io.File\n+\n+/**\n+ * Verifies (dynamically) if projects are using the correct library version.\n+ *\n+ * @param groupId group id of library maven project should depend on\n+ * @param artifactId artifact id of library maven project should depend on\n+ * @param version version of library maven project should depend on\n+ * @property displayOutput true iff output should be logged at INFO level\n+ */\n+class VersionVerifier(groupId: String, artifactId: String, version: String, private val displayOutput: Boolean = true) {\n+    private companion object : KLogging()\n+\n+    private val query = \"$groupId:$artifactId:jar:$version\"\n+\n+    /**\n+     * Verifies (dynamically) if the given [project] is using the correct library version.\n+     *\n+     * @param project a user project of the library\n+     */\n+    fun verify(project: JavaMavenProject) =\n+        if (createMavenInvoker(project).execute(createMavenInvocationRequest(project)).exitCode != 0) false\n+        else getDependencies(project).any { it.startsWith(query) }","path":"modules/mining-pipeline/github-project-miner/src/main/kotlin/org/cafejojo/schaapi/miningpipeline/miner/github/VersionVerifier.kt","position":29,"original_position":29,"commit_id":"12076984d027f3aace1d0c74b4fdab4dba3c0469","original_commit_id":"12076984d027f3aace1d0c74b4fdab4dba3c0469","user":{"login":"gandreadis","id":5272244,"node_id":"MDQ6VXNlcjUyNzIyNDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5272244?v=4","gravatar_id":"","url":"https://api.github.com/users/gandreadis","html_url":"https://github.com/gandreadis","followers_url":"https://api.github.com/users/gandreadis/followers","following_url":"https://api.github.com/users/gandreadis/following{/other_user}","gists_url":"https://api.github.com/users/gandreadis/gists{/gist_id}","starred_url":"https://api.github.com/users/gandreadis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gandreadis/subscriptions","organizations_url":"https://api.github.com/users/gandreadis/orgs","repos_url":"https://api.github.com/users/gandreadis/repos","events_url":"https://api.github.com/users/gandreadis/events{/privacy}","received_events_url":"https://api.github.com/users/gandreadis/received_events","type":"User","site_admin":false},"body":"I agree, the pipeline should break or at least log something if we cannot find a Maven install and not just fail silently.","created_at":"2018-10-30T10:34:54Z","updated_at":"2018-10-30T10:34:54Z","html_url":"https://github.com/cafejojo/schaapi/pull/331#discussion_r229252663","pull_request_url":"https://api.github.com/repos/cafejojo/schaapi/pulls/331","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cafejojo/schaapi/pulls/comments/229252663"},"html":{"href":"https://github.com/cafejojo/schaapi/pull/331#discussion_r229252663"},"pull_request":{"href":"https://api.github.com/repos/cafejojo/schaapi/pulls/331"}},"in_reply_to_id":226868163},"pull_request":{"url":"https://api.github.com/repos/cafejojo/schaapi/pulls/331","id":222656921,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNjU2OTIx","html_url":"https://github.com/cafejojo/schaapi/pull/331","diff_url":"https://github.com/cafejojo/schaapi/pull/331.diff","patch_url":"https://github.com/cafejojo/schaapi/pull/331.patch","issue_url":"https://api.github.com/repos/cafejojo/schaapi/issues/331","number":331,"state":"open","locked":false,"title":"Add dynamic library version check in user libraries","user":{"login":"casperboone","id":15815208,"node_id":"MDQ6VXNlcjE1ODE1MjA4","avatar_url":"https://avatars2.githubusercontent.com/u/15815208?v=4","gravatar_id":"","url":"https://api.github.com/users/casperboone","html_url":"https://github.com/casperboone","followers_url":"https://api.github.com/users/casperboone/followers","following_url":"https://api.github.com/users/casperboone/following{/other_user}","gists_url":"https://api.github.com/users/casperboone/gists{/gist_id}","starred_url":"https://api.github.com/users/casperboone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casperboone/subscriptions","organizations_url":"https://api.github.com/users/casperboone/orgs","repos_url":"https://api.github.com/users/casperboone/repos","events_url":"https://api.github.com/users/casperboone/events{/privacy}","received_events_url":"https://api.github.com/users/casperboone/received_events","type":"User","site_admin":false},"body":"This PR adds a dynamic check for the library version used by user project. It executes `mvn dependency:tree` (with some fancy options) and parses the output which is then queried. \r\n\r\nThe PR also copies `MavenInstaller` to the module of the `VersionVerifier`. I don't really like this, but didn't have a very good solution for this. Suggestions are definitely welcome.\r\n\r\nAlso, the code seems to be failing on Windows. If a Windows user could investigate, this would be appreciated. I'm expecting that the issue is related to parsing the generated file containing the dependencies (https://github.com/cafejojo/schaapi/pull/331/files#diff-fd0a68b4445e609f1331b912bbc4fe94R52).","created_at":"2018-10-13T15:28:58Z","updated_at":"2018-10-30T10:34:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71d13883588d4e637f84b4eac226073b5a25cca1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":913454595,"node_id":"MDU6TGFiZWw5MTM0NTQ1OTU=","url":"https://api.github.com/repos/cafejojo/schaapi/labels/enhancement","name":"enhancement","color":"9dbdf9","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/cafejojo/schaapi/pulls/331/commits","review_comments_url":"https://api.github.com/repos/cafejojo/schaapi/pulls/331/comments","review_comment_url":"https://api.github.com/repos/cafejojo/schaapi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cafejojo/schaapi/issues/331/comments","statuses_url":"https://api.github.com/repos/cafejojo/schaapi/statuses/12076984d027f3aace1d0c74b4fdab4dba3c0469","head":{"label":"cafejojo:library-version-verification","ref":"library-version-verification","sha":"12076984d027f3aace1d0c74b4fdab4dba3c0469","user":{"login":"cafejojo","id":38208512,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MjA4NTEy","avatar_url":"https://avatars3.githubusercontent.com/u/38208512?v=4","gravatar_id":"","url":"https://api.github.com/users/cafejojo","html_url":"https://github.com/cafejojo","followers_url":"https://api.github.com/users/cafejojo/followers","following_url":"https://api.github.com/users/cafejojo/following{/other_user}","gists_url":"https://api.github.com/users/cafejojo/gists{/gist_id}","starred_url":"https://api.github.com/users/cafejojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cafejojo/subscriptions","organizations_url":"https://api.github.com/users/cafejojo/orgs","repos_url":"https://api.github.com/users/cafejojo/repos","events_url":"https://api.github.com/users/cafejojo/events{/privacy}","received_events_url":"https://api.github.com/users/cafejojo/received_events","type":"Organization","site_admin":false},"repo":{"id":130986816,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA5ODY4MTY=","name":"schaapi","full_name":"cafejojo/schaapi","private":false,"owner":{"login":"cafejojo","id":38208512,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MjA4NTEy","avatar_url":"https://avatars3.githubusercontent.com/u/38208512?v=4","gravatar_id":"","url":"https://api.github.com/users/cafejojo","html_url":"https://github.com/cafejojo","followers_url":"https://api.github.com/users/cafejojo/followers","following_url":"https://api.github.com/users/cafejojo/following{/other_user}","gists_url":"https://api.github.com/users/cafejojo/gists{/gist_id}","starred_url":"https://api.github.com/users/cafejojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cafejojo/subscriptions","organizations_url":"https://api.github.com/users/cafejojo/orgs","repos_url":"https://api.github.com/users/cafejojo/repos","events_url":"https://api.github.com/users/cafejojo/events{/privacy}","received_events_url":"https://api.github.com/users/cafejojo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cafejojo/schaapi","description":"🐑 Safe Changes for APIs","fork":false,"url":"https://api.github.com/repos/cafejojo/schaapi","forks_url":"https://api.github.com/repos/cafejojo/schaapi/forks","keys_url":"https://api.github.com/repos/cafejojo/schaapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cafejojo/schaapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cafejojo/schaapi/teams","hooks_url":"https://api.github.com/repos/cafejojo/schaapi/hooks","issue_events_url":"https://api.github.com/repos/cafejojo/schaapi/issues/events{/number}","events_url":"https://api.github.com/repos/cafejojo/schaapi/events","assignees_url":"https://api.github.com/repos/cafejojo/schaapi/assignees{/user}","branches_url":"https://api.github.com/repos/cafejojo/schaapi/branches{/branch}","tags_url":"https://api.github.com/repos/cafejojo/schaapi/tags","blobs_url":"https://api.github.com/repos/cafejojo/schaapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cafejojo/schaapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cafejojo/schaapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/cafejojo/schaapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cafejojo/schaapi/statuses/{sha}","languages_url":"https://api.github.com/repos/cafejojo/schaapi/languages","stargazers_url":"https://api.github.com/repos/cafejojo/schaapi/stargazers","contributors_url":"https://api.github.com/repos/cafejojo/schaapi/contributors","subscribers_url":"https://api.github.com/repos/cafejojo/schaapi/subscribers","subscription_url":"https://api.github.com/repos/cafejojo/schaapi/subscription","commits_url":"https://api.github.com/repos/cafejojo/schaapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/cafejojo/schaapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/cafejojo/schaapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/cafejojo/schaapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/cafejojo/schaapi/contents/{+path}","compare_url":"https://api.github.com/repos/cafejojo/schaapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cafejojo/schaapi/merges","archive_url":"https://api.github.com/repos/cafejojo/schaapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cafejojo/schaapi/downloads","issues_url":"https://api.github.com/repos/cafejojo/schaapi/issues{/number}","pulls_url":"https://api.github.com/repos/cafejojo/schaapi/pulls{/number}","milestones_url":"https://api.github.com/repos/cafejojo/schaapi/milestones{/number}","notifications_url":"https://api.github.com/repos/cafejojo/schaapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cafejojo/schaapi/labels{/name}","releases_url":"https://api.github.com/repos/cafejojo/schaapi/releases{/id}","deployments_url":"https://api.github.com/repos/cafejojo/schaapi/deployments","created_at":"2018-04-25T10:00:57Z","updated_at":"2018-10-25T14:37:38Z","pushed_at":"2018-10-25T14:37:39Z","git_url":"git://github.com/cafejojo/schaapi.git","ssh_url":"git@github.com:cafejojo/schaapi.git","clone_url":"https://github.com/cafejojo/schaapi.git","svn_url":"https://github.com/cafejojo/schaapi","homepage":"https://cafejojo.org/schaapi","size":11459,"stargazers_count":7,"watchers_count":7,"language":"Kotlin","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":7,"watchers":7,"default_branch":"master"}},"base":{"label":"cafejojo:master","ref":"master","sha":"c560f83945873fa090135f282670335a83915dae","user":{"login":"cafejojo","id":38208512,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MjA4NTEy","avatar_url":"https://avatars3.githubusercontent.com/u/38208512?v=4","gravatar_id":"","url":"https://api.github.com/users/cafejojo","html_url":"https://github.com/cafejojo","followers_url":"https://api.github.com/users/cafejojo/followers","following_url":"https://api.github.com/users/cafejojo/following{/other_user}","gists_url":"https://api.github.com/users/cafejojo/gists{/gist_id}","starred_url":"https://api.github.com/users/cafejojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cafejojo/subscriptions","organizations_url":"https://api.github.com/users/cafejojo/orgs","repos_url":"https://api.github.com/users/cafejojo/repos","events_url":"https://api.github.com/users/cafejojo/events{/privacy}","received_events_url":"https://api.github.com/users/cafejojo/received_events","type":"Organization","site_admin":false},"repo":{"id":130986816,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA5ODY4MTY=","name":"schaapi","full_name":"cafejojo/schaapi","private":false,"owner":{"login":"cafejojo","id":38208512,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MjA4NTEy","avatar_url":"https://avatars3.githubusercontent.com/u/38208512?v=4","gravatar_id":"","url":"https://api.github.com/users/cafejojo","html_url":"https://github.com/cafejojo","followers_url":"https://api.github.com/users/cafejojo/followers","following_url":"https://api.github.com/users/cafejojo/following{/other_user}","gists_url":"https://api.github.com/users/cafejojo/gists{/gist_id}","starred_url":"https://api.github.com/users/cafejojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cafejojo/subscriptions","organizations_url":"https://api.github.com/users/cafejojo/orgs","repos_url":"https://api.github.com/users/cafejojo/repos","events_url":"https://api.github.com/users/cafejojo/events{/privacy}","received_events_url":"https://api.github.com/users/cafejojo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cafejojo/schaapi","description":"🐑 Safe Changes for APIs","fork":false,"url":"https://api.github.com/repos/cafejojo/schaapi","forks_url":"https://api.github.com/repos/cafejojo/schaapi/forks","keys_url":"https://api.github.com/repos/cafejojo/schaapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cafejojo/schaapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cafejojo/schaapi/teams","hooks_url":"https://api.github.com/repos/cafejojo/schaapi/hooks","issue_events_url":"https://api.github.com/repos/cafejojo/schaapi/issues/events{/number}","events_url":"https://api.github.com/repos/cafejojo/schaapi/events","assignees_url":"https://api.github.com/repos/cafejojo/schaapi/assignees{/user}","branches_url":"https://api.github.com/repos/cafejojo/schaapi/branches{/branch}","tags_url":"https://api.github.com/repos/cafejojo/schaapi/tags","blobs_url":"https://api.github.com/repos/cafejojo/schaapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cafejojo/schaapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cafejojo/schaapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/cafejojo/schaapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cafejojo/schaapi/statuses/{sha}","languages_url":"https://api.github.com/repos/cafejojo/schaapi/languages","stargazers_url":"https://api.github.com/repos/cafejojo/schaapi/stargazers","contributors_url":"https://api.github.com/repos/cafejojo/schaapi/contributors","subscribers_url":"https://api.github.com/repos/cafejojo/schaapi/subscribers","subscription_url":"https://api.github.com/repos/cafejojo/schaapi/subscription","commits_url":"https://api.github.com/repos/cafejojo/schaapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/cafejojo/schaapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/cafejojo/schaapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/cafejojo/schaapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/cafejojo/schaapi/contents/{+path}","compare_url":"https://api.github.com/repos/cafejojo/schaapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cafejojo/schaapi/merges","archive_url":"https://api.github.com/repos/cafejojo/schaapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cafejojo/schaapi/downloads","issues_url":"https://api.github.com/repos/cafejojo/schaapi/issues{/number}","pulls_url":"https://api.github.com/repos/cafejojo/schaapi/pulls{/number}","milestones_url":"https://api.github.com/repos/cafejojo/schaapi/milestones{/number}","notifications_url":"https://api.github.com/repos/cafejojo/schaapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cafejojo/schaapi/labels{/name}","releases_url":"https://api.github.com/repos/cafejojo/schaapi/releases{/id}","deployments_url":"https://api.github.com/repos/cafejojo/schaapi/deployments","created_at":"2018-04-25T10:00:57Z","updated_at":"2018-10-25T14:37:38Z","pushed_at":"2018-10-25T14:37:39Z","git_url":"git://github.com/cafejojo/schaapi.git","ssh_url":"git@github.com:cafejojo/schaapi.git","clone_url":"https://github.com/cafejojo/schaapi.git","svn_url":"https://github.com/cafejojo/schaapi","homepage":"https://cafejojo.org/schaapi","size":11459,"stargazers_count":7,"watchers_count":7,"language":"Kotlin","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":7,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cafejojo/schaapi/pulls/331"},"html":{"href":"https://github.com/cafejojo/schaapi/pull/331"},"issue":{"href":"https://api.github.com/repos/cafejojo/schaapi/issues/331"},"comments":{"href":"https://api.github.com/repos/cafejojo/schaapi/issues/331/comments"},"review_comments":{"href":"https://api.github.com/repos/cafejojo/schaapi/pulls/331/comments"},"review_comment":{"href":"https://api.github.com/repos/cafejojo/schaapi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cafejojo/schaapi/pulls/331/commits"},"statuses":{"href":"https://api.github.com/repos/cafejojo/schaapi/statuses/12076984d027f3aace1d0c74b4fdab4dba3c0469"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"gandreadis"}}