Skip to content

Conversation

@erka
Copy link
Member

@erka erka commented Nov 11, 2025

This PR

  • Add WithRunModeParallel option to enable concurrent provider evaluations for multi provider.
  • Refactor internals

@erka erka requested review from a team as code owners November 11, 2025 20:06
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @erka, 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 significantly enhances the multi-provider functionality by introducing a configurable run mode, allowing for parallel evaluation of feature providers. This change provides greater flexibility and potential performance improvements for applications utilizing multiple feature flags, enabling them to choose between sequential and concurrent evaluation strategies based on their specific needs.

Highlights

  • Parallel Run Mode: Introduced a new WithRunModeParallel option to enable concurrent evaluation of feature providers within the multi-provider setup, allowing for potentially faster flag resolution.
  • Refactored Evaluation Strategies: The Comparison, FirstMatch, and FirstSuccess evaluation strategies have been refactored to accept a runModeFn parameter, abstracting the execution logic for provider evaluations.
  • New Run Mode Abstraction: A new file run_mode.go was added, defining runModeFn and providing two implementations: runModeParallel for concurrent execution and runModeSequential for ordered execution. The default behavior remains sequential.
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.

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

❌ Patch coverage is 86.71329% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.98%. Comparing base (4b3d6d9) to head (2eaacef).

Files with missing lines Patch % Lines
openfeature/multi/multiprovider.go 73.17% 11 Missing ⚠️
openfeature/multi/run_mode.go 84.61% 6 Missing ⚠️
openfeature/multi/comparison_strategy.go 97.67% 1 Missing ⚠️
openfeature/multi/isolation.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #447      +/-   ##
==========================================
- Coverage   83.12%   82.98%   -0.14%     
==========================================
  Files          27       28       +1     
  Lines        2098     2122      +24     
==========================================
+ Hits         1744     1761      +17     
- Misses        305      313       +8     
+ Partials       49       48       -1     
Flag Coverage Δ
e2e 82.98% <86.71%> (-0.14%) ⬇️
unit 82.98% <86.71%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@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 runMode option to allow for parallel evaluation of providers in the multi-provider implementation, which is a great enhancement for performance and flexibility. The refactoring to use Go iterators for abstracting the execution model is clean and well-implemented. My review includes suggestions to improve documentation clarity for the new parallel execution behavior, enhance code readability by addressing variable shadowing, and fix an incorrect assertion in one of the tests.

@erka
Copy link
Member Author

erka commented Nov 12, 2025

/gemini review

Copy link
Contributor

@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 significant and well-designed refactoring to support parallel execution of providers in the multi-provider setup. The core idea of separating the execution logic (runMode) from the evaluation strategy using iterators is excellent for flexibility and maintainability. The introduction of WithRunModeParallel provides a clean API for users to enable this new feature. The code changes are consistent and the tests have been updated accordingly. I've found a few issues in the documentation that need to be addressed to avoid confusion, and a minor typo in the code. Overall, this is a great enhancement.

Add WithRunModeParallel option to enable concurrent provider evaluations.

Signed-off-by: Roman Dmytrenko <[email protected]>
@erka erka force-pushed the rd/multi-run-mode branch from 2288ea7 to 2eaacef Compare December 7, 2025 15:07
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.

1 participant