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

feat(ofrep): implement bulk evaluation for OFREP #3364

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

erka
Copy link
Collaborator

@erka erka commented Aug 10, 2024

resolves #3332

Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 83.73984% with 20 lines in your changes missing coverage. Please review.

Project coverage is 64.55%. Comparing base (03b1358) to head (3d972aa).

Files Patch % Lines
internal/server/ofrep/evaluation.go 81.66% 6 Missing and 5 partials ⚠️
internal/server/ofrep/errors.go 80.95% 2 Missing and 2 partials ⚠️
internal/server/evaluation/ofrep_bridge.go 88.23% 1 Missing and 1 partial ⚠️
internal/server/ofrep/middleware.go 91.66% 1 Missing and 1 partial ⚠️
internal/cmd/http.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3364      +/-   ##
==========================================
+ Coverage   64.42%   64.55%   +0.13%     
==========================================
  Files         172      172              
  Lines       13824    13871      +47     
==========================================
+ Hits         8906     8955      +49     
+ Misses       4234     4230       -4     
- Partials      684      686       +2     
Flag Coverage Δ
unittests 64.55% <83.73%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
@erka
Copy link
Collaborator Author

erka commented Aug 13, 2024

I don't have an idea how it is possible to add integration test for this. Go ofrep provider doesn't support bulk operation at the moment.

This is a minimal setup for ofrep-web

import { OFREPWebProvider } from "@openfeature/ofrep-web-provider";
import { OpenFeature } from "@openfeature/web-sdk";

const ctx = { targetingKey: "fruit", flags: "variant-flag,boolean-flag" };
const o = new OFREPWebProvider(
  { baseUrl: "http://host.docker.internal:8080" },
  console
);

OpenFeature.setContext(ctx);
await OpenFeature.setProviderAndWait(o);

const result = OpenFeature.getClient().getStringValue("variant-flag", "default");

console.log("result", result);

OpenFeature.close();

@erka erka marked this pull request as ready for review August 13, 2024 20:10
@erka erka requested a review from a team as a code owner August 13, 2024 20:10
@markphelps
Copy link
Collaborator

Looks great @erka ! Thank you very much!!

I made one minor update here: erka#20 , lmk what you think

Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! We could add ITs for the bulk eval endpoints using plain HTTP/REST in a future PR

@erka erka merged commit ba51da9 into flipt-io:main Aug 14, 2024
35 checks passed
@erka erka deleted the ofrep-bulk-evaluation branch August 14, 2024 12:07
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.

[FLI-1123] Support bulk flag evaluation in OFREP
2 participants