{"action":"created","issue":{"url":"https://api.github.com/repos/piwik/piwik/issues/7887","labels_url":"https://api.github.com/repos/piwik/piwik/issues/7887/labels{/name}","comments_url":"https://api.github.com/repos/piwik/piwik/issues/7887/comments","events_url":"https://api.github.com/repos/piwik/piwik/issues/7887/events","html_url":"https://github.com/piwik/piwik/pull/7887","id":75462729,"number":7887,"title":"Fixes #6785, #7180 add log delete command and make log deletion delete only based on time and not idvisit.","user":{"login":"diosmosis","id":125140,"avatar_url":"https://avatars.githubusercontent.com/u/125140?v=3","gravatar_id":"","url":"https://api.github.com/users/diosmosis","html_url":"https://github.com/diosmosis","followers_url":"https://api.github.com/users/diosmosis/followers","following_url":"https://api.github.com/users/diosmosis/following{/other_user}","gists_url":"https://api.github.com/users/diosmosis/gists{/gist_id}","starred_url":"https://api.github.com/users/diosmosis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diosmosis/subscriptions","organizations_url":"https://api.github.com/users/diosmosis/orgs","repos_url":"https://api.github.com/users/diosmosis/repos","events_url":"https://api.github.com/users/diosmosis/events{/privacy}","received_events_url":"https://api.github.com/users/diosmosis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/piwik/piwik/labels/Needs%20Review","name":"Needs Review","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"login":"diosmosis","id":125140,"avatar_url":"https://avatars.githubusercontent.com/u/125140?v=3","gravatar_id":"","url":"https://api.github.com/users/diosmosis","html_url":"https://github.com/diosmosis","followers_url":"https://api.github.com/users/diosmosis/followers","following_url":"https://api.github.com/users/diosmosis/following{/other_user}","gists_url":"https://api.github.com/users/diosmosis/gists{/gist_id}","starred_url":"https://api.github.com/users/diosmosis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diosmosis/subscriptions","organizations_url":"https://api.github.com/users/diosmosis/orgs","repos_url":"https://api.github.com/users/diosmosis/repos","events_url":"https://api.github.com/users/diosmosis/events{/privacy}","received_events_url":"https://api.github.com/users/diosmosis/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/piwik/piwik/milestones/79","html_url":"https://github.com/piwik/piwik/milestones/2.14.0","labels_url":"https://api.github.com/repos/piwik/piwik/milestones/79/labels","id":1005076,"number":79,"title":"2.14.0","description":"","creator":{"login":"mattab","id":466765,"avatar_url":"https://avatars.githubusercontent.com/u/466765?v=3","gravatar_id":"","url":"https://api.github.com/users/mattab","html_url":"https://github.com/mattab","followers_url":"https://api.github.com/users/mattab/followers","following_url":"https://api.github.com/users/mattab/following{/other_user}","gists_url":"https://api.github.com/users/mattab/gists{/gist_id}","starred_url":"https://api.github.com/users/mattab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattab/subscriptions","organizations_url":"https://api.github.com/users/mattab/orgs","repos_url":"https://api.github.com/users/mattab/repos","events_url":"https://api.github.com/users/mattab/events{/privacy}","received_events_url":"https://api.github.com/users/mattab/received_events","type":"User","site_admin":false},"open_issues":50,"closed_issues":86,"state":"open","created_at":"2015-03-04T03:03:44Z","updated_at":"2015-05-27T01:50:43Z","due_on":"2015-06-02T12:00:00Z","closed_at":null},"comments":1,"created_at":"2015-05-12T04:56:39Z","updated_at":"2015-05-27T02:48:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/piwik/piwik/pulls/7887","html_url":"https://github.com/piwik/piwik/pull/7887","diff_url":"https://github.com/piwik/piwik/pull/7887.diff","patch_url":"https://github.com/piwik/piwik/pull/7887.patch"},"body":"This PR fixes #6785 and #7180. It introduces a new `logs:delete` command and makes all visit deletion (including the log data purger used by PrivacyManager) visit based on required criteria instead of the max idvisit.\r\n\r\nList of changes:\r\n\r\n* New LogDeleter service that is used by `logs:delete` and LogDataPurger in PrivacyManager.\r\n\r\n* New method in RawLogDao that iterates over log tables based on a set of criteria. The criteria is an array describing a list of SQL conditions. I think this should be replaced eventually by a segment string, since they do the same thing, but that would require more platform infrastructure than Piwik currently has.\r\n\r\n* The new method in RawLogDao is used by the `usercountry:attribute` command. The looping logic was also moved to VisitorGeolocator, a late finishing touch for the command.\r\n\r\n* Removed the testing hack from LogDataPurger. Originally, to test a concurrency issue, two events were fired in LogDataPurger. Now, we use DI.\r\n\r\n* I added the ability to override DI config in IntegrationTestCase descendants.\r\n\r\n* I moved log inserting test code from VisitorGeolocatorTest to a new LogHelper class (in Piwik\\Tests\\Framework) and re-used for testing LogDeleter.\r\n\r\n* Moved the unused log action deletion methods to RawLogDao.\r\n\r\nTODO:\r\n* [x] tests for new VisitorGelocator method\r\n* [x] tests for LogPurger service\r\n* ~~[ ] tests for new RawLogDao methods~~\r\n* [x] benchmark command + log purging on large instance\r\n* [x] add test for #7180 "},"comment":{"url":"https://api.github.com/repos/piwik/piwik/issues/comments/105736434","html_url":"https://github.com/piwik/piwik/pull/7887#issuecomment-105736434","issue_url":"https://api.github.com/repos/piwik/piwik/issues/7887","id":105736434,"user":{"login":"mattab","id":466765,"avatar_url":"https://avatars.githubusercontent.com/u/466765?v=3","gravatar_id":"","url":"https://api.github.com/users/mattab","html_url":"https://github.com/mattab","followers_url":"https://api.github.com/users/mattab/followers","following_url":"https://api.github.com/users/mattab/following{/other_user}","gists_url":"https://api.github.com/users/mattab/gists{/gist_id}","starred_url":"https://api.github.com/users/mattab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattab/subscriptions","organizations_url":"https://api.github.com/users/mattab/orgs","repos_url":"https://api.github.com/users/mattab/repos","events_url":"https://api.github.com/users/mattab/events{/privacy}","received_events_url":"https://api.github.com/users/mattab/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T02:48:10Z","updated_at":"2015-05-27T02:48:10Z","body":"@diosmosis Sorry for the delay in getting to review this. This Pull request is high value and fixes a major bug that can lead to data loss :+1: \r\n\r\nCan you rebase it (I think work done in #7964 is relevant to this PR). After rebase let me know I will review and possibly merge. thanks\r\n\r\n\r\n"}}