microsoft / microsoft/FeatureManagement-Dotnet

Allow feature filters to contextually apply

Open
#127 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C#
Stars
1.2k
Forks
129
Avg merge
1d 1h
Merged PRs (30d)
5

Description

Hi I was in progress of switching over to this library from a proprietary solution when I noticed some functionality missing.

In our solution we allow (some) users to override the evaluation of a feature flag, e.g. for developers to test the feature out on production, by overriding the evaluation using a query string: ?myFeatureFlag=1 (also mentioned in #106). Although, I believe it would still be beneficial to apply a "global" set of filters, as explained in #89.

Unfortunately, I realized that there is one critical piece left: to be able for a filter to override another positive evaluation. I.e. if one filter evaluates to true - I also want the possibility to override that to force the evaluation to false: ?myFeatureFlag=0.

The current IFeatureFilter interface doesn't allow that granularity. In our proprietary solution we also add another dimension, whether or not the filter should be considered "active". In the example above the logic for whether or not the filter should be active is based off whether the feature name is present in the query string.

So the core logic is then changed from "if any feature filter evaluates to true, that feature will be considered enabled." to instead iterate over the filters and use the result of the first filter that is active, and use its result, disregarding the other filters.

I know that this feature request results in a big overhaul of the current architecture, but I just wanted to throw it out there and see if there are any workarounds for my case.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the IFeatureFilter interface and the feature-evaluation logic described in the issue. Determine how filters currently combine their results and how an active filter could override an earlier positive evaluation. Done means the architecture supports ordered active filters whose result, including false, controls the feature outcome.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.