catalyst / moodle-local_datacleaner

Reduce, filter, and anonymize moodle data for non-prod environments
https://moodle.org/plugins/local_datacleaner
19 stars 17 forks source link

User data cleaner #12

Closed Nicosoft closed 7 years ago

Nicosoft commented 8 years ago

I cannot run the user cleaner. It keeps running in 'dryrun' mode ... or am I doing something wrong? I am using v2.3.5

Both say: 'Would ..."

Please see the screenshot. -- screenshot 1: DryRun Mode dryrun_mode

-- screenshot 2: Run Mode run_mode

brendanheywood commented 8 years ago

Hmm, In theory it should tell you why it failed if it does a dry run. Can you double check all these conditions are true and let me know which condition isn't being correctly reported back:

Nicosoft commented 8 years ago

I double checked the conditions and I believe all the conditions are respected.

I an using Xdebug to follow the execution. In the screenshot 1, you can see the values used in function safety_checks() in --run mode. -- screenshot 1: 1_run_values

When executed in --dryrun or --run the function safety_checks() returns FALSE. So I believe this is correct.

I have more concern when the object cleaner_users/clean is constructed. When executed in --run mode, cleaner_users\clean->dryrun = TRUE; I believe the correct value should FALSE not TRUE. (Please see the screenshot 2) -- screenshot 2: 2_run_construct

So obviously when the method execute() is called, because of the value of $dryrun, method stops before any update. -- screenshot 3: 3_run_execute

What do you think?

roperto commented 7 years ago

Hi Nico,

The data scrambler was refactored and a few issues with dryrun fixed, as a result I cannot reproduce that issue anymore.

Please, if you find out that there is a similar issue with the new version feel free to reopen it or create a new one, I will gladly look into it.

Cheers,

Daniel