You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The in-process flagd providers have several consistency bugs in custom operator implementations (sem_ver, starts_with, ends_with) and $evaluators/$ref resolution. The same flag configuration can produce different evaluation results depending on which SDK evaluates it. These issues fall into three categories:
Note:fractional bucketing formula differences (#1872) will be addressed by the high-resolution fractional bucketing work in #1903, which replaces the hashing/normalization formula entirely.
Strategy
1. Standardize error returns: always return null
All custom operators should return null (or the language equivalent: nil, None, Null) for any invalid input, parse failure, or error condition. This is already the convention for some operators and ensures consistent behavior: errors trigger a fallback to the default variant rather than silently taking the false branch of a conditional.
This applies to:
fractional — parse errors, no-bucket-match
sem_ver — parse failures, unknown operators
starts_with / ends_with — invalid input
$evaluators/$ref — unresolved references should produce a clear diagnostic at parse time
2. Enhance the gherkin test suite in flagd-testbed
The flagd-testbed already has some error case coverage, but it needs to be extended to cover the edge cases identified in the sub-issues. Specifically:
sem_ver: Test v-prefixed versions, partial versions, build metadata comparisons (1.0.0+build1 == 1.0.0), and parse failure returns
Error returns: Test that all custom operators return null on invalid input (wrong arg count, wrong types, unparseable values)
$evaluators/$ref: Test unresolved $ref behavior, whitespace variations
3. Fix each provider against the enhanced test suite
Once the gherkin suite is updated, each provider can vet its implementation against the new tests and fix discrepancies.
Parent Issue
Sub-issue of #1770.
Summary
The in-process flagd providers have several consistency bugs in custom operator implementations (
sem_ver,starts_with,ends_with) and$evaluators/$refresolution. The same flag configuration can produce different evaluation results depending on which SDK evaluates it. These issues fall into three categories:sem_verparsing and comparison inconsistencies ([BUG] sem_ver operator parsing behavior differs across SDK implementations #1873) —v-prefix handling, partial version acceptance, and SemVer 2.0.0 Rule 10 violations (build metadata not ignored in .NET/Python/Rust).Inconsistent error return values across all custom operators ([BUG] Custom operator error return values are inconsistent across SDK implementations #1874) — Some SDKs return
nullon error (triggering default variant fallback), others returnfalse(taking the false branch), andfractionalhas three different no-match behaviors (empty string, exception, null).$evaluators/$refresolution gaps ([BUG] $evaluators/$ref resolution: no parse-time validation, non-deterministic ordering, and missing Rust support #1875) — No parse-time validation of unresolved$refs, non-deterministic replacement ordering in Go/.NET, and missing Rust support entirely.Strategy
1. Standardize error returns: always return
nullAll custom operators should return
null(or the language equivalent:nil,None,Null) for any invalid input, parse failure, or error condition. This is already the convention for some operators and ensures consistent behavior: errors trigger a fallback to the default variant rather than silently taking thefalsebranch of a conditional.This applies to:
fractional— parse errors, no-bucket-matchsem_ver— parse failures, unknown operatorsstarts_with/ends_with— invalid input$evaluators/$ref— unresolved references should produce a clear diagnostic at parse time2. Enhance the gherkin test suite in flagd-testbed
The flagd-testbed already has some error case coverage, but it needs to be extended to cover the edge cases identified in the sub-issues. Specifically:
sem_ver: Testv-prefixed versions, partial versions, build metadata comparisons (1.0.0+build1 == 1.0.0), and parse failure returnsnullon invalid input (wrong arg count, wrong types, unparseable values)$evaluators/$ref: Test unresolved$refbehavior, whitespace variations3. Fix each provider against the enhanced test suite
Once the gherkin suite is updated, each provider can vet its implementation against the new tests and fix discrepancies.
Requirements
null(notfalse, not empty string, not exception)Sub-issues
sem_verparsing and comparison inconsistencies$evaluators/$refresolution gaps