Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Kavindu-Dodan opened this issue Feb 3, 2023 · 0 comments · Fixed by #383
Closed

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

Kavindu-Dodan opened this issue Feb 3, 2023 · 0 comments · Fixed by #383
Assignees

Comments

@Kavindu-Dodan
Copy link
Contributor

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

@skyerus skyerus self-assigned this Feb 6, 2023
skyerus added a commit that referenced this issue Feb 9, 2023
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- Isolates flag state management to store package

### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->

Fixes #371 

### Notes
<!-- any additional notes for this PR -->

### Follow-up Tasks
<!-- anything that is related to this PR but not done here should be
noted under this section -->
<!-- if there is a need for a new issue, please link it here -->

### How to test
<!-- if applicable, add testing instructions under this section -->
I've ran [flagd's integration
tests](#312) against this
build to ensure behaviour is as before.

---------

Signed-off-by: Skye Gill <[email protected]>
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 a pull request may close this issue.

2 participants