lsc-project / lsc

LSC engine
http://lsc-project.org/wiki/documentation/latest/start
Other
108 stars 41 forks source link

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

Open coudot opened 2 months ago

coudot commented 2 months ago

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?

davidcoutadeur commented 2 months ago

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.

coudot commented 1 month ago

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.

davidcoutadeur commented 1 month ago

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.

coudot commented 1 month ago

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

davidcoutadeur commented 1 month ago

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.