Skip to content

[chore] Refactor JsonEvaluator and isolate Flags to a store #371

@Kavindu-Dodan

Description

@Kavindu-Dodan

json_evaluator [1] is the core evaluator currently used by flagd. Internally, it relies on Flags pushed from ISync implementations.

The current implementation however lacks a good design with regards to Flag storage. For example, PR #370 focused on concurrent map access bug fix required mutexes in two locations. This shows that json_evaluator internals needs refactoring.

Consider the following proposal,

image

Here, the json_evaluator connects to FlagStore , which replaces the currently used Flags structure with defined contracts (exported methods). This makes FlagStore internals hidden from its consumer (json_evaluator), allowing clear interactions and modifications .

[1] - https://github.com/open-feature/flagd/blob/main/pkg/eval/json_evaluator.go

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions