Skip to content

fix(evaluation): refactor number constraint evaluation to use nil checks consistently#6018

Merged
kodiakhq[bot] merged 2 commits into
v2from
rd/v2/eval-number-regression
Jun 12, 2026
Merged

fix(evaluation): refactor number constraint evaluation to use nil checks consistently#6018
kodiakhq[bot] merged 2 commits into
v2from
rd/v2/eval-number-regression

Conversation

@erka

@erka erka commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
  • 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

some cleanup for #6017

…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]>
@erka
erka requested a review from a team as a code owner June 12, 2026 13:38
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 12, 2026
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.44%. Comparing base (1bb4f9b) to head (2619814).

Files with missing lines Patch % Lines
internal/server/evaluation/evaluation.go 90.47% 2 Missing ⚠️
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           
Flag Coverage Δ
integrationtests 34.39% <0.00%> (-0.01%) ⬇️
unittests 52.55% <90.90%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]>
@erka erka added the v2 Flipt v2 label Jun 12, 2026
@erka erka added the automerge Used by Kodiak bot to automerge PRs label Jun 12, 2026
@erka erka changed the title feat(evaluation): refactor number constraint evaluation to use nil checks consistently fix(evaluation): refactor number constraint evaluation to use nil checks consistently Jun 12, 2026

@markphelps markphelps left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice

@kodiakhq
kodiakhq Bot merged commit 7478088 into v2 Jun 12, 2026
35 checks passed
@kodiakhq
kodiakhq Bot deleted the rd/v2/eval-number-regression branch June 12, 2026 20:16
@github-project-automation github-project-automation Bot moved this to Done in Flipt V2 Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Used by Kodiak bot to automerge PRs size:M This PR changes 30-99 lines, ignoring generated files. v2 Flipt v2

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants