[pbs-devel] [PATCH proxmox-backup 1/3] fix #4315: jobs: modify GroupFilter so include/exclude is tracked

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Oct 25 17:45:11 CEST 2023


Am 25/10/2023 um 17:07 schrieb Philipp Hufnagl:
> 
> 
> On 10/25/23 15:33, Thomas Lamprecht wrote:
>> Am 24/10/2023 um 16:32 schrieb Philipp Hufnagl:
>>>
>>>
>>> On 10/24/23 12:43, Lukas Wagner wrote:
>>>
>>>> Do you have any examples in mind that would be more difficult to
>>>> represent?
>>>
>>> I would like to include all vms from 10 to to 30, but not 17,18 and 20.
>>>
>>
>> How is that more difficult?
>>
>> IMO Lukas proposal seems reasonable, a deterministic remove matches from
>> excludes fromm all matches from includes seems easier to understand,
>> from top of my head.
> 
> You would have to do something like
> 
> include 10-30
> exclude 17
> exclude 18
> exclude 20
> 
> instead of
> 
> include 10-30
> exclude 17-20
> include 19
> 
> While the first is easier to understand, the 2nd one allows (in my
> opinion) to build a cleaner solution for complex filtering.

Easier to understand is *much* cleaner though, any admin that changes
a simple include/exclude filter manually, e.g., reversing the order,
has no idea that the end result is completely different.

So if one would want to have such complex filtering, the order would
need to be explicitly encoded, and we always could extend a simpler
solution to a more complex one, while vice versa would be a breaking
change. But here I doubt I want to ever do that, most of the time one
has simple filter needs, servicing complex ones is error-prone not
only for the implementation but for the admin too, while only help
theoretical use cases.

Note that setups can already use namespaces for basic grouping,
and then simple exclude a few, or include a few, filters are enough
most of the time – having both, an include- and exclude- filter at the
same time is IMO already borderline overkill..

> 
> However both are in my opinion fine solutions. I you think having 2
> lists is a better solution I can implement that as well.

As mentioned off-list, the actual implementation wouldn't be really
that different in either implementation.

Grouping or splitting exclusions and inclusions in the UI would
naturally be good then to better convey the basic principles.





More information about the pbs-devel mailing list