]> git.proxmox.com Git - proxmox-backup.git/commit
fix #4315: jobs: modify GroupFilter so include/exclude is tracked
authorPhilipp Hufnagl <p.hufnagl@proxmox.com>
Tue, 2 Jan 2024 11:06:52 +0000 (12:06 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 10 Jan 2024 09:13:45 +0000 (10:13 +0100)
commit59c9273698e14e8cf521f3a265bd361ac0ebde26
tree44ea48c3fd994414b9baef4b3255176b81f29e43
parent6b0d7f3d32372dc412e5d010b011465e3dc3ee7f
fix #4315: jobs: modify GroupFilter so include/exclude is tracked

After some discussion I canged the include/exclude behavior to first run
all include filter and after that all exclude filter (rather then
allowing to alternate inbetween). This is done by splitting them into 2
lists, running include first.

A lot of discussion happened how edge cases should be handled and we
came to following conclusion:

no include filter + no exclude filter => include all
some include filter + no exclude filter => filter as always
no include filter +  some exclude filter => include all then exclude

Since a GroupFilter now also features an behavior, the Struct has been
renamed To GroupType (since simply type is a keyword). The new
GroupFilter now has a behaviour as a flag 'is_exclude'.

I considered calling it 'is_include' but a reader later then might not
know what the opposite of 'include' is (do not include?  deactivate?). I
also considered making a new enum 'behaviour' but since there are only 2
values I considered it over engeneered.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
pbs-api-types/src/datastore.rs
pbs-api-types/src/jobs.rs
src/api2/tape/backup.rs
src/server/pull.rs