Skip to content

Changed SDK's structure to align with other C++ projects.#41

Merged
NeaguGeorgiana23 merged 1 commit into
mainfrom
reorganize_project_structure
Dec 10, 2025
Merged

Changed SDK's structure to align with other C++ projects.#41
NeaguGeorgiana23 merged 1 commit into
mainfrom
reorganize_project_structure

Conversation

@NeaguGeorgiana23

Copy link
Copy Markdown
Contributor

This PR

  • Reorganizes the structure of the project and creates more granular rules for BUILD files.

Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
@NeaguGeorgiana23 NeaguGeorgiana23 requested review from a team as code owners December 9, 2025 13:41
@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 refactors the C++ SDK's project layout and build system. The primary goal is to improve the organization and maintainability of the codebase by consolidating files into a more logical directory structure and introducing fine-grained Bazel build rules. This change simplifies dependency management and makes it easier to build and test specific components of the SDK, ultimately enhancing the project's overall development experience.

Highlights

  • Project Structure Reorganization: The SDK's file structure has been reorganized, moving header files from include/openfeature/ and source files from src/ into a consolidated openfeature/ directory. This aligns the project with common C++ conventions.
  • Granular Bazel BUILD Rules: The previous monolithic include/BUILD and src/BUILD files have been replaced by a single, highly granular openfeature/BUILD file. This new file defines individual cc_library targets for each major component of the SDK (e.g., client, provider, evaluation context), enhancing modularity and build efficiency.
  • Updated Internal References: All internal include paths within source files and dependencies specified in test/BUILD have been updated to reflect the new file locations and the granular Bazel targets defined in the openfeature/BUILD file.
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 effectively reorganizes the SDK's project structure, introducing more granular Bazel build rules that align with common C++ project practices. This is a significant improvement for maintainability and build efficiency. The file relocations and corresponding updates to include paths and build dependencies are correct. I have one suggestion for the new openfeature/BUILD file to further enhance its readability and maintainability by reducing boilerplate code.

Comment thread openfeature/BUILD
Comment on lines +16 to +24
cc_library(
name = "error_code",
hdrs = ["error_code.h"],
)

cc_library(
name = "evaluation_context",
hdrs = ["evaluation_context.h"],
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To improve maintainability and reduce boilerplate, you can define the simple header-only libraries using a loop. This makes the BUILD file more concise and easier to manage as you add more header-only components.

For example, you could group error_code, evaluation_context, flag_metadata, metadata, provider_status, and reason like this, replacing their individual cc_library definitions:

[cc_library(
    name = lib,
    hdrs = [lib + ".h"],
) for lib in [
    "error_code",
    "evaluation_context",
    "flag_metadata",
    "metadata",
    "provider_status",
    "reason",
]]

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.

Following on that, I don't think loop is a good option, but I would consider grouping them more together.
Maybe we could add F.e.
error_code as part of resolution details library
metadata as part of provider

I'm not sure if that's best practice but wanted to consider that. @oxddr what do you think?

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.

Yes, definitely don't follow this advice - it's wrong.

@NeaguGeorgiana23 NeaguGeorgiana23 merged commit ccd4c26 into main Dec 10, 2025
2 checks passed
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.

4 participants