Skip to content

feat: apply rules based on type instead of hardcoded all#297

Open
Zaimwa9 wants to merge 2 commits intorenovate/tests-engine_tests-engine-test-data-3.xfrom
feat/any-rule-nested-sub-rules
Open

feat: apply rules based on type instead of hardcoded all#297
Zaimwa9 wants to merge 2 commits intorenovate/tests-engine_tests-engine-test-data-3.xfrom
feat/any-rule-nested-sub-rules

Conversation

@Zaimwa9
Copy link
Copy Markdown
Contributor

@Zaimwa9 Zaimwa9 commented May 4, 2026

Apply the rule's matching function (ALL/ANY/NONE) to sub-rules on top of conditions. Sub-rules were always evaluated with all() independently of the rule's type, making it impossible to evaluate OR between groups of AND conditions.

This unlocks (environment_name=env_1 and some_trait=foo) or (environment_name=env_2 and some_trait=bar) or (environment_name=env_3 and some_trait=baz) without affecting existing segments and their behavior.

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner May 4, 2026 09:06
@Zaimwa9 Zaimwa9 requested review from khvn26 and removed request for a team May 4, 2026 09:06
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

File Coverage Missing
All files 100%

Minimum allowed coverage is 100%

Generated by 🐒 cobertura-action against 8cb614c

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 4, 2026

Merging this PR will not alter performance

✅ 1 untouched benchmark


Comparing feat/any-rule-nested-sub-rules (8cb614c) with main (d6a8787)

Open in CodSpeed

Comment thread flag_engine/segments/evaluator.py Outdated
Comment thread tests/unit/segments/fixtures.py Outdated
@Zaimwa9 Zaimwa9 requested a review from khvn26 May 5, 2026 08:23
Copy link
Copy Markdown
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

LGTM — glad to see no performance regressions here.

@khvn26 khvn26 changed the base branch from main to renovate/tests-engine_tests-engine-test-data-3.x May 5, 2026 16:22
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.

2 participants