Skip to content

Fix for new EvaluationContext interface in cpp-sdk#56

Merged
m-olko merged 1 commit into
mainfrom
new_evaluationcontext
Feb 10, 2026
Merged

Fix for new EvaluationContext interface in cpp-sdk#56
m-olko merged 1 commit into
mainfrom
new_evaluationcontext

Conversation

@m-olko

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

Copy link
Copy Markdown
Contributor

This PR

New version of cpp-sdk removed default constructor for EvaluationContext. This PR contains updates for all tests to handle that change.

gbazelisk test //...

@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 updates the flagd provider's test suite to align with a recent breaking change in the cpp-sdk library. Specifically, it addresses the removal of the default constructor for openfeature::EvaluationContext, ensuring that all test cases correctly instantiate this object using its new builder pattern. This maintains compatibility and the integrity of the test environment.

Highlights

  • Adaptation to cpp-sdk's EvaluationContext interface change: The default constructor for openfeature::EvaluationContext was removed in a new version of cpp-sdk, requiring updates to its instantiation throughout the codebase.
  • Updated EvaluationContext instantiation: All affected test cases now explicitly use openfeature::EvaluationContext::Builder().build() to create EvaluationContext objects, aligning with the new interface.
  • Minor TriggerUpdate adjustment: In evaluator_test.cpp, the TriggerUpdate method was updated to pass the entire nlohmann::json object directly, rather than accessing a specific 'flags' sub-object.
Changelog
  • providers/flagd/tests/evaluator_test.cpp
    • Changed TriggerUpdate to pass the full nlohmann::json object instead of new_json["flags"].
    • Modified openfeature::EvaluationContext instantiation in ResolveBoolean_Success, ResolveBoolean_FlagNotFound, ResolveBoolean_TypeMismatch, and ResolveBoolean_VariantNotFound tests to use Builder().build().
  • providers/flagd/tests/smoke/grpc_sync.cpp
    • Updated openfeature::EvaluationContext instantiation for the test.Init() call to use Builder().build().
  • providers/flagd/tests/smoke/openfeature.cpp
    • Adjusted openfeature::EvaluationContext instantiation for provider->GetBooleanEvaluation() to use Builder().build().
  • providers/flagd/tests/smoke/sync.cpp
    • Updated openfeature::EvaluationContext instantiation in InitAndShutdownReturnOk and GrpcSyncTest.InitTwiceDoesNotCrash tests to use Builder().build().
Activity
  • The author, m-olko, initiated this pull request to fix compatibility issues with the cpp-sdk.
  • The description indicates that tests were run locally using gbazelisk test //....
  • No other human activity (comments, reviews, approvals) has been recorded for this pull request.
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 correctly updates the codebase to accommodate the removal of the default constructor for EvaluationContext in the cpp-sdk. The changes are primarily within test files, ensuring they compile with the new API. I've included a few suggestions to enhance conciseness by inlining the EvaluationContext creation where it's used only once.

Comment thread providers/flagd/tests/evaluator_test.cpp
Comment thread providers/flagd/tests/evaluator_test.cpp
Comment thread providers/flagd/tests/evaluator_test.cpp
Comment thread providers/flagd/tests/evaluator_test.cpp
Comment thread providers/flagd/tests/smoke/grpc_sync.cpp
Comment thread providers/flagd/tests/smoke/openfeature.cpp
Comment thread providers/flagd/tests/smoke/sync.cpp
Signed-off-by: Marcin Olko <molko@google.com>
@m-olko m-olko force-pushed the new_evaluationcontext branch from 52c50ae to e3e37c6 Compare February 6, 2026 15:27
@m-olko m-olko marked this pull request as ready for review February 6, 2026 15:28
@m-olko m-olko requested a review from oxddr February 6, 2026 15:28
@m-olko m-olko merged commit 539febc into main Feb 10, 2026
2 checks passed
@m-olko m-olko deleted the new_evaluationcontext branch February 10, 2026 12:49
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.

2 participants