Skip to content

feat: Add support for Flagd-Selector header when syncing flags with InProcess resolver#604

Open
kylejuliandev wants to merge 2 commits intoopen-feature:mainfrom
kylejuliandev:update-flagd-schemas-submodule
Open

feat: Add support for Flagd-Selector header when syncing flags with InProcess resolver#604
kylejuliandev wants to merge 2 commits intoopen-feature:mainfrom
kylejuliandev:update-flagd-schemas-submodule

Conversation

@kylejuliandev
Copy link
Contributor

@kylejuliandev kylejuliandev commented Mar 5, 2026

This PR

Builds on #595 by adding updating the flagd schemas submodule and adds support for sending a SyncFlags gRPC request with a Flagd-Selector header. We need to supress the obsolete Selector = this._config.SourceSelector property so it will continue to build but this allows us to utilise both methods. The gRPC Header takes precendence and the selector in the protbuf body is being deprecated.

Related Issues

Notes

Follow-up Tasks

How to test

renovate bot and others added 2 commits March 5, 2026 12:03
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
@gemini-code-assist
Copy link
Contributor

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 enhances the InProcess resolver for Flagd by introducing the capability to utilize the Flagd-Selector header during flag synchronization, building on previous work. This change allows for more refined control over which flags are retrieved. It also includes an update to the underlying flagd schemas and ensures backward compatibility with the existing Selector property by explicitly handling its obsolescence.

Highlights

  • Flagd-Selector Header Support: Implemented support for sending the Flagd-Selector header with SyncFlags gRPC requests in the InProcess resolver, allowing for more precise flag synchronization.
  • Schema Submodule Update: Updated the flagd schemas git submodule to incorporate the latest schema definitions.
  • Obsolete Property Handling: Managed the use of the obsolete Selector property in SyncFlagsRequest by applying #pragma warning disable CS0612 to ensure continued build compatibility.
  • Test Suite Updates: Adjusted existing unit tests to correctly mock and assert SyncFlags calls, now accounting for the new Metadata parameter and the Flagd-Selector header.
Changelog
  • src/OpenFeature.Contrib.Providers.Flagd/Resolver/InProcess/InProcessResolver.cs
    • Modified the SyncFlags gRPC call to pass Flagd-Selector as a gRPC metadata header.
    • Wrapped the SyncFlagsRequest instantiation with #pragma warning disable CS0612 and #pragma warning restore CS0612 to handle the obsolete Selector property.
  • src/OpenFeature.Contrib.Providers.Flagd/schemas
    • Updated the git submodule reference to 9f823b5b36bf219f8ea342de006fdf5013c1bc79.
  • test/OpenFeature.Contrib.Providers.Flagd.Test/FlagdProviderTest.cs
    • Updated mockGrpcClient.SyncFlags setup to accept Arg.Any<Metadata>() for the headers parameter.
    • Modified mockGrpcClient.Received assertion to check both the Selector property in the request and the Flagd-Selector value in the Metadata headers.
  • test/OpenFeature.Contrib.Providers.Flagd.Test/Resolver/InProcess/InProcessResolverTests.cs
    • Updated mockGrpcClient.SyncFlags setup to accept Arg.Any<Grpc.Core.Metadata>() for the headers parameter.
Activity
  • No specific activity (comments, reviews, etc.) was provided in the context.
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.

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 adds support for the Flagd-Selector header when using the InProcess resolver, which is a good feature enhancement. The implementation correctly sends both the new header and the obsolete Selector property for backward compatibility. The associated tests have been updated to verify this new behavior.

@github-actions github-actions bot requested review from bacherfl and toddbaert March 5, 2026 23:07
@kylejuliandev kylejuliandev marked this pull request as ready for review March 9, 2026 00:01
@kylejuliandev kylejuliandev requested review from a team as code owners March 9, 2026 00:01
Copy link
Member

@askpt askpt left a comment

Choose a reason for hiding this comment

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

LGTM. I am just wondering if we can change this to use the new behaviour instead of marking as warning disable.

Comment on lines +118 to +123
#pragma warning disable CS0612 // Type or member is obsolete
var request = new SyncFlagsRequest()
{
Selector = this._config.SourceSelector
};
#pragma warning restore CS0612 // Type or member is obsolete
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if there is an alternative for this (instead of ignoring the warning).

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