Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate any/all group include conditions. #4

Merged
merged 6 commits into from
May 21, 2024
Merged

Evaluate any/all group include conditions. #4

merged 6 commits into from
May 21, 2024

Conversation

joaander
Copy link
Member

@joaander joaander commented May 20, 2024

Description

Make group.include an array of tables. Elements in the array are evaluated in an any context, allowing new use-cases. For example, one can select ranges like:

[[action.group.include]]
condition = ['/i', '<', 10]
[[action.group.include]]
condition = ['/i', '>', 20]

to select groups where i < 10 || i > 20

Conditions that must all be true can be set with all instead of condition. The previous syntax:

group.include = [['/i', '>', 10], ['/i', '<', 20]]

is now:

[[action.group.include]]
all = [['/i', '>', 10], ['/i', '<', 20]]

A one-liner equivalent of the previous syntax is possible, though heavy on brackets:

action.group.include = [{all = [['/i', '>', 10], ['/i', '<', 20]]}]

Motivation and context

Allow users a wider range of selection logic.

How has this been tested?

Unit tests check the given functionality.

Checklist:

@joaander joaander marked this pull request as ready for review May 20, 2024 20:58
@@ -13,15 +13,9 @@ Resolves #???

<!--- Please describe how you tested your changes. -->

## Change log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple admin files that are changed in this PR - I am fine merging as is, but felt it useful to point out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm still changing things as I see they need updates. Row will transition to a more strict one "related set of changes" per PR soon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries! Looks good to me.

Copy link
Contributor

@janbridley janbridley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than my above comment, this looks great. The syntax is very clean considering the significant complexity increase in action groups!

@joaander joaander requested a review from tcmoore3 May 21, 2024 14:20
@joaander joaander merged commit c3b86f7 into trunk May 21, 2024
13 checks passed
@joaander joaander deleted the include-any branch May 21, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants