feat: support multi-value array properties for non-set operators#45
Merged
Conversation
Non-set operators (is, contains, greater, etc.) previously coerced array/list properties to a single JSON-stringified value, diverging from analytics/charts behavior where any element of an array can satisfy the condition. matchCondition now consults coerceStringList for every non-null value and dispatches to a new matchStringsNonSet helper when the value coerces to a list — any-match semantics, including for negation operators (is not, does not contain), which match if any single element satisfies the negation. coerceStringList gains a strings.HasPrefix(s, "[") pre-check so scalar strings skip JSON parsing now that every value passes through it. User- visible consequence: JSON-array strings with leading whitespace (e.g., " [\"a\"]") are no longer parsed as arrays by set operators. Tests: inline flag/condition harness drives 14 evaluation-engine unit cases covering scalar/collection/JSON-array-string shapes against set and non-set operators; 7 integration tests target new flags on the superset deployment key.
vaibhav-jain-exp
approved these changes
Apr 27, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Apr 28, 2026
# [1.11.0](v1.10.1...v1.11.0) (2026-04-28) ### Features * support multi-value array properties for non-set operators ([#45](#45)) ([da41c28](da41c28))
|
🎉 This PR is included in version 1.11.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Non-set operators (
is,contains,greater, etc.) previously coerced array/list properties to a single JSON-stringified value, diverging from analytics/charts behavior where any element of an array can satisfy the condition.matchConditionnow consultscoerceStringListfor every non-null value and dispatches to a newmatchStringsNonSethelper when the value coerces to a list — any-match semantics, including for negation operators (is not,does not contain), which match if any single element satisfies the negation.coerceStringListgains astrings.HasPrefix(s, "[")pre-check so scalar strings skip JSON parsing now that every value passes through it." [\"a\"]") are no longer parsed as arrays by set operators.Test plan
server-VVhLULXCxxY0xqmszXouXxiEzoeJWmSh)go vet ./...cleango test ./internal/evaluation/...passesNote
Medium Risk
Changes core flag condition matching semantics so non-set operators (
is,contains, comparisons, regex) can match any element of an array/JSON-array-string, which could change targeting results for existing flags. Also tightens JSON-array-string detection (HasPrefix("[")), which may stop parsing arrays with leading whitespace for set operators.Overview
Updates
matchConditionso non-set operators evaluate array-like properties (slices/arrays or JSON-array-strings) using any-element semantics via newmatchStringsNonSet, instead of coercing the whole value to a single string.Adds a fast
HasPrefix("[")guard incoerceStringListto avoid unnecessary JSON parsing now that list coercion runs for all non-null properties, and expands tests with both remote integration cases and an inline flag/condition harness to cover scalar vs multi-value behavior (including negation and whitespace edge cases).Reviewed by Cursor Bugbot for commit a33ed5e. Bugbot is set up for automated code reviews on this repo. Configure here.