From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Leo Nunner <l.nunner@proxmox.com>, pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-api/gui/docs, proxmox-widget-toolkit] Extend rule system
Date: Tue, 11 Apr 2023 11:52:22 +0200 [thread overview]
Message-ID: <745e3d07-95e1-a649-7832-1127f6e0c921@proxmox.com> (raw)
In-Reply-To: <20230407134258.199691-1-l.nunner@proxmox.com>
For now some higher level review inline from my side, not sure if I get to
a more in-depth for each patch soonish.
Am 07/04/2023 um 15:42 schrieb Leo Nunner:
> This series introduces two new features for the PMG rule system: object
> negation, and match groups. Negation allows the user to negate objects
> inside a rule, meaning that they will evaluate to true if their
> condition is NOT fulfilled.
Do we really don't have any test system for the rule system, if that'd be some
technical debt to address probably rather sooner than later.
>
> The second feature, match groups, allows objects to be chained together.
> A match group functions as a container for multiple other objects; it
> will only evaluate to true if all its members evaluate to true. Match groups
> are connected via logical 'or' to all other objects inside the rule;
> take the following rule system:
>
> - Rule
> - Match Group
> - Object 1
> - Object 2
> - Object 3
>
> It will match if either (Object 1 && Object 2), or if Object 3
> evaluate to true.
Why not allow or matches? Most mail filter tools (like e.g., the x-sieve
fronted of open-xchange) allow to configure if all or any of a group's matching
rules must trigger for the whole group to be true.
I mean, OR matching can be workarounded by duplicated rules but if we add
groups with AND combination, then OR is something that I'd think is also
expected to be there.
>
> To properly achieve match groups inside the GUI, the rule overview was
> reworked as a tree, instead of a simple list. It can now be
> collapsed/expanded, and each object type (except actions) has a single
> subfolder called 'Match Group'.
>
> In combination, these features should cover quite a few use cases, and
> make it possible to model more complex rule systems.
>
> pmg-api:
>
> Leo Nunner (8):
can we please drop the weird feature prefix, doesn't really add anything and is
relatively hard to parse as the subsystem is missing – PMG is somewhat small
enough in scope, so one can guess that; but I'd rather have that explicit.
Also, order and separation is a bit odd as some things that are implementing a
single semantic work are split, and others like the api expand+add are merged,
also making the whole thing work only after exposing it via the API just feels
plain wrong and is actually risky if someone overlooks this and applies the
first few patches already.
So, order/separation could be IMO better if:
commit 2 ("parse negation value into objects"), and 4 ("implement matching
logic") are squashed into a "rule system: implement match negation" as they
implement the internal/backend functionallity, and then exposing that via the
api could be done in the next commit. The one adding the field to the rule db
schema could be also squashed into the commit 2 & 4, but less hard feelings
there, albeit I'd note in the commit message that it's a preparation for the
next commits.
> feature: negation: add field to database
if not squashed:
rule db: add negation field
> feature: negation: parse negation value into objects
would always squash
> feature: negation: expand/implement API endpoints
That one could be actually split, the part that extends the existing API could
be squashed and the addition of the new "get/set object group" is rather
unrelated and something different, so should probably be it's own commit, i.e.
with a subject like:
api: rules: make object group settings editable
or:
api: rule group: make existing rules updateable
> feature: negation: implement matching logic
needs to order before exposing it via the API and should be suqashed
> feature: match groups: add field to database
> feature: match groups: parse field into objects
> feature: match groups: update API endpoints
> feature: match groups: implement matching logic
same for above w.r.t. s/feature/<actual subsys>/ for the commit subject and
order/sepration.
next prev parent reply other threads:[~2023-04-11 9:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 13:42 Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-api 1/8] feature: negation: add field to database Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-api 2/8] feature: negation: parse negation value into objects Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-api 3/8] feature: negation: expand/implement API endpoints Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-api 4/8] feature: negation: implement matching logic Leo Nunner
2023-04-11 7:35 ` Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-api 5/8] feature: match groups: add field to database Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-api 6/8] feature: match groups: parse field into objects Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-api 7/8] feature: match groups: update API endpoints Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-api 8/8] feature: match groups: implement matching logic Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-gui 1/2] feature: negate objects inside rules Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-gui 2/2] feature: introduce logical 'and' for rules Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH pmg-docs] docs: document negation and match groups Leo Nunner
2023-04-07 13:42 ` [pmg-devel] [PATCH widget-toolkit] dark-mode: fix colour of default tree icons Leo Nunner
2023-04-11 9:52 ` Thomas Lamprecht [this message]
2023-04-11 11:04 ` [pmg-devel] [PATCH pmg-api/gui/docs, proxmox-widget-toolkit] Extend rule system Leo Nunner
2023-04-11 11:19 ` Thomas Lamprecht
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=745e3d07-95e1-a649-7832-1127f6e0c921@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=l.nunner@proxmox.com \
--cc=pmg-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