Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding a Provider implementation on top of the standard dotnet FeatureManagement system. #129

Merged

Conversation

ericpattison
Copy link
Contributor

This is currently dependent on a preview feature being added to the standard dotnet FeatureManagement library called Variants.

This new feature is required as with out it, features are either on or off. Variants allow feature flags to provide configuration based values.

@ericpattison ericpattison requested a review from a team as a code owner January 9, 2024 20:28
@ericpattison ericpattison changed the title Adding a Provider implementation on top of the standard dotnet FeatureManagement system. feat: Adding a Provider implementation on top of the standard dotnet FeatureManagement system. Jan 9, 2024
@ericpattison ericpattison force-pushed the feature/FeatureManagementProvider branch from 6fe721d to 5dc3a85 Compare January 9, 2024 20:38
@ericpattison ericpattison force-pushed the feature/FeatureManagementProvider branch from af5ed19 to ba4bb99 Compare January 10, 2024 19:41
ericpattison and others added 7 commits January 10, 2024 12:43
Signed-off-by: Eric Pattison <eric.pattison@vivint.com>
Signed-off-by: Eric Pattison <eric.pattison@vivint.com>
Signed-off-by: Austin Drenski <austin@austindrenski.io>
Signed-off-by: Eric Pattison <eric.pattison@vivint.com>
Signed-off-by: Austin Drenski <austin@austindrenski.io>
Signed-off-by: Eric Pattison <eric.pattison@vivint.com>
fixing some whitespace issues

Signed-off-by: Eric Pattison <eric.pattison@vivint.com>
Signed-off-by: Eric Pattison <eric.pattison@vivint.com>
…re#128)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Eric Pattison <eric.pattison@vivint.com>
@ericpattison ericpattison force-pushed the feature/FeatureManagementProvider branch from ba4bb99 to 4921e15 Compare January 10, 2024 19:44
@beeme1mr
Copy link
Member

@toddbaert @bacherfl could you please review this tomorrow?

if (userId.IsString) targetingContext.UserId = userId.AsString;
}

if (evaluationContext.ContainsKey("Groups"))
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: I suggest to add a constant for UserId and Groups

[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task MissingFlagKey_ShouldReturnDefault(bool defaultValue)
Copy link
Contributor

Choose a reason for hiding this comment

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

for the sake of completeness, I suggest to also add test cases for the other data types (i.e. ResolveStringValue, etc.) to check if the default value is returned in case the flag is not found in the configuration

ericpattison and others added 3 commits January 11, 2024 08:42
…e.Contrib.Providers.FeatureManagement.csproj

Co-authored-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: ericpattison <epattison@bastiongames.com>
removing BOM that was added to csproj
replacing hardcoded strings with nameofs

Signed-off-by: Eric Pattison <eric.pattison@vivint.com>
…ttison/dotnet-sdk-contrib into feature/FeatureManagementProvider

Signed-off-by: Eric Pattison <eric.pattison@vivint.com>
@ericpattison
Copy link
Contributor Author

Updated to address @bacherfl's suggestions.

Copy link
Contributor

@bacherfl bacherfl left a comment

Choose a reason for hiding this comment

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

thanks for the additional tests! LGTM

@bacherfl
Copy link
Contributor

thanks for the additional tests! LGTM

Seems like i did not see the failing dotnet-format check - can you please address that one? Other than that the implementation looks good to me

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.

None yet

8 participants