{"action":"created","comment":{"url":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/comments/222435107","pull_request_review_id":161321041,"id":222435107,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjQzNTEwNw==","diff_hunk":"@@ -0,0 +1,84 @@\n+/**\n+ * hub-detect\n+ *\n+ * Copyright (C) 2018 Black Duck Software, Inc.\n+ * http://www.blackducksoftware.com/\n+ *\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements. See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership. The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License. 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,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied. See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package com.blackducksoftware.integration.hub.detect.workflow.swip;\n+\n+import java.io.File;\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Optional;\n+\n+import com.blackducksoftware.integration.hub.detect.configuration.DetectConfigurationUtility;\n+import com.blackducksoftware.integration.hub.detect.exception.DetectUserFriendlyException;\n+import com.blackducksoftware.integration.hub.detect.util.DetectFileManager;\n+import com.blackducksoftware.integration.hub.detect.util.executable.Executable;\n+import com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunner;\n+import com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunnerException;\n+import com.synopsys.integration.log.IntLogger;\n+import com.synopsys.integration.rest.connection.RestConnection;\n+import com.synopsys.integration.swip.common.SwipDownloadUtility;\n+import com.synopsys.integration.util.CleanupZipExpander;\n+\n+public class SwipCliManager {\n+    private final DetectFileManager detectFileManager;\n+    private final ExecutableRunner executableRunner;\n+    private final DetectConfigurationUtility detectConfigurationUtility;\n+\n+    public SwipCliManager(final DetectFileManager detectFileManager, final ExecutableRunner executableRunner, DetectConfigurationUtility detectConfigurationUtility) {\n+        this.detectFileManager = detectFileManager;\n+        this.executableRunner = executableRunner;\n+        this.detectConfigurationUtility = detectConfigurationUtility;\n+    }\n+\n+    public void runSwip(final IntLogger logger, File swipProjectDirectory) throws DetectUserFriendlyException {\n+        RestConnection restConnection = detectConfigurationUtility.createUnauthenticatedRestConnection(SwipDownloadUtility.DEFAULT_SWIP_SERVER_URL);\n+        CleanupZipExpander cleanupZipExpander = new CleanupZipExpander(logger);\n+        File toolsDirectory = detectFileManager.getPermanentDirectory();\n+\n+        SwipDownloadUtility swipDownloadUtility = new SwipDownloadUtility(logger, restConnection, cleanupZipExpander, SwipDownloadUtility.DEFAULT_SWIP_SERVER_URL, toolsDirectory);\n+        Optional<String> swipCliPath = swipDownloadUtility.retrieveSwipCliExecutablePath();\n+\n+        if (swipCliPath.isPresent()) {\n+            Map<String, String> environmentVariables = new HashMap<>();\n+            environmentVariables.put(\"COVERITY_UNSUPPORTED\", \"1\");\n+            environmentVariables.put(\"SWIP_USER_INPUT_TIMEOUT_MINUTES\", \"1\");","path":"hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/swip/SwipCliManager.java","position":66,"original_position":66,"commit_id":"c0ab6b556854d36f4ee5ddbfaeac06ba5ac57426","original_commit_id":"c0ab6b556854d36f4ee5ddbfaeac06ba5ac57426","user":{"login":"taikuukaits","id":7539378,"node_id":"MDQ6VXNlcjc1MzkzNzg=","avatar_url":"https://avatars2.githubusercontent.com/u/7539378?v=4","gravatar_id":"","url":"https://api.github.com/users/taikuukaits","html_url":"https://github.com/taikuukaits","followers_url":"https://api.github.com/users/taikuukaits/followers","following_url":"https://api.github.com/users/taikuukaits/following{/other_user}","gists_url":"https://api.github.com/users/taikuukaits/gists{/gist_id}","starred_url":"https://api.github.com/users/taikuukaits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taikuukaits/subscriptions","organizations_url":"https://api.github.com/users/taikuukaits/orgs","repos_url":"https://api.github.com/users/taikuukaits/repos","events_url":"https://api.github.com/users/taikuukaits/events{/privacy}","received_events_url":"https://api.github.com/users/taikuukaits/received_events","type":"User","site_admin":false},"body":"Why aren't we passing these options to swip common? Why do we execute swip itself in detect?","created_at":"2018-10-03T19:18:47Z","updated_at":"2018-10-03T19:19:26Z","html_url":"https://github.com/blackducksoftware/hub-detect/pull/326#discussion_r222435107","pull_request_url":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/326","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/comments/222435107"},"html":{"href":"https://github.com/blackducksoftware/hub-detect/pull/326#discussion_r222435107"},"pull_request":{"href":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/326"}}},"pull_request":{"url":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/326","id":217052180,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MDUyMTgw","html_url":"https://github.com/blackducksoftware/hub-detect/pull/326","diff_url":"https://github.com/blackducksoftware/hub-detect/pull/326.diff","patch_url":"https://github.com/blackducksoftware/hub-detect/pull/326.patch","issue_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/326","number":326,"state":"open","locked":false,"title":"adding swip invocation","user":{"login":"ekerwin","id":224544,"node_id":"MDQ6VXNlcjIyNDU0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/224544?v=4","gravatar_id":"","url":"https://api.github.com/users/ekerwin","html_url":"https://github.com/ekerwin","followers_url":"https://api.github.com/users/ekerwin/followers","following_url":"https://api.github.com/users/ekerwin/following{/other_user}","gists_url":"https://api.github.com/users/ekerwin/gists{/gist_id}","starred_url":"https://api.github.com/users/ekerwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekerwin/subscriptions","organizations_url":"https://api.github.com/users/ekerwin/orgs","repos_url":"https://api.github.com/users/ekerwin/repos","events_url":"https://api.github.com/users/ekerwin/events{/privacy}","received_events_url":"https://api.github.com/users/ekerwin/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-20T17:37:23Z","updated_at":"2018-10-03T19:19:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e47276dc4469c81884ed93aa6557466049cc3453","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/326/commits","review_comments_url":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/326/comments","review_comment_url":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/326/comments","statuses_url":"https://api.github.com/repos/blackducksoftware/hub-detect/statuses/c0ab6b556854d36f4ee5ddbfaeac06ba5ac57426","head":{"label":"blackducksoftware:adding_swip2","ref":"adding_swip2","sha":"c0ab6b556854d36f4ee5ddbfaeac06ba5ac57426","user":{"login":"blackducksoftware","id":431461,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMTQ2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/431461?v=4","gravatar_id":"","url":"https://api.github.com/users/blackducksoftware","html_url":"https://github.com/blackducksoftware","followers_url":"https://api.github.com/users/blackducksoftware/followers","following_url":"https://api.github.com/users/blackducksoftware/following{/other_user}","gists_url":"https://api.github.com/users/blackducksoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/blackducksoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackducksoftware/subscriptions","organizations_url":"https://api.github.com/users/blackducksoftware/orgs","repos_url":"https://api.github.com/users/blackducksoftware/repos","events_url":"https://api.github.com/users/blackducksoftware/events{/privacy}","received_events_url":"https://api.github.com/users/blackducksoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":87969126,"node_id":"MDEwOlJlcG9zaXRvcnk4Nzk2OTEyNg==","name":"hub-detect","full_name":"blackducksoftware/hub-detect","private":false,"owner":{"login":"blackducksoftware","id":431461,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMTQ2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/431461?v=4","gravatar_id":"","url":"https://api.github.com/users/blackducksoftware","html_url":"https://github.com/blackducksoftware","followers_url":"https://api.github.com/users/blackducksoftware/followers","following_url":"https://api.github.com/users/blackducksoftware/following{/other_user}","gists_url":"https://api.github.com/users/blackducksoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/blackducksoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackducksoftware/subscriptions","organizations_url":"https://api.github.com/users/blackducksoftware/orgs","repos_url":"https://api.github.com/users/blackducksoftware/repos","events_url":"https://api.github.com/users/blackducksoftware/events{/privacy}","received_events_url":"https://api.github.com/users/blackducksoftware/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/blackducksoftware/hub-detect","description":"Creates a Bill of Materials for any project that uses a package manager.","fork":false,"url":"https://api.github.com/repos/blackducksoftware/hub-detect","forks_url":"https://api.github.com/repos/blackducksoftware/hub-detect/forks","keys_url":"https://api.github.com/repos/blackducksoftware/hub-detect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blackducksoftware/hub-detect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blackducksoftware/hub-detect/teams","hooks_url":"https://api.github.com/repos/blackducksoftware/hub-detect/hooks","issue_events_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/events{/number}","events_url":"https://api.github.com/repos/blackducksoftware/hub-detect/events","assignees_url":"https://api.github.com/repos/blackducksoftware/hub-detect/assignees{/user}","branches_url":"https://api.github.com/repos/blackducksoftware/hub-detect/branches{/branch}","tags_url":"https://api.github.com/repos/blackducksoftware/hub-detect/tags","blobs_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/refs{/sha}","trees_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blackducksoftware/hub-detect/statuses/{sha}","languages_url":"https://api.github.com/repos/blackducksoftware/hub-detect/languages","stargazers_url":"https://api.github.com/repos/blackducksoftware/hub-detect/stargazers","contributors_url":"https://api.github.com/repos/blackducksoftware/hub-detect/contributors","subscribers_url":"https://api.github.com/repos/blackducksoftware/hub-detect/subscribers","subscription_url":"https://api.github.com/repos/blackducksoftware/hub-detect/subscription","commits_url":"https://api.github.com/repos/blackducksoftware/hub-detect/commits{/sha}","git_commits_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/commits{/sha}","comments_url":"https://api.github.com/repos/blackducksoftware/hub-detect/comments{/number}","issue_comment_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/comments{/number}","contents_url":"https://api.github.com/repos/blackducksoftware/hub-detect/contents/{+path}","compare_url":"https://api.github.com/repos/blackducksoftware/hub-detect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blackducksoftware/hub-detect/merges","archive_url":"https://api.github.com/repos/blackducksoftware/hub-detect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blackducksoftware/hub-detect/downloads","issues_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues{/number}","pulls_url":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls{/number}","milestones_url":"https://api.github.com/repos/blackducksoftware/hub-detect/milestones{/number}","notifications_url":"https://api.github.com/repos/blackducksoftware/hub-detect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blackducksoftware/hub-detect/labels{/name}","releases_url":"https://api.github.com/repos/blackducksoftware/hub-detect/releases{/id}","deployments_url":"https://api.github.com/repos/blackducksoftware/hub-detect/deployments","created_at":"2017-04-11T18:59:32Z","updated_at":"2018-10-03T19:01:18Z","pushed_at":"2018-10-03T19:01:15Z","git_url":"git://github.com/blackducksoftware/hub-detect.git","ssh_url":"git@github.com:blackducksoftware/hub-detect.git","clone_url":"https://github.com/blackducksoftware/hub-detect.git","svn_url":"https://github.com/blackducksoftware/hub-detect","homepage":"","size":108213,"stargazers_count":30,"watchers_count":30,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":6,"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":29,"open_issues":6,"watchers":30,"default_branch":"master"}},"base":{"label":"blackducksoftware:master","ref":"master","sha":"829d6907e1fd0d0857a11b12e86a3df36360393c","user":{"login":"blackducksoftware","id":431461,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMTQ2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/431461?v=4","gravatar_id":"","url":"https://api.github.com/users/blackducksoftware","html_url":"https://github.com/blackducksoftware","followers_url":"https://api.github.com/users/blackducksoftware/followers","following_url":"https://api.github.com/users/blackducksoftware/following{/other_user}","gists_url":"https://api.github.com/users/blackducksoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/blackducksoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackducksoftware/subscriptions","organizations_url":"https://api.github.com/users/blackducksoftware/orgs","repos_url":"https://api.github.com/users/blackducksoftware/repos","events_url":"https://api.github.com/users/blackducksoftware/events{/privacy}","received_events_url":"https://api.github.com/users/blackducksoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":87969126,"node_id":"MDEwOlJlcG9zaXRvcnk4Nzk2OTEyNg==","name":"hub-detect","full_name":"blackducksoftware/hub-detect","private":false,"owner":{"login":"blackducksoftware","id":431461,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMTQ2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/431461?v=4","gravatar_id":"","url":"https://api.github.com/users/blackducksoftware","html_url":"https://github.com/blackducksoftware","followers_url":"https://api.github.com/users/blackducksoftware/followers","following_url":"https://api.github.com/users/blackducksoftware/following{/other_user}","gists_url":"https://api.github.com/users/blackducksoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/blackducksoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackducksoftware/subscriptions","organizations_url":"https://api.github.com/users/blackducksoftware/orgs","repos_url":"https://api.github.com/users/blackducksoftware/repos","events_url":"https://api.github.com/users/blackducksoftware/events{/privacy}","received_events_url":"https://api.github.com/users/blackducksoftware/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/blackducksoftware/hub-detect","description":"Creates a Bill of Materials for any project that uses a package manager.","fork":false,"url":"https://api.github.com/repos/blackducksoftware/hub-detect","forks_url":"https://api.github.com/repos/blackducksoftware/hub-detect/forks","keys_url":"https://api.github.com/repos/blackducksoftware/hub-detect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blackducksoftware/hub-detect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blackducksoftware/hub-detect/teams","hooks_url":"https://api.github.com/repos/blackducksoftware/hub-detect/hooks","issue_events_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/events{/number}","events_url":"https://api.github.com/repos/blackducksoftware/hub-detect/events","assignees_url":"https://api.github.com/repos/blackducksoftware/hub-detect/assignees{/user}","branches_url":"https://api.github.com/repos/blackducksoftware/hub-detect/branches{/branch}","tags_url":"https://api.github.com/repos/blackducksoftware/hub-detect/tags","blobs_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/refs{/sha}","trees_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blackducksoftware/hub-detect/statuses/{sha}","languages_url":"https://api.github.com/repos/blackducksoftware/hub-detect/languages","stargazers_url":"https://api.github.com/repos/blackducksoftware/hub-detect/stargazers","contributors_url":"https://api.github.com/repos/blackducksoftware/hub-detect/contributors","subscribers_url":"https://api.github.com/repos/blackducksoftware/hub-detect/subscribers","subscription_url":"https://api.github.com/repos/blackducksoftware/hub-detect/subscription","commits_url":"https://api.github.com/repos/blackducksoftware/hub-detect/commits{/sha}","git_commits_url":"https://api.github.com/repos/blackducksoftware/hub-detect/git/commits{/sha}","comments_url":"https://api.github.com/repos/blackducksoftware/hub-detect/comments{/number}","issue_comment_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/comments{/number}","contents_url":"https://api.github.com/repos/blackducksoftware/hub-detect/contents/{+path}","compare_url":"https://api.github.com/repos/blackducksoftware/hub-detect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blackducksoftware/hub-detect/merges","archive_url":"https://api.github.com/repos/blackducksoftware/hub-detect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blackducksoftware/hub-detect/downloads","issues_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues{/number}","pulls_url":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls{/number}","milestones_url":"https://api.github.com/repos/blackducksoftware/hub-detect/milestones{/number}","notifications_url":"https://api.github.com/repos/blackducksoftware/hub-detect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blackducksoftware/hub-detect/labels{/name}","releases_url":"https://api.github.com/repos/blackducksoftware/hub-detect/releases{/id}","deployments_url":"https://api.github.com/repos/blackducksoftware/hub-detect/deployments","created_at":"2017-04-11T18:59:32Z","updated_at":"2018-10-03T19:01:18Z","pushed_at":"2018-10-03T19:01:15Z","git_url":"git://github.com/blackducksoftware/hub-detect.git","ssh_url":"git@github.com:blackducksoftware/hub-detect.git","clone_url":"https://github.com/blackducksoftware/hub-detect.git","svn_url":"https://github.com/blackducksoftware/hub-detect","homepage":"","size":108213,"stargazers_count":30,"watchers_count":30,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":6,"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":29,"open_issues":6,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/326"},"html":{"href":"https://github.com/blackducksoftware/hub-detect/pull/326"},"issue":{"href":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/326"},"comments":{"href":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/326/comments"},"review_comments":{"href":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/326/comments"},"review_comment":{"href":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/blackducksoftware/hub-detect/pulls/326/commits"},"statuses":{"href":"https://api.github.com/repos/blackducksoftware/hub-detect/statuses/c0ab6b556854d36f4ee5ddbfaeac06ba5ac57426"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"taikuukaits"}}