Skip to content

Global and Client API#50

Closed
NeaguGeorgiana23 wants to merge 6 commits into
mainfrom
glonal_api
Closed

Global and Client API#50
NeaguGeorgiana23 wants to merge 6 commits into
mainfrom
glonal_api

Conversation

@NeaguGeorgiana23

@NeaguGeorgiana23 NeaguGeorgiana23 commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

This PR

Adds the logic for GlobalAPI and ClientAPI.

Related Issues

Fixes #29 and #34

Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @NeaguGeorgiana23, 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 lays the groundwork for the OpenFeature C++ SDK by introducing the ClientAPI and OpenFeatureAPI components. The OpenFeatureAPI serves as a global singleton for managing feature providers and their lifecycle, including initialization and shutdown, while the ClientAPI provides the primary interface for applications to evaluate feature flags and manage client-specific evaluation contexts. The changes also streamline the core OpenFeature interface and enhance the robustness of provider management by ensuring a consistent default state after system shutdown.

Highlights

  • Core API Introduction: New ClientAPI and OpenFeatureAPI classes are introduced, forming the foundation of the OpenFeature C++ SDK.
  • API Interface Refinement: The OpenFeature interface is updated, removing SetProviderAndWait overloads with timeouts and adding const qualifiers to several getter methods for better immutability.
  • Provider Management Enhancements: The ProviderRepository now ensures that after a Shutdown operation, the system gracefully resets to a default NoopProvider in a ready state.
  • Build System Updates: openfeature/BUILD and test/BUILD files are updated to include the new API components and their corresponding unit tests.
  • Comprehensive Unit Tests: New test files (client_api_test.cpp, openfeature_api_test.cpp) are added to validate the functionality of the new API classes, covering singleton behavior, provider management, and asynchronous operations.
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

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 introduces the ClientAPI and OpenFeatureAPI implementations, which is a significant step forward. However, the current changes include several critical issues that need to be addressed before this can be merged. These issues include a circular dependency in the build configuration, incorrect handling of the singleton pattern which will lead to compilation errors and potential memory corruption, and a race condition on the evaluation context. I've also pointed out a few other issues related to correctness and maintainability, such as an incorrect include guard, a missing override specifier, flawed logic in context merging, and an outdated test. My review provides detailed feedback and suggestions for each of these points.

Comment thread openfeature/BUILD Outdated
Comment thread openfeature/client_api.h Outdated
Comment thread openfeature/openfeature_api.cpp
Comment thread openfeature/openfeature_api.cpp Outdated
Comment thread openfeature/client_api.cpp
Comment thread test/openfeature_api_test.cpp Outdated
Comment thread openfeature/client_api.h Outdated
Comment thread openfeature/client_api.cpp Outdated
Comment thread openfeature/client_api.cpp Outdated
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
Comment thread test/global_context_manager_test.cpp
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
@NeaguGeorgiana23 NeaguGeorgiana23 marked this pull request as ready for review January 27, 2026 09:40
@NeaguGeorgiana23 NeaguGeorgiana23 requested review from a team as code owners January 27, 2026 09:40
@oxddr

oxddr commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Please rename this PR so the title matches the content.

@NeaguGeorgiana23 NeaguGeorgiana23 changed the title Draft PR Global and Client API Jan 27, 2026
@NeaguGeorgiana23 NeaguGeorgiana23 removed the request for review from alichka06 January 27, 2026 12:24
@NeaguGeorgiana23

Copy link
Copy Markdown
Contributor Author

This PR was splitted in smaller ones. See: Global Context Manager, Client API and Global API

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.

Implement OpenFeature Global API

2 participants