Skip to content

Attached evaluator to provider#50

Merged
m-olko merged 2 commits into
mainfrom
evaluator_provider
Feb 6, 2026
Merged

Attached evaluator to provider#50
m-olko merged 2 commits into
mainfrom
evaluator_provider

Conversation

@m-olko

@m-olko m-olko commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

This PR

Connects Evaluator to Provider

Related Issues

Fixes #40

Signed-off-by: Marcin Olko <molko@google.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @m-olko, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the flagd provider by integrating a dedicated Evaluator component. This integration enables the provider to perform actual feature flag resolution using JsonLogicEvaluator, moving beyond returning default values. The change also involves adjusting the ownership of the FlagSync mechanism to a shared pointer, facilitating its use by the newly introduced evaluator. This is a foundational step towards making the flagd provider fully functional for flag evaluation.

Highlights

  • Evaluator Integration: The flagd provider now includes an evaluator dependency and integrates a JsonLogicEvaluator to handle feature flag resolution.
  • Shared Pointer for Sync: The FlagSync member in FlagdProvider has been changed from std::unique_ptr to std::shared_ptr, likely to allow shared ownership with the new evaluator.
  • Flag Evaluation Logic: The GetBooleanEvaluation method in FlagdProvider now utilizes the evaluator_ for resolving boolean flags and returns an error if the provider is not ready.
  • Smoke Test Update: The openfeature.cpp smoke test has been updated to correctly assert the ProviderNotReady error state when evaluation is attempted before initialization.
Changelog
  • providers/flagd/src/BUILD
    • Added a build dependency on the :evaluator target.
  • providers/flagd/src/provider.cpp
    • Changed sync_ from std::make_unique to std::make_shared for shared ownership.
    • Initialized evaluator_ as a std::unique_ptr<JsonLogicEvaluator>, passing the shared sync_ instance.
    • Modified GetBooleanEvaluation to check is_ready_ and return a ProviderNotReady error if false, otherwise delegates to evaluator_->ResolveBoolean.
  • providers/flagd/src/provider.h
    • Included flagd/evaluator.h.
    • Updated sync_ from std::unique_ptr<FlagSync> to std::shared_ptr<FlagSync>.
    • Added std::unique_ptr<Evaluator> evaluator_ as a private member.
  • providers/flagd/tests/smoke/openfeature.cpp
    • Updated the FlagdProviderTest to expect openfeature::ErrorCode::kProviderNotReady and openfeature::Reason::kError when GetBooleanEvaluation is called before the provider is ready.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request successfully connects the Evaluator to the FlagdProvider, enabling flag evaluation. The changes involve updating the provider to initialize and use an evaluator, and modifying the GetBooleanEvaluation method to delegate to it after checking for provider readiness. The use of std::shared_ptr for the FlagSync object to share it with the evaluator is a reasonable approach. One comment has been retained regarding clarity in a test file.

Comment thread providers/flagd/tests/smoke/openfeature.cpp Outdated
Signed-off-by: Marcin Olko <molko@google.com>
@m-olko m-olko requested review from alichka06 and oxddr February 5, 2026 10:14
@m-olko m-olko marked this pull request as ready for review February 5, 2026 10:16
@m-olko m-olko merged commit c71bed4 into main Feb 6, 2026
2 checks passed
@m-olko m-olko deleted the evaluator_provider branch February 6, 2026 08:29
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.

[flagd] Connect Evaluator interface with flagdProvider

3 participants