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

Merge preview into main #500

Merged
merged 171 commits into from
Sep 16, 2024
Merged

Merge preview into main #500

merged 171 commits into from
Sep 16, 2024

Conversation

rossgrambo
Copy link
Contributor

Redo of #494

Why this PR?

Preparing preview content for release by merging into main.

Visible Changes

  • Variants & IVariantFeatureManager
  • Telemetry
    • ActivitySource Microsoft.FeatureManagement & EvaluationEvent as ActivityEvent
    • TargetingHttpContextMiddleware & TargetingTelemetryInitializer
    • Application Insights Event Publisher
    • .AddApplicationInsights builder extension
  • VariantService
  • .WithTargeting adds HttpContextAccessor if it's not already added

amerjusupovic and others added 30 commits September 13, 2023 11:29
* 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 <[email protected]>

* 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 <[email protected]>

* fix error messages

* add feature name as default seed with allocation prefix

* Update src/Microsoft.FeatureManagement/FeatureManager.cs

Co-authored-by: Jimmy Campbell <[email protected]>

---------

Co-authored-by: Jimmy Campbell <[email protected]>
Co-authored-by: Ross Grambo <[email protected]>
* 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 <[email protected]>

* Update src/Microsoft.FeatureManagement/FeatureDefinition.cs

Co-authored-by: Jimmy Campbell <[email protected]>

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

Co-authored-by: Jimmy Campbell <[email protected]>

* Removed factory pattern for publisher DI

* Update src/Microsoft.FeatureManagement/FeatureManager.cs

Co-authored-by: Jimmy Campbell <[email protected]>

* 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 <[email protected]>
* Adds Application Insights publisher

* Change readonly to const

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

Co-authored-by: Jimmy Campbell <[email protected]>

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

Co-authored-by: Jimmy Campbell <[email protected]>

---------

Co-authored-by: Jimmy Campbell <[email protected]>
* 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 <[email protected]>

* 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 <[email protected]>

* revisions to summaries, fix allocation table

---------

Co-authored-by: Jimmy Campbell <[email protected]>
* add edits for variants

* fix wording
* 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.
…tryExample

Add example for telemetry publishing.
rossgrambo and others added 22 commits June 27, 2024 11:36
…etingid

Activity Based TargetingId Persistance
#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

* Adjusted warning logs
Merge GitHub workflow addition to preview
* Adds and adjusts builder extension methods

* Removed UseFeatureManagement and adjusted name of AddAppInsightsTelemetryPublisher

* Adjusts examples
* 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
* Renames project and cleans up startup code + auth

* Update examples/VariantAndTelemetryDemo/Program.cs

Co-authored-by: Zhiyuan Liang <[email protected]>

---------

Co-authored-by: Zhiyuan Liang <[email protected]>
#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
Co-authored-by: Zhiyuan Liang <[email protected]>
Merging in revert to unblock preview merge
* Adjusts to last one wins logic for flag provider

* Removed unused schema

* Reverted dotnet feature definition to continue to use FirstOrDefault
@rossgrambo rossgrambo merged commit 7050fa0 into main Sep 16, 2024
4 checks passed
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.

5 participants