Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
99a3bde
Add support for feature variants.
jimmyca15 Jul 27, 2021
57b06b3
Renaming and assorted fixes.
jimmyca15 Aug 30, 2021
b8d1353
Remove unnecessary field.
jimmyca15 Aug 30, 2021
6ea29fd
* Added additional argument validation.
jimmyca15 Sep 17, 2021
2f52403
Since filter aliases are case insensitive, update filter cache to ref…
jimmyca15 Sep 17, 2021
356077d
* Fixed issue with filter + assigner suffix references.
jimmyca15 Oct 20, 2021
5ed4021
Share suffix matching logic. Corrected variable name.
jimmyca15 Nov 2, 2021
0044eeb
Removed unnecessary helper methods.
jimmyca15 Nov 3, 2021
d064c97
Clarify filter selection logic in feature evaluation and add checks f…
jimmyca15 Nov 11, 2021
10cd771
Updated argument validation messages.
jimmyca15 Nov 12, 2021
45a6525
Merge pull request #132 from jimmyca15/user/jimmyca/fVariants
jimmyca15 Nov 17, 2021
fd51d97
Update to dynamic features. (#157)
jimmyca15 Jan 10, 2022
28982a1
Added dynamic feature documentation. (#159)
jimmyca15 Jan 20, 2022
44a782d
Updated missed "feature name" occurrences.
jimmyca15 Feb 8, 2022
44be34e
Merge branch 'feature/v3' into user/jimmyca/merge/feature/v3
jimmyca15 Feb 8, 2022
75e32bd
Merge pull request #163 from jimmyca15/user/jimmyca/merge/feature/v3
jimmyca15 Mar 1, 2022
43ed8c1
feature definition -> feature flag
jimmyca15 Mar 1, 2022
1979195
Merge branch 'feature/v3' into user/jimmyca/naming
jimmyca15 Mar 1, 2022
c816292
Merge pull request #162 from jimmyca15/user/jimmyca/naming
jimmyca15 Mar 1, 2022
6976c3c
SuggestedReadmeChanges
mrm9084 Apr 22, 2022
e47503d
Updated comments from readme
mrm9084 Apr 28, 2022
d98f319
Merge pull request #173 from mrm9084/SuggestedReadmeChanges
mrm9084 May 10, 2022
686f204
Fixed targeting assignment precedence.
jimmyca15 May 18, 2022
67b59b3
Merge branch 'feature/v3' into user/jimmyca/targetingPrecedence
jimmyca15 May 18, 2022
d4cc815
Remove unused variable. Update method signature. Added missing declar…
jimmyca15 May 24, 2022
8b2722f
Merge pull request #179 from jimmyca15/user/jimmyca/targetingPrecedence
jimmyca15 May 25, 2022
8185bad
Add null/empty check for feature evaluation.
jimmyca15 May 25, 2022
7f84b25
Added .NET 6 as a target framework and removed .NET 5
jimmyca15 May 25, 2022
2fcb0b1
Update Azure App Configuration provider reference in example project …
jimmyca15 May 25, 2022
d1dc303
Merge pull request #181 from jimmyca15/user/jimmyca/nullCheck
jimmyca15 May 25, 2022
1e02a81
Merge pull request #183 from jimmyca15/user/jimmyca/configurationProv…
jimmyca15 May 25, 2022
ef80b53
Merge pull request #182 from jimmyca15/user/jimmyca/targetFramework
jimmyca15 May 25, 2022
bb26a3a
Merge branch 'main' into user/jimmyca/merge/feature/v3
jimmyca15 Jun 4, 2022
d06f7e7
Build with .NET 6 (#186)
jimmyca15 Jun 7, 2022
1f69bf9
Add link to v2 readme. (#184)
jimmyca15 Jun 8, 2022
b05ae89
Merge pull request #189 from jimmyca15/user/jimmyca/merge/feature/v3
jimmyca15 Jun 8, 2022
f0f8ca2
Throw exception if feature management schemas are mixed to avoid unin…
jimmyca15 Jun 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .pipelines/pipeline.user.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ environment:

restore:
commands:
- !!defaultcommand
name: 'Install .NET'
command: 'build/CallPowerShell.cmd'
arguments: 'build/install-dotnet.ps1 -RestoreOnly'
- !!defaultcommand
name: 'Restore'
command: 'build.cmd'
arguments: '-RestoreOnly'
command: 'build/CallPowerShell.cmd'
arguments: 'build.ps1 -RestoreOnly'

build:
commands:
- !!buildcommand
name: 'Dotnet Build'
command: 'build.cmd'
command: 'build/CallPowerShell.cmd'
arguments: 'build.ps1'
logs:
- from: 'buildlogs'
to: 'Build Logs'
Expand All @@ -32,7 +37,8 @@ package:
commands:
- !!buildcommand
name: 'Dotnet Pack'
command: 'pack.cmd'
command: 'build/CallPowerShell.cmd'
arguments: 'pack.ps1'
logs:
- from: 'buildlogs'
to: 'Build Logs'
Expand All @@ -48,7 +54,8 @@ test:
commands:
- !!testcommand
name: 'Dotnet Test'
command: 'test.cmd'
command: 'build/CallPowerShell.cmd'
arguments: 'test.ps1'
fail_on_stderr: false
testresults:
- title: 'Unit Tests'
Expand Down
7 changes: 7 additions & 0 deletions Microsoft.FeatureManagement.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp", "examples\Cons
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TargetingConsoleApp", "examples\TargetingConsoleApp\TargetingConsoleApp.csproj", "{6558C21E-CF20-4278-AA08-EB9D1DF29D66}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomAssignmentConsoleApp", "examples\CustomAssignmentConsoleApp\CustomAssignmentConsoleApp.csproj", "{06C10E31-4C33-4567-85DB-00056A2BB511}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorPages", "examples\RazorPages\RazorPages.csproj", "{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2}"
EndProject
Global
Expand Down Expand Up @@ -51,6 +53,10 @@ Global
{6558C21E-CF20-4278-AA08-EB9D1DF29D66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6558C21E-CF20-4278-AA08-EB9D1DF29D66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6558C21E-CF20-4278-AA08-EB9D1DF29D66}.Release|Any CPU.Build.0 = Release|Any CPU
{06C10E31-4C33-4567-85DB-00056A2BB511}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06C10E31-4C33-4567-85DB-00056A2BB511}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06C10E31-4C33-4567-85DB-00056A2BB511}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06C10E31-4C33-4567-85DB-00056A2BB511}.Release|Any CPU.Build.0 = Release|Any CPU
{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -64,6 +70,7 @@ Global
{FDBB27BA-C5BA-48A7-BA9B-63159943EA9F} = {8ED6FFEE-4037-49A2-9709-BC519C104A90}
{E50FB931-7A42-440E-AC47-B8DFE5E15394} = {FB5C34DF-695C-4DF9-8AED-B3EA2516EA72}
{6558C21E-CF20-4278-AA08-EB9D1DF29D66} = {FB5C34DF-695C-4DF9-8AED-B3EA2516EA72}
{06C10E31-4C33-4567-85DB-00056A2BB511} = {FB5C34DF-695C-4DF9-8AED-B3EA2516EA72}
{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2} = {FB5C34DF-695C-4DF9-8AED-B3EA2516EA72}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
482 changes: 373 additions & 109 deletions README.md

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions build.cmd

This file was deleted.

6 changes: 4 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ if ((Test-Path -Path $LogDirectory) -ne $true) {
New-Item -ItemType Directory -Path $LogDirectory | Write-Verbose
}

$dotnet = & "$PSScriptRoot/build/resolve-dotnet.ps1"

if ($RestoreOnly)
{
# Restore
dotnet restore "$Solution"
& $dotnet restore "$Solution"
}
else
{
# Build
dotnet build -c $BuildConfig "$Solution" | Tee-Object -FilePath "$LogDirectory\build.log"
& $dotnet build -c $BuildConfig "$Solution" | Tee-Object -FilePath "$LogDirectory\build.log"
}

exit $LASTEXITCODE
1 change: 1 addition & 0 deletions build/CallPowerShell.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PowerShell %~dp0..\%*
23 changes: 0 additions & 23 deletions build/ChoosePowerShell.cmd

This file was deleted.

8 changes: 8 additions & 0 deletions build/install-dotnet.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Installs .NET Core 2.1 and .NET 6 for CI/CD environment
# see: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#examples

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;

&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Version 2.1.816

&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1')))
14 changes: 14 additions & 0 deletions build/resolve-dotnet.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Resolves dotnet execution path
# Locations considered include dotnet install script default location and somewhere on path
$CI_CD_INSTALL_PATH = "$env:LOCALAPPDATA\Microsoft\dotnet\dotnet.exe"

if (Test-Path $CI_CD_INSTALL_PATH)
{
$CI_CD_INSTALL_PATH

return
}

$dotnet = Get-Command dotnet.exe -ErrorAction Stop

$dotnet.Source
75 changes: 75 additions & 0 deletions docs/schemas/FeatureManagement.v1.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"$schema":"http://json-schema.org/draft-07/schema#",
"$id":"http://azconfig.io/schemas/FeatureManagement-DotNet/v1.0.0/FeatureManagement.json",
"title":"Decalaration of features in the Microsoft.FeatureManagement library.",
"definitions": {
"FeatureFlag": {
"type":"object",
"properties": {
"EnabledFor": {
"type":"array",
"items": {
"type":"object",
"required":[
"Name"
],
"properties": {
"Name": {
"type":"string"
},
"Parameters": {
"type":"object",
"patternProperties": {
"^.*$": {
"anyOf":[
{
"type":"string"
},
{
"type":"null"
},
{
"type":"object"
},
{
"type":"number"
},
{
"type":"array"
},
{
"type":"boolean"
}
]
}
},
"additionalProperties":false
}
}
}
}
}
}
},
"type":"object",
"required":[
],
"properties": {
"FeatureManagement": {
"type":"object",
"patternProperties": {
"^.*$": {
"anyOf":[
{
"$ref":"#/definitions/FeatureFlag"
},
{
"type":"boolean"
}
]
}
},
"additionalProperties":false
}
}
}
150 changes: 150 additions & 0 deletions docs/schemas/FeatureManagement.v2.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"$schema":"http://json-schema.org/draft-07/schema#",
"$id":"http://azconfig.io/schemas/FeatureManagement-DotNet/v2.0.0/FeatureManagement.json",
"title":"Decalaration of features in the Microsoft.FeatureManagement library.",
"definitions": {
"FeatureFlag": {
"type":"object",
"properties": {
"EnabledFor": {
"type":"array",
"items": {
"type":"object",
"required":[
"Name"
],
"properties": {
"Name": {
"type":"string"
},
"Parameters": {
"type":"object",
"patternProperties": {
"^.*$": {
"anyOf":[
{
"type":"string"
},
{
"type":"null"
},
{
"type":"object"
},
{
"type":"number"
},
{
"type":"array"
},
{
"type":"boolean"
}
]
}
},
"additionalProperties":false
}
}
}
}
}
},
"DynamicFeature": {
"type":"object",
"required": [
"Assigner",
"Variants"
],
"properties": {
"Assigner": {
"type":"string"
},
"Variants": {
"type":"array",
"items": {
"type":"object",
"required":[
"Name",
"ConfigurationReference"
],
"properties": {
"Default": {
"type":"boolean"
},
"Name": {
"type":"string"
},
"ConfigurationReference": {
"type":"string"
},
"AssignmentParameters": {
"type":"object",
"patternProperties": {
"^.*$": {
"anyOf":[
{
"type":"string"
},
{
"type":"null"
},
{
"type":"object"
},
{
"type":"number"
},
{
"type":"array"
},
{
"type":"boolean"
}
]
}
},
"additionalProperties":false
}
}
}
}
}
}
},
"type":"object",
"required":[
],
"properties": {
"FeatureManagement": {
"type":"object",
"properties": {
"FeatureFlags": {
"type":"object",
"patternProperties": {
"^.*$": {
"anyOf":[
{
"$ref":"#/definitions/FeatureFlag"
},
{
"type":"boolean"
}
]
}
},
"additionalProperties":false
},
"DynamicFeatures": {
"type":"object",
"patternProperties": {
"^.*$": {
"$ref":"#/definitions/DynamicFeature"
}
},
"additionalProperties":false
}
}
}
}
}
17 changes: 17 additions & 0 deletions docs/schemas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configuration Schemas

This folder contains the schemas for the configuration used by the Microsoft.FeatureManagement library.

# 1.0.0

The [1.0.0 schema](./FeatureManagement.v1.0.0.json) is supported by Microsoft.FeatureManagement version 1.x - 3.x.

* Allows feature flags to be defined.

# 2.0.0

The [2.0.0 schema](./FeatureManagement.v2.0.0.json) is supported by Microsoft.FeatureManagement version 3.x.

* Allows dynamic features to be defined.
* Uses a more explicit path to define feature flags.
* "FeatureManagement:FeatureFlags:{flagName}" instead of "FeatureManagement:{flagName}".
Loading