Skip to content

fix(evaluation): use labeled break to exit foreach on Allow/Deny (closes #9)#45

Open
HeyItsGilbert wants to merge 2 commits intomainfrom
worktree-wiggly-baking-swing
Open

fix(evaluation): use labeled break to exit foreach on Allow/Deny (closes #9)#45
HeyItsGilbert wants to merge 2 commits intomainfrom
worktree-wiggly-baking-swing

Conversation

@HeyItsGilbert
Copy link
Copy Markdown
Owner

Summary

  • break inside a switch exits the switch, not the enclosing foreach loop
  • After an Allow or Deny rule matched, evaluation continued processing subsequent rules instead of stopping
  • Added :ruleLoop label to the foreach and changed bare break to break ruleLoop in the Allow and Deny cases

Test plan

  • Existing Test-FeatureFlag tests pass (257 tests, 0 failures)
  • Allows when rule matches with Allow effect verifies Invoke-Logging called exactly once, confirming no extra rules are processed

Generated with Claude Code

 #9)

break inside switch only exits the switch block, not the enclosing foreach.
Added :ruleLoop label to the foreach and changed break to break ruleLoop in
the Allow and Deny cases so evaluation stops after the first terminal rule.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Test Results

  3 files  240 suites   6s ⏱️
262 tests 257 ✅  5 💤 0 ❌
786 runs  771 ✅ 15 💤 0 ❌

Results for commit 8de3b92.

♻️ This comment has been updated with latest results.

Signed-off-by: Gilbert Sanchez <me@gilbertsanchez.com>
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.

1 participant