Skip to content

Conversation

@erenatas
Copy link
Contributor

@erenatas erenatas commented Nov 1, 2025

This PR

This change may be breaking to existing users

If both FLAGD_OFFLINE_FLAG_SOURCE_PATH and FLAGD_RESOLVER were set, FLAGD_OFFLINE_FLAG_SOURCE_PATH overrode the resolver type to File, ignoring FLAGD_RESOLVER.
What is done now:
FLAGD_RESOLVER takes precedence. If set, it is respected and FLAGD_OFFLINE_FLAG_SOURCE_PATH does not override the resolver type to File.

Add evaluation behavioral tests as well, did not require any change in implementation except error mapping with expectation

Related Issues

Improves #43

Notes

Follow-up Tasks

How to test

@gemini-code-assist
Copy link

Summary of Changes

Hello @erenatas, 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 modernizes the project by updating to the Rust 2024 edition and bringing various dependencies to their latest versions. It introduces significant enhancements to the flagd provider, focusing on improved cache management and a more robust targeting evaluation system through an updated integration with datalogic-rs. The env-var provider also benefits from refined testing practices, ensuring greater stability and reliability across the board.

Highlights

  • Rust Edition and Dependency Updates: The project has been updated to Rust 2024 edition across multiple crates (main, env-var, flagd, flipt), along with a bump in the minimum supported Rust version (MSRV) for flagd. Numerous dependencies, including open-feature, async-trait, tokio, tonic, prost, datalogic-rs, and various testing utilities, have been upgraded to their latest versions.
  • Enhanced env-var Provider Testing: The env-var provider's example code and Cucumber tests have been refactored to use temp-env and test-with::runner! for safer and more isolated environment variable handling, preventing test pollution and ensuring reliable test execution.
  • flagd Provider Cache Management: The flagd provider's cache service now includes a purge method, and both FileResolver and InProcessResolver have been updated to clear their caches automatically when flag store updates are detected, ensuring data freshness.
  • Improved flagd Targeting Logic: The flagd provider's in-process targeting logic has been significantly refactored to integrate with the updated datalogic-rs library's Operator trait. This change modernizes the fractional and semver targeting implementations, improving context handling and evaluation.
  • Code Modernization and Test Reliability: The codebase now utilizes newer Rust syntax like if let Some(...) && let Some(...) for cleaner optional value unwrapping. Additionally, retry mechanism tests in flagd have been made more robust by using dynamic ports, and environment variable handling in gherkin_config_test.rs has been improved for better test isolation.
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.

@erenatas erenatas marked this pull request as draft November 1, 2025 10:59
Copy link

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

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 a number of significant improvements and fixes across the flagd and env-var crates. Key changes include upgrading to the Rust 2024 edition, updating numerous dependencies, and most notably, a major refactoring of the in-process targeting engine to use datalogic-rs v4. This refactoring has greatly improved the code's safety and clarity, especially in the fractional and semver targeting operators.

The behavioral tests have also been substantially improved for better conformance and reliability. The use of test-with and temp-env to manage environment variables in tests is a great change that addresses potential flakiness from parallel test execution.

I have one suggestion in crates/flagd/src/resolver/in_process/resolver/grpc.rs to improve code consistency in cache handling, bringing it in line with the FileResolver. Overall, this is a high-quality pull request with excellent changes.

erenatas and others added 8 commits November 3, 2025 08:59
@erenatas erenatas force-pushed the eren/behavioral-conformance-1 branch from 3142335 to f5c6a3b Compare November 3, 2025 08:02
@erenatas erenatas marked this pull request as ready for review November 3, 2025 08:05
@erenatas erenatas changed the title fix: flagd, behavioral tests conformance fix: flagd, behavioral tests conformance (evaluation and config) Nov 3, 2025

if options.source_configuration.is_some() && options.resolver_type != ResolverType::Rpc {
let resolver_env_set = std::env::var("FLAGD_RESOLVER").is_ok();
if options.source_configuration.is_some() && !resolver_env_set {
Copy link
Member

Choose a reason for hiding this comment

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

should we also add a check here that source_configuration needs to be set, if the ResolverType is file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you very much! I updated it.

Copy link
Member

Choose a reason for hiding this comment

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

i am not sure i can really provide a review - i have no clue about rust, i just saw that this behaviour was missing, but i can give it a shot

@beeme1mr beeme1mr changed the title fix: flagd, behavioral tests conformance (evaluation and config) fix!: flagd, behavioral tests conformance (evaluation and config) Nov 3, 2025
Signed-off-by: Eren Atas <[email protected]>
@erenatas erenatas requested a review from aepfli November 4, 2025 13:29
Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

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

I'm in the same boat as @aepfli. I don't know Rust well enough to be confident in my review but the change is relatively straightforward and looks okay to me.

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