open-feature / flagd

A feature flag daemon with a Unix philosophy
https://openfeature.dev
Apache License 2.0
569 stars 67 forks source link

[Improvement] Improve bulk evaluator with ability to return errors #1328

Closed Kavindu-Dodan closed 5 months ago

Kavindu-Dodan commented 5 months ago

Requirements

Background

flagd's IResolver defines ResolveAllValues contract and currently it only supports returning an array of values [1]. This contract is currently used by flagd's ofrep implementation.

Improvement

Given flagd's core is reusable, it should support returning bulk evaluation errors. For example, this could happen as a result of an invalid Store value or Store retrieval error [2].

AC

Consider adding error return based on potential errors that could happen with bulk evaluation (for example Store errors). Further use this in OFREP evaluation and utilize error response for bulk evaluation [3]

[1] - https://github.com/open-feature/flagd/blob/flagd/v0.10.3/core/pkg/evaluator/ievaluator.go#L77 [2] - https://github.com/open-feature/flagd/blob/flagd/v0.10.3/core/pkg/store/flags.go#L15 [3] - https://github.com/open-feature/protocol/blob/main/service/openapi.yaml#L137-L142