Skip to content

Update README file for variants #264

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

Merged
merged 15 commits into from
Oct 17, 2023
Merged

Conversation

amerjusupovic
Copy link
Contributor

No description provided.

@rossgrambo
Copy link
Contributor

Could you add the main new sections to the index?

README.md Outdated
@@ -86,7 +86,7 @@ The feature management library supports appsettings.json as a feature flag sourc
}
```

The `FeatureManagement` section of the json document is used by convention to load feature flag settings. In the section above, we see that we have provided three different features. Features define their feature filters using the `EnabledFor` property. In the feature filters for `FeatureT` we see `AlwaysOn`. This feature filter is built-in and if specified will always enable the feature. The `AlwaysOn` feature filter does not require any configuration so it only has the `Name` property. `FeatureU` has no filters in its `EnabledFor` property and thus will never be enabled. Any functionality that relies on this feature being enabled will not be accessible as long as the feature filters remain empty. However, as soon as a feature filter is added that enables the feature it can begin working. `FeatureV` specifies a feature filter named `TimeWindow`. This is an example of a configurable feature filter. We can see in the example that the filter has a `Parameters` property. This is used to configure the filter. In this case, the start and end times for the feature to be active are configured.
The `FeatureManagement` section of the json document is used by convention to load feature flag settings. In the section above, we see that we have provided three different features. Features define their feature filters using the `EnabledFor` property. In the feature filters for `FeatureT` we see `AlwaysOn`. This feature filter is built-in and if specified will always enable the feature. The `AlwaysOn` feature filter does not require any configuration so it only has the `Name` property. The alternative name for this filter is `On`. `FeatureU` has no filters in its `EnabledFor` property and thus will never be enabled. Any functionality that relies on this feature being enabled will not be accessible as long as the feature filters remain empty. However, as soon as a feature filter is added that enables the feature it can begin working. `FeatureV` specifies a feature filter named `TimeWindow`. This is an example of a configurable feature filter. We can see in the example that the filter has a `Parameters` property. This is used to configure the filter. In this case, the start and end times for the feature to be active are configured.
Copy link
Member

Choose a reason for hiding this comment

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

Is the On alias something new? What's the reason we want to advertise an alternative name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't part of the original planning, but it was part of the variants documentation doc that I referenced for my PR. I assumed it was because seeing a flag called AlwaysOn when you can actually override it to be off with a variant's StatusOverride property would be confusing.

Copy link
Member

@jimmyca15 jimmyca15 Sep 27, 2023

Choose a reason for hiding this comment

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

Given the presence of 'On' I would suggest we drop "AlwaysOn" from being mentioned here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm happy with On as well. But someone looking at a config for the first time should be able to determine what AlwaysOn means. Perhaps we can leave a note at the bottom of the readme that AlwaysOn was the previous name for On?

Copy link
Member

Choose a reason for hiding this comment

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

We will have to change the portal and CLI for file exporting to json and yaml. The file import then has to deal with both AlwaysOn and On. Is the renaming worth it?

The AlwaysOn is a half-internal workaround solution. I bet most AppConfig feature flag users never heard about it. I know its name is not ideal, but how bad it is, especially given the renaming cost?

Copy link
Member

Choose a reason for hiding this comment

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

Also wanted to mention why this came up. Previously, there never was a reason for a user to see or use "AlwaysOn". A simple "on" feature could be represented as a boolean literal like my previous comment.

This changes with variants. Now to write a flag with variants in appsettings.json, users have to specify a filter. The idea was to make the declaration shorter than "AlwaysOn" which was never really used anyhow.

Under the hood, "On" and "AlwaysOn" both work. The suggestion wasn't a rename, rather just to support "On" as well.

Copy link
Member

Choose a reason for hiding this comment

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

I understand the motivation and I understand the AlwaysOn naming is not ideal.

I guess the file import part must understand AlwaysOn (and On in the future if we add it). I didn't search the CLI code, but looks like our sync library has it.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, we do use it. I'm fine to avoid the change to introduce "On" then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, so should I not mention On in this file at all in that case?

Copy link
Member

Choose a reason for hiding this comment

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

Right, and removal of On in code.

"To": 10
}
],
"Seed": "13973240"
Copy link
Member

Choose a reason for hiding this comment

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

What happens if the Seed is not specified? Do we use a default value?

Copy link
Contributor Author

@amerjusupovic amerjusupovic Sep 27, 2023

Choose a reason for hiding this comment

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

Yea I should mention this, we create a new string using the feature name and use that instead of the Seed value. I guess that would be the default value.

Copy link
Contributor

Choose a reason for hiding this comment

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

featurename + "\nallocation"

Copy link
Member

Choose a reason for hiding this comment

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

I would consider it appropriate for us to mention that if seed is omitted, then a default seed based off the flag name is used. But I would say away from mentioning our exact implementation.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it will be great to clarify.

README.md Outdated
{
"Name": "Small",
"ConfigurationValue": {
"Size": 300
Copy link
Member

Choose a reason for hiding this comment

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

So this is required to be a JSON? Can I have more than one key value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I can explain that better, but it can be either a JSON or just a string after ConfigurationValue and it will return the configuration section starting with ConfigurationValue as the key. From there, you can index it like a normal configuration section. You can add any number of values or any structure of nested JSONs if you want.

Copy link
Member

Choose a reason for hiding this comment

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

Can it be a number or a boolean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, anything that could normally be in a configuration file like this, should I mention each of those?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think so. As an example, I think we should show a primitive value rather than a more complex JSON.

README.md Outdated
]
```

In the above example, the feature is enabled by the `On` filter and assigns the variant set for `DefaultWhenEnabled`, which is the `OffVariant` variant. The `OffVariant` variant has the `StatusOverride` property set to `Disabled`, so calling `IsEnabledAsync` for this feature will return disabled, even though the feature would otherwise be enabled by its filters.
Copy link
Member

Choose a reason for hiding this comment

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

While nothing is wrong in this example, it's unclear what the StatusOverride is for. Can we have a more real-world example?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do add an example for StatusOverride, we should make it very clear that it's a bandaid for a specific situation.

That situation is if you want to use allocation to control true and false without making code changes.

If you're writing a new app or adding new features, use variants with allocation. If you want simple true and false, you can achieve it with a targeting filter. If you want "variants" for your existing true and false, use the defaults.

Honestly, I prefer not having an example for StatusOverride as I don't want new customers grabbing the snippet.

Copy link
Member

@zhenlan zhenlan Sep 30, 2023

Choose a reason for hiding this comment

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

There must be some misunderstanding. I can agree the StatusOverride is a bandaid fix (in terms of design) but it is NOT just for existing users who don't want to make code changes.

The allocation is more powerful than the targeting filter (see an example later). We will want our customers (existing or new) to adopt the allocation with variants. However, without StatusOverride, they will have to write everything like

if (await fm.GetVariantAsync("foo").Configuration["ConfigurationValue"] == "true") ... 
// or
if (await fm.GetVariantAsync("foo").Name == "On") ... 

instead of simply

if (await fm.IsEnabledAsync("foo"))...

Our whole MS.FM.AspNetCore package is essentially built on top of the IsEnabledAsync API. Without StatusOverride, that package can be thrown out of the window. We all know On/Off accounts for the majority of the real-world usage. This is why StatusOverride is important for both existing and new customers.

We should explain what the StatusOverride is for and why it's useful. Here is an example that you can't achieve with targeting, and is meaningful in the real world.

"Allocation": {
    "Percentile": [{
        "Variant": "On",
        "From": 10,
        "To": 20
    }],
    "DefaultWhenEnabled":  "Off",
    "Seed": "Black-Friday-Feature-Group"
},
"Variants": [
    { 
        "Name": "On", 
        "ConfigurationValue": true
    },
    { 
        "Name": "Off", 
        "ConfigurationValue": false,
        "StatusOverride": "Disabled"
    }    
],
"EnabledFor": [ 
    { 
        "Name": "AlwaysOn" 
    } 
] 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've pretty much added this example to the StatusOverride section now

]
```

In the above example, if the feature is not enabled, `GetVariantAsync` would return the variant allocated by `DefaultWhenDisabled`, which is `Small` in this case.
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be worth it to call out each property of Allocation individually and describe what it's for. E.g.

The Allocation setting of a feature flag has the following properties.

DefaultWhenDisabled: Specifies which variant should be used when a variant is requested while the flag is considered disabled.
DefaultWhenEnabled: ...
...Other properties...

And then go into the specific behavior of this example.

README.md Outdated

In the above example, if the feature is not enabled, `GetVariantAsync` would return the variant allocated by `DefaultWhenDisabled`, which is `Small` in this case.

If the feature is enabled, the feature manager will check the `User`, `Group`, and `Percentile` allocations in that order to see if they match the targeting context or calculated percentile for that context. If the user is named `Marsha`, in the group named `Ring1`, or the user happens to fall between the 0 and 10th percentile calculated with the given `Seed`, then the specified variant is returned for that allocation. In this case, all of these would return the `Big` variant. If none of these allocations match the targeting context, the `DefaultWhenEnabled` variant is returned.
Copy link
Member

Choose a reason for hiding this comment

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

if they match the targeting context or calculated percentile for that context

I would leave out reference to targeting context. Instead mention the intent, like if the user being evaluated is specified in the users section, or if the user is in a group specified in the groups section, or if the user fits into the specified percentage allocation.

A separate section can be used, if necessary, to describe how that user/group info is determined (targeting context)

README.md Outdated

### StatusOverride

The `StatusOverride` property, if set for the assigned variant, overrides a feature's state. By default, this property is equal to `None`, which does not affect the feature state. If `StatusOverride` is equal to `Enabled` for the assigned variant, then the feature is enabled. If `StatusOverride` is equal to `Disabled` for the assigned variant, then the feature is disabled.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The `StatusOverride` property, if set for the assigned variant, overrides a feature's state. By default, this property is equal to `None`, which does not affect the feature state. If `StatusOverride` is equal to `Enabled` for the assigned variant, then the feature is enabled. If `StatusOverride` is equal to `Disabled` for the assigned variant, then the feature is disabled.
`StatusOverride` is an optional property of a variant that allows it to override whether a flag should be considered enabled or disabled. This gives variants an opportunity to extend the evaluation of a feature flag. If a caller is checking whether a flag that has variants is enabled, then variant allocation will be performed to see if an allocated variant is set up to override the result. By default, this property is set to `None`, which means the variant doesn't affect whether the flag is considered enabled or disabled. Setting `StatusOverride` to `Enabled` allows the variant, when chosen, to override a flag to be enabled. Setting `StatusOverride` to `Disabled` provides the opposite functionality, therefore disabling the flag when the variant is chosen.

Copy link
Member

Choose a reason for hiding this comment

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

On second thought. I might suggest rearranging this to first introduce the concept of a variants overriding the enabled state of a flag. Then go into the property that is used to do it.

README.md Outdated

### Setting a Variant's Configuration

For each of the variants in the `Variants` property of a feature, there is a specified configuration. This can be set using either the `ConfigurationReference` or `ConfigurationValue` properties. `ConfigurationReference` is a string path that references a section of the current configuration that contains the feature flag declaration. `ConfigurationValue` is an inline configuration. If both are specified, `ConfigurationValue` is used.
Copy link
Member

Choose a reason for hiding this comment

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

Can I omit both ConfigurationReference and ConfigurationValue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the Variant.Configuration value will just be null

Copy link
Member

Choose a reason for hiding this comment

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

Great, we can make it clear in the description.

This enables customers to have very concise variants like the one below.

"Variants": [
    { 
        "Name": "On"
    },
    { 
        "Name": "Off", 
        "StatusOverride": "Disabled"
    }    
]

amerjusupovic and others added 2 commits October 12, 2023 15:08
@amerjusupovic amerjusupovic merged commit 3f14b63 into preview Oct 17, 2023
@amerjusupovic amerjusupovic deleted the ajusupovic/readme-variants branch October 17, 2023 17:40
]
```

In the above example, the feature is enabled by the `AlwaysOn` filter. If the current user is in the calculated percentile range of 10 to 20, then the `On` variant is returned. Otherwise, the `Off` variant is returned and because `StatusOverride` is equal to `Disabled`, the feature will now be considered disabled.
Copy link
Member

Choose a reason for hiding this comment

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

I hope we can explain a little more about the scenarios where this property can be useful. Can we add a sentence like below at the beginning of this paragraph?

If you are using a feature flag with binary variants, the StatusOverride property can be very helpful. It allows you to keep using APIs like IsEnabledAsync and FeatureGateAttribute in your application, all while benefiting from the new features that come with variants, such as percentile allocation and seed.

Copy link
Contributor Author

@amerjusupovic amerjusupovic Oct 18, 2023

Choose a reason for hiding this comment

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

I think the example should be immediately followed by its explanation, could we add something similar to this sentence just before the example maybe? In a separate paragraph from the introduction?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. That works.

"Variants": [
{
"Name": "On",
"ConfigurationValue": true
Copy link
Member

Choose a reason for hiding this comment

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

In this example, the ConfigurationValue doesn't matter much. Can we remove it for both variants?

@amerjusupovic amerjusupovic restored the ajusupovic/readme-variants branch October 18, 2023 18:01
rossgrambo added a commit that referenced this pull request Sep 12, 2024
* Add variants for feature flags (#250)

* in progress, add new classes for variants and define methods in featuremanager

* Revert "Revert "Add cancellation token parameter to async feature management interfaces. (#131)" (#139)"

This reverts commit e531863.

* Revert "Revert "Added default value for cancellation token in interfaces to keep existing usage possible. (#133)" (#138)"

This reverts commit 8f9a7e4.

* fix any conflicts left from adding cancellationToken back

* add in progress changes to allocation and featuredefinitionprovider

* add examples for testing

* fix adding new featuredefinition properties from featuremanagement definition

* progress adding getvariant logic classes

* continued

* remove repeated code in contextual targeting

* fix version of contextual filter

* more progress on getting the contextual allocator to work

* about to test getvariant

* add example to test

* add snapshot changes

* variant can be detected and retrieved from getvariantasync

* progress on allocation logic, add comments where consideration needed

* add use of optionsresolver for reference, todo work on isenabledasync between customer use and variant use

* All working except couple TODOs, need to add unit tests

* remove some comments, add null check where needed

* update todo comments

* fix line eols

* add unit test, in progress

* TODOs in progress, need to restructure featurevariantassigner design

* fix seed logic

* update comments, status logic

* remove unnecessary files for custom assigners, fix featuremanager methods and interfaces to match

* fix naming from allocator to assigner for classes and files

* cleanup extra methods, todo config section logic

* in progress adding configurationsection returned when using configurationvalue

* continuation of last commit

* working return for configvalue

* move logic to featuremanager for assigning

* remove unused assigner classes

* add new configurationsection to handle return for variant

* null error, in progress new configurationsection class

* fix old bug

* progress on unit tests

* more null check changes, test fixes

* reset examples changes

* Revert "Revert "Revert "Added default value for cancellation token in interfaces to keep existing usage possible. (#133)" (#138)""

This reverts commit d087e7b.

* Revert "Revert "Revert "Add cancellation token parameter to async feature management interfaces. (#131)" (#139)""

This reverts commit c1451d3.

* add comments for new classes

* fix comments for public classes again

* update comments, default values

* fix variantconfigurationsection, comments in definitionprovider

* fix using statements, null checks

* fix unit test failures with servicecollectionextensions

* add revisions: fix namepaces, add exceptions tests, combine percentage logic, fix comments, add cancellationtoken to new interface

* change context accessor logic

* fix comments for default variants

* PR revisions

* change class names, PR fixes

* fix edge case percentage targeting

* rename allocation classes, remove exceptions and add warning logs, prioritize inline value for variant config, more revisions

* refactor isenabled to remove boolean param

* change configurationvalue to IConfigurationSection instead of string

* fix enabledwithvariants logic

* PR revisions, fix logic in new methods from last commit

* set session managers last in flow

* make false explicit for status disabled or missing definition

* fix constructor default params, move session managers logic, pr revisions

* fix comment

* fix resolvedefaultvariant, isexternalinit error

* add back 3.1

* Apply suggestions from code review

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* isexternalinit comments, remove resolvedefault helper

* remove binding, fix featuredefinitionprovider issues

* change to Debug.Assert from Assert

* update method name

* remove parseenum, add ConfigurationFields class

* test failing, fixed PR revisions

* fix invalid scenarios test

* simplify context in test

* remove unused using

* remove unused param

* Clarify how From and To bounds work in PercentileAllocation

Co-authored-by: Ross Grambo <rossgrambo@microsoft.com>

* fix error messages

* add feature name as default seed with allocation prefix

* Update src/Microsoft.FeatureManagement/FeatureManager.cs

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

---------

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>
Co-authored-by: Ross Grambo <rossgrambo@microsoft.com>

* Adds GetFeatureNamesAsync to IVariantFeatureManager and uses the interface in FeatureManagerSnapshot (#270)

* Adds telemetry pipeline (#259)

* Adds telemetry pipeline. Adds evaluationevent, publisher interface, and a publisher instance for app insights.

* Use await insead of .result

* Reverting unused dependency removal

* Update src/Microsoft.FeatureManagement/FeatureDefinition.cs

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Update src/Microsoft.FeatureManagement/FeatureDefinition.cs

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Update src/Microsoft.FeatureManagement.AppInsightsTelemetryPublisher/TelemetryPublisherAppInsights.cs

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Removed factory pattern for publisher DI

* Update src/Microsoft.FeatureManagement/FeatureManager.cs

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Resolve misc. comments

* Adjusts descriptions for FeatureDefinition properties

* Rename AppInsights to ApplicationInsights

* Resolves project reference in sln

* Adjusts ServiceCollectionExtensions to use TryAddSingleton

* Removes langversion from .csproj

* Temp

* Adds explicit null checkts before publishing fields to app insights

* Addressing misc. comments

* Removing project reference for example project

* Syncing telemetry and variants

* Adds null check for feature definitions

* Adjusted TelemetryPublishers to no longer be inserted into DI

* Resolving comments

* Removing Application Insights project

* Converts some variables to inline

* Resolving misc. comments

* Moves AddTelemetryPublisher to be an extension method

* Removing IVariantFeatureManager GetFeatureNamesAsync definition, as it should it it's own PR

* Remove unused dependency

* Resolving comments

* Remove invisible character changes

* Remove Dependency Injection package

* Update src/Microsoft.FeatureManagement/FeatureManagerSnapshot.cs

* Update src/Microsoft.FeatureManagement/IVariantFeatureManager.cs

* Persists cancellation token to PublishEvent and adds null check for null publisher collection

* Adds TargetingContext to the EvaluationResult

* Resolving comments

* Removes TargetingContext from EvaluationEvent for now

* Moves tags, etag, and label under 'TelemetryMetadata'

* Adjusts telemetry metadata to already be a flattened dictionary

* Removes bind in favor of ToDictionary. Removes unused using

---------

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Application Insights Publisher (#281)

* Adds Application Insights publisher

* Change readonly to const

* Update src/Microsoft.FeatureManagement.Telemetry.ApplicationInsights/ApplicationInsightsTelemetryPublisher.cs

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Update src/Microsoft.FeatureManagement.Telemetry.ApplicationInsights/ApplicationInsightsTelemetryPublisher.cs

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

---------

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Adds example library for Application Insights

* Adds readme to example

* Updates readme and persists telemetry metadata by placing it in the correct field

* Update README file for variants (#264)

* update readme with variants, first draft

* small summary revisions

* fix wording of summary

* fix code description

* Apply suggestions from code review

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* revisions

* PR revisions, describe Allocation properties, fix descriptions and titles

* clarify configurationvalue possible values

* clarify seed description

* remove all mentions of On filter

* fix example for override, clarify allowing no configurationvalue or reference

* change statusoverride example

* Apply suggestions from code review

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* revisions to summaries, fix allocation table

---------

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Edits to README for variants  (#289)

* add edits for variants

* fix wording

* Simplified javascript and other slight modifications

* Adjusts IVarantManager to use ValueTask (#293)

* remove conflict mark

* add missing comment & [Fact] attribute

* Updates.

* Updates.

* Improvements.

* Add missing project in sln file.

* Fix various solution issues
* missing project inclusion in solution file
* Project declared nullable support but wasn't written with it in mind
* pack.ps1 script didn't reference newest project.

* Remove nullable usage. Other updates.

* remove & add empty line

* resolve conflicts

* Fix project added twice.

* use const string and feature flag referece

* Add Telemetry section

* Made section casing consistent.

* Add section for enabling telemetry on flags.

* Update TOC.

* Use relative links.

* should -> must

* Updates based on feedback. Reordered telemetry sections.

* Add note.

* Update README.md

* Update telemetry schema in feature flags.

* Merges variants and isenabled paths. Adds variant reason field. (#290)

* Adds Reason field and adjusts evaluation logic

* use enum AssignmentReason

* add more testcases & remove some interal methods

* fix typo

* update comments

* resolve comments

* update comment for DisabledDefault

* fix typo

* update

* update telemetry publisher

* add reason when no allocation section

* update

* remove nullable

* resolve comments

* update comments

---------

Co-authored-by: zhiyuanliang <zhiyuanliang@microsoft.com>

* Undo whitespace changes from  merge.

* Readme clarifications. Added argument exception if feature definition telemetry is null when passed into app insights telemetry publisher.

* Update property summary.

* Prepare packages for 4.0.0-preview release.

* Add preview label. Update telemetry package description.

* Bumps Application Insights version (#342)

* Updates example application insights version (#344)

* Mention TargetingContext and fix wording in Variants section of readme (#330)

* mention itargetingcontextaccessor for variant allocation

* update changes

* add reference to ITargetingContextAccessor to readme for allocation

* update with new discussed changes, rename sections and introduce context sooner

* fix wording of default

* fix wording to avoid implying variants are assigned per feature

* use the term assign when referring to variants returned for a user

* use assign term in more places

* small changes

* Update README.md

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* update section titles

* resolve comments

* fix typo

* update link to allocating variants section

---------

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Adds TargetingContext to EvaluationEvent & Emits TargetingId in the App Insights Publisher (#347)

* Adds TargetingId to EvaluationEvent

* Adjusts EvaluationEvent to use TargetingContext instead of ITargetingContext

* move public method to the front of private method (#349)

* Adds extension methods for TrackEvent and TrackMetric (#348)

* Adds extension methods for TrackEvent and TrackMetric

* Adds copyright, crefs, and uses []= instead of .Add for properties

* Update src/Microsoft.FeatureManagement.Telemetry.ApplicationInsights/ApplicationInsightsTelemetryExtensions.cs

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Added null check, moved shared logic to helper functions

* Removed TrackMetric extension for now

---------

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Adds missing cref (#352)

* Adjusts private methods from Task to ValueTask (#353)

* Adds targeting middleware and targeting initializer (#350)

* Adds targeting middleware and targeting initializer

* Added logger and added prefix to targetingId

* Apply suggestions from code review

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* Adjustments from comments

---------

Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>

* unify the parse methods

* update

* Adjusts example to use middleware and initializer for targeting id (#357)

* Adjusts example to use middleware and initializer for targeting id

* Update examples/EvaluationDataToApplicationInsights/README.md

* remove unused package

* Feature-based Injection (#335)

* init

* draft

* use ValueTask

* support factory method

* add example

* update

* Update

* Update

* update example

* match variant name or configuration value

* update to the latest design

* merge with preview branch

* resolve comments

* rename to VariantService

* update & add comments

* remove POC example

* add testcases & use method name GetServiceAsync

* update comments

* add variant service cache

* resolve comments

* throw exception for duplicated registration

* add testcase

* remove unused package

* update comment

* set feature name in constructor

* adjust-tab-size (#366)

* Merge main to preview (#373)

* Add a constructor without FeatureManagementOption parameter for FeatureManager (#363)

* add new constructor

* update

* Target on .NET 8.0 (#365)

* target on .NET 8.0

* remove file

* add net8.0 for Microsoft.FeatureManagement.AspNetCore

* update package version

* update

* Add feature management schema for main branch (#362)

* schema file added

* README update

* update

* update

* update README & remove the Microsoft schema file

* update readme

* update

* Updates test schema and adjusts title (#372)

* Support Microsoft Feature Management schema for main branch (#370)

* use snake case

* do not support root fall back for MS schema & remove EnsureInit

* update

* rename variable

* update .NET FM schema

* re-add schema link

* add whitespace (#374)

* update

---------

Co-authored-by: Ross Grambo <rossgrambo@microsoft.com>

* add missing param comment (#380)

* Version bump

* Adds .Telemetry.ApplicationInsights.AspNetCore to build packages

* Support Microsoft Feature Management schema for preview branch (#375)

* support microsoft feature flag schema v2

* add more testcases

* add empty lines

* add schema & update README

* update schema

* update (#398)

* Optional Cancellation Token (#395)

* make cancelltation optional for feature manager & add cancellation token for session manager

* revert breaking change in ISessionManager

* remove unused package

* Update README to mention the usage of feature-based injection (variant service) (#388)

* update README

* update

* update

* update

* update

* fix typo

* update

* update

* Avoid redundant validation for cached TargetingFilterSettings (#387)

* do validation during binding parameters

* adjust method order

* Update target framework for telemetry packages (#413)

* update target framework

* update language version

* Adjusts namespace to simply ~.Telemetry

* Adjusts ApplicationInsights extension methods namespace

* Adjusts class name of TelemetryClientExceptions

* Removed changes to FM.Telemetry.ApplicationInsights.AspNetCore namespace

* Ensure the consistency of targeting evaluation across CPU architectures. (#405)

* check system endianness

* remove period

* update reverse method

* update comment

* adjust comment

* version bump (#420)

* Move warning deeper into variant code

* Adjusted warning message

* Boolean zen

* Updating from comments

* Adjusted wording

* Formatting update

* Promote Microsoft FM schema in README (#414)

* replace examples using Microsoft schema

* update

* correct section name

* update

* update schema reference link

* Remove variant & telemetry support for .NET Feature Management schema (#421)

* reorg test suite

* remove variant and telemetry & reorg test suite

* update

* update constructor

* update appsettings.json of EvaluationDataToApplicationInsights example project

* update appsetting.json for all examples

* add dependency for telemetry aspnetcore package (#439)

* Support variant for FeatureTagHelper (#407)

* add variant for feature tag helper

* update

* Negate also applies for variant

* correct comment

* update comment

* update README

* update README

* throw exception for Requirement All

* update readme

* update

* Moves telemetry publishing to Activity

* Update src/Microsoft.FeatureManagement/FeatureManager.cs

Co-authored-by: Juliano Leal Goncalves <julealgon@gmail.com>

* Update src/Microsoft.FeatureManagement/FeatureManager.cs

Co-authored-by: Juliano Leal Goncalves <julealgon@gmail.com>

* Resolving comments

* avoid null reference (#457)

* Some formatting updates

* Adjusted exception & exception message

* Update src/Microsoft.FeatureManagement/FeatureManager.cs

Co-authored-by: Juliano Leal Goncalves <julealgon@gmail.com>

* Adjusts hosted service to use the ServiceProvider instead of manually creating the publisher

* Update src/Microsoft.FeatureManagement/FeatureManager.cs

Co-authored-by: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com>

* Resolving comments

* Moved conditional checks

* Switched to standard null checks

* Adjusted to use activity parent instead of thread check and adjusted null or empty event field check

* Updated string null check

* Updates activity event to be PascalCase

* update example name

* Update Variant Example Application (#437)

* add example for variant based injection

* readme added

* not use third-party api

* update

* update README

* fix typo

* use latest api

* Switches to Activity for storing TargetingId and removes Microsoft.FeatureManagement.Telemetry.AspNetCore project

* Removes Microsoft.FeatureManagement.Telemetry.ApplicationInsights.AspNetCore

* Adds null check in middleware

* Added debug logs for unexpected nulls

* Respect .NET and Microsoft feature management schemas in configuration (#470)

* respect all feature management schemas

* add testcase

* add testcase

* correct test case

* simplify methods

* remove unused package

* unify newline usage

* remove useless code & rename variables

* reuse ParseEnum

* rename variable

* Switching log from debug to warning (#471)

* Switching log from debug to warning

* Adjusted warning logs

* adjust spacing

* version bump 4.0.0-preview4 (#476)

* fix typo in comment (#480)

* Adjusts builder extension methods to be friendlier (#487)

* Adds and adjusts builder extension methods

* Removed UseFeatureManagement and adjusted name of AddAppInsightsTelemetryPublisher

* Adjusts examples

* Use ITargetingContext when calling GetVariantAsync (#484)

* add variant feature manager extensions

* use TContext to avoid future breaking change

* TargetingContext in EvaluationEvent

* update comments & not use ambient context in contextual case

* update comment

* use ITargetingContext & check runtime context type

* use TargetingCotnext for private method

* use var instead of type

* revert change on ContextualTestFilter

* update comment

* update comment

* remove configuration reference from variant feature flag (#488)

* Renames and updates EvaluationDataToAppInsights example (#490)

* Renames project and cleans up startup code + auth

* Update examples/VariantAndTelemetryDemo/Program.cs

Co-authored-by: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com>

---------

Co-authored-by: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com>

* For examples and tests- fixes warnings, updates packages, and updates… (#491)

* Renames project and cleans up startup code + auth

* For examples and tests- fixes warnings, updates packages, and updates .net versions

* Switched to var

* Reverted construtor away from primary constructor style

* Missing semicolon

* use TimeProvider (#452) (#492)

Co-authored-by: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com>

* Removes preview (#493)

* Removes unused using statements and cleans up spacing. (#496)

---------

Co-authored-by: Amer Jusupovic <32405726+amerjusupovic@users.noreply.github.com>
Co-authored-by: Jimmy Campbell <jimmyca@microsoft.com>
Co-authored-by: zhiyuanliang <zhiyuanliang@microsoft.com>
Co-authored-by: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com>
Co-authored-by: Juliano Leal Goncalves <julealgon@gmail.com>
Co-authored-by: AMER JUSUPOVIC <ajusupovic@microsoft.com>
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