Skip to content

Commit 73a9138

Browse files
Merge pull request #468 from microsoft/main
Merge main into release v3
2 parents a2038c5 + 319fc2b commit 73a9138

File tree

13 files changed

+37
-925
lines changed

13 files changed

+37
-925
lines changed

README.md

+12-873
Large diffs are not rendered by default.

examples/ConsoleApp/ConsoleApp.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net6.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
87
</PropertyGroup>
98

109
<ItemGroup>

examples/FeatureFlagDemo/FeatureFlagDemo.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
5-
<Nullable>enable</Nullable>
65
<ImplicitUsings>enable</ImplicitUsings>
76
</PropertyGroup>
87

examples/FeatureFlagDemo/Views/Shared/Error.cshtml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace FeatureFlagDemo.Pages.Shared
88
[IgnoreAntiforgeryToken]
99
public class ErrorModel : PageModel
1010
{
11-
public string? RequestId { get; set; }
11+
public string RequestId { get; set; }
1212

1313
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
1414

examples/TargetingConsoleApp/TargetingConsoleApp.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net6.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
87
</PropertyGroup>
98

109
<ItemGroup>

src/Microsoft.FeatureManagement.AspNetCore/Microsoft.FeatureManagement.AspNetCore.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<!-- Official Version -->
55
<PropertyGroup>
66
<MajorVersion>3</MajorVersion>
7-
<MinorVersion>3</MinorVersion>
8-
<PatchVersion>1</PatchVersion>
7+
<MinorVersion>4</MinorVersion>
8+
<PatchVersion>0</PatchVersion>
99
</PropertyGroup>
1010

1111
<Import Project="..\..\build\Versioning.props" />

src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ public ConfigurationFeatureDefinitionProvider(IConfiguration configuration)
5858
/// <summary>
5959
/// The option that controls the behavior when "FeatureManagement" section in the configuration is missing.
6060
/// </summary>
61-
public bool RootConfigurationFallbackEnabled { get; init; }
61+
public bool RootConfigurationFallbackEnabled { get; set; }
6262

6363
/// <summary>
6464
/// The logger for the configuration feature definition provider.
6565
/// </summary>
66-
public ILogger Logger { get; init; }
66+
public ILogger Logger { get; set; }
6767

6868
/// <summary>
6969
/// Disposes the change subscription of the configuration.

src/Microsoft.FeatureManagement/FeatureFilters/Recurrence/RecurrenceValidator.cs

+5-10
Original file line numberDiff line numberDiff line change
@@ -358,25 +358,20 @@ private static bool IsDurationCompliantWithDaysOfWeek(TimeSpan duration, int int
358358

359359
foreach (DayOfWeek dayOfWeek in sortedDaysOfWeek)
360360
{
361-
if (prev == DateTime.MinValue)
362-
{
363-
prev = firstDayOfThisWeek.AddDays(
364-
CalculateWeeklyDayOffset(dayOfWeek, firstDayOfWeek));
365-
}
366-
else
367-
{
368-
DateTime date = firstDayOfThisWeek.AddDays(
361+
DateTime date = firstDayOfThisWeek.AddDays(
369362
CalculateWeeklyDayOffset(dayOfWeek, firstDayOfWeek));
370363

364+
if (prev != DateTime.MinValue)
365+
{
371366
TimeSpan gap = date - prev;
372367

373368
if (gap < minGap)
374369
{
375370
minGap = gap;
376371
}
377-
378-
prev = date;
379372
}
373+
374+
prev = date;
380375
}
381376

382377
//

src/Microsoft.FeatureManagement/FeatureFilters/TimeWindowFilter.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public TimeWindowFilter(ILoggerFactory loggerFactory = null)
3434
/// <summary>
3535
/// The application memory cache to store the start time of the closest active time window. By caching this time, the time window can minimize redundant computations when evaluating recurrence.
3636
/// </summary>
37-
public IMemoryCache Cache { get; init; }
37+
public IMemoryCache Cache { get; set; }
3838

3939
/// <summary>
4040
/// This property allows the time window filter in our test suite to use simulated time.
4141
/// </summary>
42-
internal ISystemClock SystemClock { get; init; }
42+
internal ISystemClock SystemClock { get; set; }
4343

4444
/// <summary>
4545
/// Binds configuration representing filter parameters to <see cref="TimeWindowFilterSettings"/>.

src/Microsoft.FeatureManagement/FeatureManager.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public sealed class FeatureManager : IFeatureManager
2121
private readonly TimeSpan ParametersCacheAbsoluteExpirationRelativeToNow = TimeSpan.FromDays(1);
2222

2323
private readonly IFeatureDefinitionProvider _featureDefinitionProvider;
24-
private readonly IEnumerable<IFeatureFilterMetadata> _featureFilters;
25-
private readonly IEnumerable<ISessionManager> _sessionManagers;
2624
private readonly ConcurrentDictionary<string, IFeatureFilterMetadata> _filterMetadataCache;
2725
private readonly ConcurrentDictionary<string, ContextualFeatureFilterEvaluator> _contextualFeatureFilterCache;
2826
private readonly FeatureManagementOptions _options;
27+
private IEnumerable<IFeatureFilterMetadata> _featureFilters;
28+
private IEnumerable<ISessionManager> _sessionManagers;
2929

3030
private class ConfigurationCacheItem
3131
{
@@ -60,7 +60,7 @@ public IEnumerable<IFeatureFilterMetadata> FeatureFilters
6060
{
6161
get => _featureFilters;
6262

63-
init
63+
set
6464
{
6565
_featureFilters = value ?? throw new ArgumentNullException(nameof(value));
6666
}
@@ -74,7 +74,7 @@ public IEnumerable<ISessionManager> SessionManagers
7474
{
7575
get => _sessionManagers;
7676

77-
init
77+
set
7878
{
7979
_sessionManagers = value ?? throw new ArgumentNullException(nameof(value));
8080
}
@@ -83,12 +83,12 @@ public IEnumerable<ISessionManager> SessionManagers
8383
/// <summary>
8484
/// The application memory cache to store feature filter settings.
8585
/// </summary>
86-
public IMemoryCache Cache { get; init; }
86+
public IMemoryCache Cache { get; set; }
8787

8888
/// <summary>
8989
/// The logger for the feature manager.
9090
/// </summary>
91-
public ILogger Logger { get; init; }
91+
public ILogger Logger { get; set; }
9292

9393
/// <summary>
9494
/// Checks whether a given feature is enabled.

src/Microsoft.FeatureManagement/IsExternalInit.cs

-21
This file was deleted.

src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<!-- Official Version -->
55
<PropertyGroup>
66
<MajorVersion>3</MajorVersion>
7-
<MinorVersion>3</MinorVersion>
8-
<PatchVersion>1</PatchVersion>
7+
<MinorVersion>4</MinorVersion>
8+
<PatchVersion>0</PatchVersion>
99
</PropertyGroup>
1010

1111
<Import Project="..\..\build\Versioning.props" />
@@ -15,7 +15,9 @@
1515
<SignAssembly>true</SignAssembly>
1616
<DelaySign>false</DelaySign>
1717
<AssemblyOriginatorKeyFile>..\..\build\Microsoft.FeatureManagement.snk</AssemblyOriginatorKeyFile>
18-
<LangVersion>9.0</LangVersion>
18+
<!-- Microsoft.FeatureManagement uses the feature of async streams which is not supported in versions of C# earlier than 8.0.
19+
The library targets on netstandard 2.0. To ensure compatibility, the minimum language version requirement should be maintained. -->
20+
<LangVersion>8.0</LangVersion>
1921
</PropertyGroup>
2022

2123
<PropertyGroup>

tests/Tests.FeatureManagement/FeatureManagement.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -752,11 +752,11 @@ public async Task ThreadsafeSnapshot()
752752

753753
await Task.WhenAll(tasks);
754754

755-
bool result = tasks.First().Result;
755+
bool result = await tasks.First();
756756

757757
foreach (Task<bool> t in tasks)
758758
{
759-
Assert.Equal(result, t.Result);
759+
Assert.Equal(result, await t);
760760
}
761761
}
762762

0 commit comments

Comments
 (0)