Skip to content

feat: Add targeting match split#256

Open
GStrawinsky wants to merge 2 commits intoopen-feature:mainfrom
GStrawinsky:main
Open

feat: Add targeting match split#256
GStrawinsky wants to merge 2 commits intoopen-feature:mainfrom
GStrawinsky:main

Conversation

@GStrawinsky
Copy link
Copy Markdown

This PR

  • adds this new feature

Related Issues

Fixes #1234523

Notes

Follow-up Tasks

How to test

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 introduces a new reason, "TARGETING_MATCH_SPLIT", to the OpenFeature SDK. This enhancement provides more granular detail regarding the outcome of feature flag evaluations, specifically when a targeting rule matches and a split is applied. This allows for more precise understanding and handling of feature flag resolution logic.

Highlights

  • New Reason Constant: Added "TARGETING_MATCH_SPLIT" as a new constant within the Reason module, expanding the set of possible evaluation outcomes for feature flags.
  • Type Definition Update: Included the type definition for "TARGETING_MATCH_SPLIT" in sig/open_feature/sdk/provider/reason.rbs to maintain type consistency and enable static analysis.
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.

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.

Copy link
Copy Markdown

@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 new reason, TARGETING_MATCH_SPLIT, to the OpenFeature SDK, adding it to both the Ruby constant definition and its RBS type signature. The review suggests a minor consistency improvement for the RBS type definition, recommending String (with a capital 'S') instead of string.

SPLIT: String
CACHED: String
DISABLED: String
TARGETING_MATCH_SPLIT: string
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

For consistency with the other type definitions in this file, please use String (with a capital 'S') instead of string.

        TARGETING_MATCH_SPLIT: String

Signed-off-by: Gabrielė Stravinskaitė <gabriele.stravinskaite@vinted.com>
Signed-off-by: Gabrielė Stravinskaitė <gabriele.stravinskaite@vinted.com>
@GStrawinsky GStrawinsky changed the title add targeting match split feat: Add targeting match split Mar 26, 2026
@GStrawinsky GStrawinsky marked this pull request as ready for review March 26, 2026 15:09
@GStrawinsky GStrawinsky requested a review from a team as a code owner March 26, 2026 15:09
Copilot AI review requested due to automatic review settings March 26, 2026 15:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new provider resolution reason constant (TARGETING_MATCH_SPLIT) to the OpenFeature SDK, expanding the set of standardized “reason” values providers can return.

Changes:

  • Add TARGETING_MATCH_SPLIT constant to OpenFeature::SDK::Provider::Reason implementation.
  • Add corresponding TARGETING_MATCH_SPLIT constant to the RBS signature for Reason.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
sig/open_feature/sdk/provider/reason.rbs Adds the new reason constant to the type signature.
lib/open_feature/sdk/provider/reason.rb Adds the new reason constant to the runtime module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 8 to +11
SPLIT: String
CACHED: String
DISABLED: String
TARGETING_MATCH_SPLIT: String
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

In the RBS signature, TARGETING_MATCH_SPLIT is inserted after DISABLED, but in the Ruby implementation it’s placed right after TARGETING_MATCH. Keeping the constant order consistent between reason.rb and reason.rbs makes it easier to diff/scan and reduces the chance of missing future updates—please move the RBS constant to match the Ruby ordering.

Suggested change
SPLIT: String
CACHED: String
DISABLED: String
TARGETING_MATCH_SPLIT: String
TARGETING_MATCH_SPLIT: String
SPLIT: String
CACHED: String
DISABLED: String

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.50%. Comparing base (fa8026f) to head (becfee7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #256   +/-   ##
=======================================
  Coverage   99.50%   99.50%           
=======================================
  Files          31       31           
  Lines         808      809    +1     
=======================================
+ Hits          804      805    +1     
  Misses          4        4           

☔ 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.

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.

3 participants