Skip to content

Release/v6.0.0 - #19

Merged
NinjaRocks merged 12 commits into
masterfrom
release/v6.0.0
Nov 11, 2026
Merged

NinjaRocks merged 12 commits into
masterfrom
release/v6.0.0

Conversation

@NinjaRocks

@NinjaRocks NinjaRocks commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Release v6.0.0 of FeatureOne, FeatureOne.File and FeatureOne.SQL. The main addition is an OpenFeature Specification (v1.x) provider, which ships inside the core FeatureOne package under the FeatureOne.OpenFeature namespace. There is no separate NuGet package to install.

The native IFeatures API is unchanged and fully supported. OpenFeature is offered as a second way to use the library, not a replacement for the native API.

What's new

  • FeatureOneProvider: an OpenFeature FeatureProvider that resolves Boolean, String, Integer, Double and Structure flags. The non-boolean resolvers return a value derived from the boolean toggle result. They do not support multiple variants.
  • Provider lifecycle: InitializeAsync / ShutdownAsync, ProviderStatus tracking, and ProviderNotReady / error-state handling across all resolvers.
  • Hooks: provider hook support, plus FeatureOneLoggingHook, which routes OpenFeature hook events to FeatureOne's IFeatureLogger.
  • Context mapping: EvaluationContextExtensions maps the OpenFeature TargetingKey and attributes to FeatureOne claims.
  • DI: AddFeatureOneOpenFeature(...) for IServiceCollection, including an options overload for hooks. The global provider is registered by an IHostedService at startup.
  • Custom conditions: ConditionDeserializer.Register<T>("Name") registers user-defined ICondition types. Types are still resolved only from an allow list, never loaded by name from configuration.
  • Interop: Features now exposes its FeatureStore.

Fixes

  • Dropped attributes: integer, double, list and structure EvaluationContext attributes were silently dropped during claims mapping, so conditions that targeted them evaluated as disabled without reporting an error.
  • Unreachable error guards: InitializeAsync could never fail, so none of the provider's error-state guards could ever run.
  • Wrong error code: a missing feature store reported FlagNotFound. It now reports ProviderNotReady.
  • Global provider registration: the global provider was only set when something resolved FeatureOneProvider, and it blocked on an async call inside the DI factory.
  • Thread safety: adding a hook on the singleton provider wasn't thread-safe. Hooks are now held in an ImmutableList that is swapped atomically.
  • Repeated parsing: ConditionDeserializer re-parsed the toggle JSON once per writable property.
  • RelationalCondition:
    • LessThan was never implemented and always returned false.
    • Numeric claims were compared as strings, so "9" ranked above "18".
    • String comparison depended on the machine's culture settings.

Breaking changes

  • Condition deserialization failures now throw FeatureOneConfigurationException instead of a bare Exception.
  • RelationalCondition now compares numerically when both values parse as numbers, and ordinally otherwise. Toggles that compare numeric claims with GreaterThan, GreaterThanOrEqual, LessThan or LessThanOrEqual will evaluate differently, and now correctly. Equals also treats equivalent numeric forms as equal, so "5.0" now equals "5".

Packaging

  • All three packages are now at 6.0.0.
  • Target frameworks: netstandard2.1;net9.0;net10.0.
  • New dependencies in FeatureOne: OpenFeature 2.14.1 and Microsoft.Extensions.Hosting.Abstractions 10.0.5.

Docs

  • DeveloperGuide.md, ClassDiagram.png, CHANGELOG.md, the release summary/table and a new wiki.md now live under docs/.
  • The README, wiki and DeveloperGuide give the native API and OpenFeature equal weight, with paired code samples and a comparison table to help choose between them.
  • Removed incorrect references to a separate FeatureOne.OpenFeature package.

Testing

  • 272 tests pass across the four test projects.
  • Includes the new FeatureOne.OpenFeature.Tests project, which covers resolution types, context mapping, error codes, lifecycle, hook concurrency, DI registration and global client integration.
  • Adds tests for custom condition registration and RelationalCondition.

…NotReady error handling, and provider hooks support to FeatureOneProvider
…ne library under FeatureOne.OpenFeature namespace
…ication compliance while preserving version history
OpenFeature review follow-up. Six areas, plus two RelationalCondition bugs
surfaced along the way.

Context mapping: FormatValue only handled bool and DateTime, then fell through
to Value.AsString, which returns null for every other type. Integer, double,
list and structure attributes were silently dropped, so conditions targeting
them evaluated as disabled with no error. Numbers now format via the invariant
culture; lists and structures serialize to JSON. Note AsInteger rounds rather
than reporting non-integral values, so integral-ness is decided explicitly -
1.5 must not become "2". The repo's own ToClaims test asserted this and failed.

Provider: InitializeAsync assigned a store to an unused local and could not
throw, so status never became Error and every error-state guard across the five
resolvers was unreachable. It now resolves the store and reports Error when
none is available. A missing store resolves as ProviderNotReady rather than
FlagNotFound, so a misconfigured app is not mistaken for a typo'd flag key.
Hooks moved to an ImmutableList swapped under Interlocked, since the provider
is a DI singleton and AddHook could mutate a list another thread was reading.
The five near-identical resolvers collapse into one generic Resolve<T>.

DI: SetProviderAsync ran as a side effect of the TryAddSingleton factory, so
the global provider was only set if something resolved FeatureOneProvider, and
it blocked on an async call inside the factory. Moved to an IHostedService.
Added an options overload for hooks - FeatureOneLoggingHook existed with no
wiring to reach it.

Conditions: SafeConditionTypes was a private static allow list with no
registration API, so a custom ICondition could not be deserialized without
reimplementing IConditionDeserializer, including its private hydration logic.
Added ConditionDeserializer.Register<T>(name), validating ICondition,
concreteness and a parameterless ctor. Deny-by-default is preserved: types are
still resolved from an allow list, never loaded by name from configuration.
Bare Exception becomes FeatureOneConfigurationException, and hydration no
longer re-parses the JSON once per writable property.

RelationalCondition: LessThan fell through to the switch default and always
returned false, so toggles using it could never enable. Numeric claims were
compared with string.Compare, ranking "9" above "18". Comparison strategy is
now chosen from the values - numeric when both parse, ordinal string
otherwise - so age > 18 is arithmetic while tier >= "gold" stays lexical.
decimal is tried before double to keep large integers exact. String comparison
is now ordinal; the culture-sensitive overload made results machine-dependent.

Docs: README, wiki and DeveloperGuide gave OpenFeature nearly all the weight
and the native IFeatures API almost none. They now present both as peers with
paired samples and a comparison table. Corrected every claim of a separate
FeatureOne.OpenFeature NuGet package - the provider ships inside FeatureOne
under that namespace. Documented the boolean-projection semantics of the
non-boolean resolvers, which were undocumented and read as multivariate
support. Filled in the four wiki sections its TOC promised but never contained
and fixed its relative links, which pointed at docs/ from inside docs/.

Behavioural changes for a major release: condition deserialization throws
FeatureOneConfigurationException instead of Exception, and numeric
RelationalCondition toggles now evaluate arithmetically.

272 tests pass, up from 260 with 4 previously failing.
@NinjaRocks
NinjaRocks requested a review from Nshai November 11, 2026 01:29
@NinjaRocks
NinjaRocks merged commit 7987542 into master Nov 11, 2026
6 of 7 checks passed
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.

2 participants