public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Philipp Hufnagl <p.hufnagl@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v4 1/3] fix #4315: jobs: modify GroupFilter so include/exclude is tracked
Date: Fri, 15 Dec 2023 10:44:00 +0100	[thread overview]
Message-ID: <793f6689-3fb3-4319-b5c3-e12568b4f240@proxmox.com> (raw)
In-Reply-To: <20231204100414.152770-2-p.hufnagl@proxmox.com>



On 12/4/23 11:04, Philipp Hufnagl wrote:
> 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 simply done by sorting the
> list (include first) before executing it.
> 
> 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.
> 
> Matching a filter will now iterate with a forech loop in order to also
> exclude matches.
> 


Short summary of our off-list discussion:
I think this would be a good opportunity to factor out the 'Applying a 
set of GroupFilters to a list of existing BackupGroups'-part into 
separate helpers, allowing us to write some tests for the filter
logic. This would make it much easier to argue about the correctness of 
the four cases (includes, excludes, both, none).

-- 
- Lukas




  parent reply	other threads:[~2023-12-15  9:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 10:04 [pbs-devel] [PATCH proxmox-backup v4 0/3] fix #4315: datastore: Exclude entries from sync Philipp Hufnagl
2023-12-04 10:04 ` [pbs-devel] [PATCH proxmox-backup v4 1/3] fix #4315: jobs: modify GroupFilter so include/exclude is tracked Philipp Hufnagl
2023-12-14 16:22   ` Lukas Wagner
2023-12-15  9:44   ` Lukas Wagner [this message]
2023-12-15  9:47     ` Philipp Hufnagl
2023-12-04 10:04 ` [pbs-devel] [PATCH proxmox-backup v4 2/3] ui: Show if Filter includes or excludes Philipp Hufnagl
2023-12-04 10:04 ` [pbs-devel] [PATCH proxmox-backup v4 3/3] docs: document new include/exclude paramenter Philipp Hufnagl
2023-12-14 16:22 ` [pbs-devel] [PATCH proxmox-backup v4 0/3] fix #4315: datastore: Exclude entries from sync Lukas Wagner
2023-12-15  8:45   ` Philipp Hufnagl
  -- strict thread matches above, loose matches on Subject: below --
2023-11-28 14:34 Philipp Hufnagl
2023-11-28 14:34 ` [pbs-devel] [PATCH proxmox-backup v4 1/3] fix #4315: jobs: modify GroupFilter so include/exclude is tracked Philipp Hufnagl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=793f6689-3fb3-4319-b5c3-e12568b4f240@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=p.hufnagl@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal