lsc icon indicating copy to clipboard operation
lsc copied to clipboard

Add a condition to disable a task if source or destination is empty

Open coudot opened this issue 1 year ago • 6 comments

The use case is the deletion of all entries in an LDAP directory because the source database were empty.

LSC has done the clean job as configured, but of course this is not what was expected.

Could we find a solution to disable the task if LSC find no entries in source or destination?

coudot avatar Jul 03 '24 08:07 coudot

If we make the condition customizable, we could have a more generic feature, that, for instance, could block a task if there is more or less than X modifications to do.

davidcoutadeur avatar Jul 03 '24 16:07 davidcoutadeur

My use case: a LSC deletes entries from Active Directory if they are not present in a database. If the database is empty, all entries are delete from AD.

When launching a clean task, we do not do a "getAllFilter" on source, so we don't know if the source is empty or not.

So maybe the evolution would be to launch in clean phase a "getAllFilter" on source, and stop taks if its empty (or less than X entries)

We may need to create a getAllCleanFilter like we have a cleanFilter different that getOneFilter.

coudot avatar Jul 23 '24 14:07 coudot

I find the idea of a getAllFilter interresting.

However, sometimes, we don't have any filter to find all source entries. This would require us to define a very large search filter, that may slow down the clean process.

davidcoutadeur avatar Jul 23 '24 15:07 davidcoutadeur

However, sometimes, we don't have any filter to find all source entries. This would require us to define a very large search filter, that may slow down the clean process.

That's why I propose a getAllCleanFilter, if it is different from the getAllFilter

coudot avatar Jul 23 '24 15:07 coudot

That's why I propose a getAllCleanFilter, if it is different from the getAllFilter

Got that, but my point was sometimes, we can't formalize a precise "getAllCleanFilter", requiring us to put a generic filter, that grabs many more entries than we need.

davidcoutadeur avatar Jul 23 '24 15:07 davidcoutadeur

This could be a generic feature if we have a minimal and maximal threshold before applying the writes.

See also the #172 issue

davidcoutadeur avatar Sep 18 '25 10:09 davidcoutadeur