Skip to content

Conversation

@zhiyuanliang-ms
Copy link
Member

Why this PR?

#507

@zhiyuanliang-ms zhiyuanliang-ms marked this pull request as draft May 15, 2025 15:08
@zhiyuanliang-ms zhiyuanliang-ms marked this pull request as ready for review May 20, 2025 03:36
@jimmyca15 jimmyca15 requested a review from Copilot May 28, 2025 20:38
// IFeatureDefinitionProviderCacheable interface is only used to mark this provider as cacheable. This allows our test suite's
// provider to be marked for caching as well.

private static readonly PropertyInfo _propertyInfo = typeof(ConfigurationProvider).GetProperty("Data", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
Copy link
Member

Choose a reason for hiding this comment

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

Can you put a comment that compile time dependency ensures presence of this property via OnDemandConfigurationProvider.Data

Copy link
Member

Choose a reason for hiding this comment

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

I wish we could really take advantage of the compile time dependency. Like if we could have a static method inside of OnDemandConfigurationProvider that uses nameof(data) to enforce the dependency.

Copy link
Member Author

Choose a reason for hiding this comment

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

internal class OnDemandConfigurationProvider : ConfigurationProvider
{
    private static readonly PropertyInfo _propertyInfo = typeof(ConfigurationProvider).GetProperty(nameof(Data), BindingFlags.NonPublic | BindingFlags.Instance);

    public OnDemandConfigurationProvider(ConfigurationProvider configurationProvider)
    {
        var data = _propertyInfo.GetValue(configurationProvider) as IDictionary<string, string>;

        Data = data;
    }
}

Is this what you want? @jimmyca15

Copy link

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

This PR implements merging of feature flags from multiple configuration sources by adding new JSON configuration files, updating dependency versions, and enhancing the ConfigurationFeatureDefinitionProvider to handle on‑demand flag extraction.

  • Added three new appsettings JSON files with varying feature flag values.
  • Updated test projects and added a new integration test to validate feature flag merging behavior.
  • Enhanced the provider logic in the main library to aggregate feature definitions from chained configuration sources.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Tests.FeatureManagement/appsettings1.json, appsettings2.json, appsettings3.json New JSON configuration files with feature flag definitions
tests/Tests.FeatureManagement/Tests.FeatureManagement.csproj, tests/Tests.FeatureManagement.AspNetCore/Tests.FeatureManagement.AspNetCore.csproj Upgraded dependency versions and ensured configuration files copy to output
tests/Tests.FeatureManagement/FeatureManagementTest.cs Added integration test verifying the merged configuration behavior
src/Microsoft.FeatureManagement/OnDemandConfigurationProvider.cs Introduced a provider to enable on‑demand configuration extraction
src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj Upgraded dependency versions to align with new features and fixes
src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs Updated logic to cache and refresh feature definition sections from various configuration sources

@zhiyuanliang-ms zhiyuanliang-ms requested a review from jimmyca15 June 4, 2025 03:41
@zhiyuanliang-ms zhiyuanliang-ms deleted the zhiyuanliang/merge-ff-source branch November 9, 2025 12:24
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