Skip to content

Conversation

@kylejuliandev
Copy link
Contributor

This PR

Add step definitions for the config.feature tests. At the moment, one of the in-process tests fails as the default port for the in-process resolver is being set to 8013 instead of 8015. I'll raise a issue. The sync-port tests have been ignored for the in-process resolver due to #478. Also the following config options have been skipped as they aren't present in the dotnet flagd provider:

  • deadlineMs
  • fatalStatusCodes
  • targetUri
  • providerId
  • offlineFlagSourcePath
  • offlinePollIntervalMs
  • streamDeadlineMs
  • keepAliveTime
  • retryBackoffMs
  • retryBackoffMaxMs
  • retryGracePeriod

Related Issues

Notes

Follow-up Tasks

How to test

Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
@kylejuliandev kylejuliandev added the provider:flagd Issues related to provider flagd label Jan 25, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kylejuliandev, 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 expands the end-to-end test coverage for the flagd provider by introducing new step definitions for configuration-related scenarios. It ensures that various provider settings can be tested and validated, while also gracefully handling and skipping tests for features not yet implemented in the .NET SDK contrib provider. The changes lay the groundwork for more robust configuration testing and improve the overall stability of the flagd integration.

Highlights

  • New Step Definitions for Configuration Tests: Introduced comprehensive step definitions in ConfigSteps.cs to test various flagd provider configuration options, including host, port, TLS, certificate path, socket path, cache settings, source selector, and resolver type.
  • Handling of Unsupported Configuration Options: Added explicit Skip.If statements for FlagdConfig options not currently supported by the .NET flagd provider, such as deadlineMs, fatalStatusCodes, targetUri, and others, ensuring tests for these options are correctly ignored.
  • Environment Variable Cleanup: Implemented a BeforeScenario hook to clear all FLAGD_ related environment variables before each test scenario, ensuring a clean state for configuration tests.
  • Test Skipping for Known Issues: Added a skip condition for sync-port tagged scenarios in the in-process resolver tests, referencing an existing issue (#478) where this functionality is not yet supported.
  • Feature File Inclusion: Included the config.feature file in both OpenFeature.Contrib.Providers.Flagd.E2e.ProcessTest.csproj and OpenFeature.Contrib.Providers.Flagd.E2e.RpcTest.csproj to enable execution of the new configuration tests.
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 step definitions for config.feature tests, primarily by modifying ConfigSteps.cs. The changes are generally good, but I've identified a few areas for improvement to enhance maintainability and code clarity. My review includes suggestions to reduce code duplication in test skipping logic, remove a redundant assertion, and address unused method parameters. The other changes to project files and test hooks look correct.

}

[Given("an option {string} of type {string} with value {string}")]
public void GivenAnOptionOfTypeWithValue(string option, string type, string value)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The type parameter is not used in this method. The implementation relies on the option name to determine how to parse the value. This makes the type parameter redundant. If the type parameter is part of a shared test specification that cannot be changed, consider adding a comment explaining why it's unused. Otherwise, it should be used for parsing or removed from the step definition.

Comment on lines +63 to +73
Skip.If(option == "deadlineMs", "DeadlineMs is not supported.");
Skip.If(option == "fatalStatusCodes", "FatalStatusCodes is not supported.");
Skip.If(option == "targetUri", "TargetUri is not supported.");
Skip.If(option == "providerId", "ProviderId is not supported.");
Skip.If(option == "offlineFlagSourcePath", "OfflineFlagSourcePath is not supported.");
Skip.If(option == "offlinePollIntervalMs", "OfflinePollIntervalMs is not supported.");
Skip.If(option == "streamDeadlineMs", "StreamDeadlineMs is not supported.");
Skip.If(option == "keepAliveTime", "KeepAliveTime is not supported.");
Skip.If(option == "retryBackoffMs", "RetryBackoffMs is not supported.");
Skip.If(option == "retryBackoffMaxMs", "RetryBackoffMaxMs is not supported.");
Skip.If(option == "retryGracePeriod", "RetryGracePeriod is not supported.");
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This block of Skip.If calls is quite repetitive and could be hard to maintain. Consider creating a static readonly HashSet<string> containing all unsupported options and then checking against it with a single Skip.If call. This would make the code cleaner and more efficient. A similar block of code exists on lines 144-147 that could also be refactored.

var flagdConfigBuilder = this._state.FlagdConfig ?? FlagdConfig.Builder();
this._config = flagdConfigBuilder.Build();

Assert.NotNull(this._state);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The _state field is injected via constructor dependency injection by Reqnroll and is initialized in the constructor. It will not be null at this point, so this assertion is redundant and can be removed.

}

[Then("the option {string} of type {string} should have the value {string}")]
public void ThenTheOptionOfTypeShouldHaveTheValue(string option, string type, string value)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The type parameter is not used in this method, similar to GivenAnOptionOfTypeWithValue. The implementation relies on the option name to determine how to parse and compare the value. This makes the type parameter redundant. If the type parameter is part of a shared test specification that cannot be changed, consider adding a comment explaining why it's unused. Otherwise, it should be used for parsing/comparison or removed from the step definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider:flagd Issues related to provider flagd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant