Changed SDK's structure to align with other C++ projects.#41
Conversation
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| cc_library( | ||
| name = "error_code", | ||
| hdrs = ["error_code.h"], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "evaluation_context", | ||
| hdrs = ["evaluation_context.h"], | ||
| ) |
There was a problem hiding this comment.
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",
]]There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Yes, definitely don't follow this advice - it's wrong.
This PR