fix(evaluation): refactor number constraint evaluation to use nil checks consistently#6018
Conversation
…ecks consistently - change Number field to *float64 to allow nil values - move nil check into main operator switch for scalar operators - add test coverage for scalar operators using sub-tests - improve consistency with string constraint evaluation pattern Signed-off-by: Roman Dmytrenko <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2 #6018 +/- ##
=======================================
Coverage 61.43% 61.44%
=======================================
Files 142 142
Lines 14315 14316 +1
=======================================
+ Hits 8795 8796 +1
Misses 4782 4782
Partials 738 738
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Verdict: approve
The refactor correctly uses *float64 to resolve the ambiguity between a zero value and an unprepared number constraint, and moving the nil check into the scalar operator case makes the flow consistent with the set-operator checks. The tests are improved with sub-tests and proper errs.ErrInvalid assertions. Build and tests pass cleanly — no changes requested.
🤖 Automated review by the Flipt PR review agent.
Signed-off-by: Roman Dmytrenko <[email protected]>
some cleanup for #6017