-
Notifications
You must be signed in to change notification settings - Fork 219
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
feat: add single evaluation endpoint for OFREP #3267
feat: add single evaluation endpoint for OFREP #3267
Conversation
Have you had a chance to check this out @markphelps / @GeorgeMac / @erka? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking great @thepabloaguilar !! great approach
just a few comments so far
@thepabloaguilar can I help with anything here? |
@markphelps I'm gonna take a look this weekend! Tough week 😆 |
f6db8ef
to
c02def3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3267 +/- ##
==========================================
+ Coverage 64.26% 64.42% +0.15%
==========================================
Files 168 172 +4
Lines 13582 13731 +149
==========================================
+ Hits 8729 8846 +117
- Misses 4185 4207 +22
- Partials 668 678 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Great work @thepabloaguilar! I tried to use OpenFeature go client for OFREP and somehow it ins't happy with the our ❯ curl -X POST http://localhost:8080/ofrep/v1/evaluate/flags/variant-flag
{"key":"variant-flag","reason":"DEFAULT","variant":"azul","metadata":null,"value":"azul"} This is my example package main
import (
"context"
"github.com/open-feature/go-sdk-contrib/providers/ofrep"
"github.com/open-feature/go-sdk/openfeature"
)
func main() {
ofrepProvider := ofrep.NewProvider("http://localhost:8080")
openfeature.SetProvider(ofrepProvider)
client := openfeature.NewClient("default")
value := client.String(context.Background(), "variant-flag", "", openfeature.EvaluationContext{})
println("result", value)
} I have no issue if I add empty metadata in |
c02def3
to
ceef795
Compare
@erka the return must be an empty object |
@thepabloaguilar I added support for ofrep |
Signed-off-by: Pablo Aguilar <[email protected]>
Signed-off-by: Pablo Aguilar <[email protected]>
Signed-off-by: Pablo Aguilar <[email protected]>
0f94078
to
0ea1d59
Compare
Signed-off-by: Pablo Aguilar <[email protected]>
Done the changes! Sorry @markphelps unconsciously I overrode your changes but I've put them back |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! @thepabloaguilar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! thank you @thepabloaguilar !!
Hi guys, I'm opening this PR to gather opinions around the implementation of this endpoint for OFREP! What I thought was to just translate the protocol to Flipt internals and I did it by declaring an interface which is implemented by evaluation server as all the stuff to evaluate a flag is there, and also the OFREP layer will translate the errors to the expected pattern.
Refs #2980