{"action":"created","issue":{"url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/229","repository_url":"https://api.github.com/repos/blackducksoftware/hub-detect","labels_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/229/labels{/name}","comments_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/229/comments","events_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/229/events","html_url":"https://github.com/blackducksoftware/hub-detect/issues/229","id":313152267,"number":229,"title":"Hub-detect doesn't delete old code locations from a scan","user":{"login":"imbeyondboredom","id":86616,"avatar_url":"https://avatars2.githubusercontent.com/u/86616?v=4","gravatar_id":"","url":"https://api.github.com/users/imbeyondboredom","html_url":"https://github.com/imbeyondboredom","followers_url":"https://api.github.com/users/imbeyondboredom/followers","following_url":"https://api.github.com/users/imbeyondboredom/following{/other_user}","gists_url":"https://api.github.com/users/imbeyondboredom/gists{/gist_id}","starred_url":"https://api.github.com/users/imbeyondboredom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imbeyondboredom/subscriptions","organizations_url":"https://api.github.com/users/imbeyondboredom/orgs","repos_url":"https://api.github.com/users/imbeyondboredom/repos","events_url":"https://api.github.com/users/imbeyondboredom/events{/privacy}","received_events_url":"https://api.github.com/users/imbeyondboredom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jamesrichard91","id":12814963,"avatar_url":"https://avatars1.githubusercontent.com/u/12814963?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesrichard91","html_url":"https://github.com/jamesrichard91","followers_url":"https://api.github.com/users/jamesrichard91/followers","following_url":"https://api.github.com/users/jamesrichard91/following{/other_user}","gists_url":"https://api.github.com/users/jamesrichard91/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesrichard91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesrichard91/subscriptions","organizations_url":"https://api.github.com/users/jamesrichard91/orgs","repos_url":"https://api.github.com/users/jamesrichard91/repos","events_url":"https://api.github.com/users/jamesrichard91/events{/privacy}","received_events_url":"https://api.github.com/users/jamesrichard91/received_events","type":"User","site_admin":false},"assignees":[{"login":"jamesrichard91","id":12814963,"avatar_url":"https://avatars1.githubusercontent.com/u/12814963?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesrichard91","html_url":"https://github.com/jamesrichard91","followers_url":"https://api.github.com/users/jamesrichard91/followers","following_url":"https://api.github.com/users/jamesrichard91/following{/other_user}","gists_url":"https://api.github.com/users/jamesrichard91/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesrichard91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesrichard91/subscriptions","organizations_url":"https://api.github.com/users/jamesrichard91/orgs","repos_url":"https://api.github.com/users/jamesrichard91/repos","events_url":"https://api.github.com/users/jamesrichard91/events{/privacy}","received_events_url":"https://api.github.com/users/jamesrichard91/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-04-11T02:31:32Z","updated_at":"2018-04-13T02:54:43Z","closed_at":null,"author_association":"NONE","body":"I've found that when you set projectCodeLocationDeleteOldNames to true is does not carry down to the Scanner. Here are the logs from my build:\r\n```\r\n[22:10:15][Step 1/1] policyCheck = false\r\n[22:10:15][Step 1/1] projectCodeLocationDeleteOldNames = true\r\n[22:10:15][Step 1/1] projectLevelMatchAdjustments = true\r\n...\r\n[22:10:20][Step 1/1] 2018-04-10 22:10:20 INFO  [pool-2-thread-1] --- --> Un-map previous Code Locations : false\r\n[22:10:20][Step 1/1] 2018-04-10 22:10:20 INFO  [pool-2-thread-1] --- --> Delete previous Code Locations : false\r\n```\r\n\r\nI believe you just need to carry the setting for deleting code locations down to this point and then call setDeletePreviousCodeLocations. It's possible this should also call setUnmapPreviousCodeLocations?\r\n\r\nhttps://github.com/blackducksoftware/hub-detect/blob/ef7ed2c4708cdcc4a6faf6f41a88c2934a3fa33f/src/main/groovy/com/blackducksoftware/integration/hub/detect/hub/HubSignatureScanner.java#L269"},"comment":{"url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/comments/381006164","html_url":"https://github.com/blackducksoftware/hub-detect/issues/229#issuecomment-381006164","issue_url":"https://api.github.com/repos/blackducksoftware/hub-detect/issues/229","id":381006164,"user":{"login":"imbeyondboredom","id":86616,"avatar_url":"https://avatars2.githubusercontent.com/u/86616?v=4","gravatar_id":"","url":"https://api.github.com/users/imbeyondboredom","html_url":"https://github.com/imbeyondboredom","followers_url":"https://api.github.com/users/imbeyondboredom/followers","following_url":"https://api.github.com/users/imbeyondboredom/following{/other_user}","gists_url":"https://api.github.com/users/imbeyondboredom/gists{/gist_id}","starred_url":"https://api.github.com/users/imbeyondboredom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imbeyondboredom/subscriptions","organizations_url":"https://api.github.com/users/imbeyondboredom/orgs","repos_url":"https://api.github.com/users/imbeyondboredom/repos","events_url":"https://api.github.com/users/imbeyondboredom/events{/privacy}","received_events_url":"https://api.github.com/users/imbeyondboredom/received_events","type":"User","site_admin":false},"created_at":"2018-04-13T02:54:43Z","updated_at":"2018-04-13T02:54:43Z","author_association":"NONE","body":"Ah - so it appears that I hit an edge case. So I was scanning this old repo of mine to test and I scanned these two branches back to back under the same project/\r\nversion:\r\nhttps://github.com/imbeyondboredom/dependency-check-gradle/tree/master\r\nhttps://github.com/imbeyondboredom/dependency-check-gradle/tree/test/blackduck\r\n\r\nIn the test/blackduck branch the code was moved down a directory and when that happened hub-detect didn't replace the old scans. \r\n\r\nWhile it's odd to scan two different branches with the same version - If the test/blackduck branch was merged into the master branch then that old scan would stick around.\r\n\r\n<img width=\"1388\" alt=\"screen shot 2018-04-12 at 10 50 31 pm\" src=\"https://user-images.githubusercontent.com/86616/38714451-54a5a462-3ea4-11e8-9aa7-5823b3f0e09e.png\">"}}
{"actor":{"display_login":"imbeyondboredom"}}