Skip to content

Commit e31bf72

Browse files
committed
refactor!: Rename namespace from OpenFeature.SDK to OpenFeatureSDK
Discovered when implementing a provider I noticed due conflict with OpenFeature.SDK namespace and the singleton class being called OpenFeature. It requires the full namespace to use the OpenFeature singleton. Avoid this by making the root namepsace OpenFeatureSDK instead of OpenFeature.SDK Signed-off-by: Benjamin Evenson <[email protected]>
1 parent 0222116 commit e31bf72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+83
-83
lines changed
File renamed without changes.

OpenFeature.SDK.sln renamed to OpenFeatureSDK.sln

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

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFeature.SDK", "src\OpenFeature.SDK\OpenFeature.SDK.csproj", "{07A6E6BD-FB7E-4B3B-9CBE-65AE9D0EB223}"
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFeatureSDK", "src\OpenFeatureSDK\OpenFeatureSDK.csproj", "{07A6E6BD-FB7E-4B3B-9CBE-65AE9D0EB223}"
44
EndProject
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{72005F60-C2E8-40BF-AE95-893635134D7D}"
66
ProjectSection(SolutionItems) = preProject
@@ -29,7 +29,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{65FBA159-2
2929
test\Directory.Build.props = test\Directory.Build.props
3030
EndProjectSection
3131
EndProject
32-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFeature.SDK.Tests", "test\OpenFeature.SDK.Tests\OpenFeature.SDK.Tests.csproj", "{49BB42BA-10A6-4DA3-A7D5-38C968D57837}"
32+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFeatureSDK.Tests", "test\OpenFeatureSDK.Tests\OpenFeatureSDK.Tests.csproj", "{49BB42BA-10A6-4DA3-A7D5-38C968D57837}"
3333
EndProject
3434
Global
3535
GlobalSection(SolutionConfigurationPlatforms) = preSolution

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The packages will aim to support all current .NET versions. Refer to the current
2323
### Basic Usage
2424

2525
```csharp
26-
using OpenFeature.SDK;
26+
using OpenFeatureSDK;
2727

2828
// Sets the provider used by the client
2929
OpenFeature.Instance.SetProvider(new NoOpProvider());
@@ -40,8 +40,8 @@ To develop a provider, you need to create a new project and include the OpenFeat
4040
Example of implementing a feature flag provider
4141

4242
```csharp
43-
using OpenFeature.SDK;
44-
using OpenFeature.SDK.Model;
43+
using OpenFeatureSDK;
44+
using OpenFeatureSDK.Model;
4545

4646
public class MyFeatureProvider : FeatureProvider
4747
{

build/Common.tests.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">
13-
<Content Include="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeature.SDK.sln'))\build\xunit.runner.json">
13+
<Content Include="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeatureSDK.sln'))\build\xunit.runner.json">
1414
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1515
</Content>
1616
</ItemGroup>

src/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<Project>
2-
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeature.SDK.sln'))\build\Common.prod.props" />
2+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeatureSDK.sln'))\build\Common.prod.props" />
33
</Project>

src/OpenFeature.SDK/Constant/ErrorType.cs renamed to src/OpenFeatureSDK/Constant/ErrorType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.ComponentModel;
22

3-
namespace OpenFeature.SDK.Constant
3+
namespace OpenFeatureSDK.Constant
44
{
55
/// <summary>
66
/// These errors are used to indicate abnormal execution when evaluation a flag

src/OpenFeature.SDK/Constant/FlagValueType.cs renamed to src/OpenFeatureSDK/Constant/FlagValueType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace OpenFeature.SDK.Constant
1+
namespace OpenFeatureSDK.Constant
22
{
33
/// <summary>
44
/// Used to identity what object type of flag being evaluated

src/OpenFeature.SDK/Constant/NoOpProvider.cs renamed to src/OpenFeatureSDK/Constant/NoOpProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace OpenFeature.SDK.Constant
1+
namespace OpenFeatureSDK.Constant
22
{
33
internal static class NoOpProvider
44
{

src/OpenFeature.SDK/Constant/Reason.cs renamed to src/OpenFeatureSDK/Constant/Reason.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace OpenFeature.SDK.Constant
1+
namespace OpenFeatureSDK.Constant
22
{
33
/// <summary>
44
/// Common reasons used during flag resolution

src/OpenFeature.SDK/Error/FeatureProviderException.cs renamed to src/OpenFeatureSDK/Error/FeatureProviderException.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System;
2-
using OpenFeature.SDK.Constant;
3-
using OpenFeature.SDK.Extension;
2+
using OpenFeatureSDK.Constant;
3+
using OpenFeatureSDK.Extension;
44

5-
namespace OpenFeature.SDK.Error
5+
namespace OpenFeatureSDK.Error
66
{
77
/// <summary>
88
/// Used to represent an abnormal error when evaluating a flag. This exception should be thrown

src/OpenFeature.SDK/Extension/EnumExtensions.cs renamed to src/OpenFeatureSDK/Extension/EnumExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.ComponentModel;
33
using System.Linq;
44

5-
namespace OpenFeature.SDK.Extension
5+
namespace OpenFeatureSDK.Extension
66
{
77
internal static class EnumExtensions
88
{

src/OpenFeature.SDK/Extension/ResolutionDetailsExtensions.cs renamed to src/OpenFeatureSDK/Extension/ResolutionDetailsExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using OpenFeature.SDK.Model;
1+
using OpenFeatureSDK.Model;
22

3-
namespace OpenFeature.SDK.Extension
3+
namespace OpenFeatureSDK.Extension
44
{
55
internal static class ResolutionDetailsExtensions
66
{

src/OpenFeature.SDK/FeatureProvider.cs renamed to src/OpenFeatureSDK/FeatureProvider.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Threading.Tasks;
4-
using OpenFeature.SDK.Model;
4+
using OpenFeatureSDK.Model;
55

6-
namespace OpenFeature.SDK
6+
namespace OpenFeatureSDK
77
{
88
/// <summary>
99
/// The provider interface describes the abstraction layer for a feature flag provider.

src/OpenFeature.SDK/Hook.cs renamed to src/OpenFeatureSDK/Hook.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Threading.Tasks;
4-
using OpenFeature.SDK.Model;
4+
using OpenFeatureSDK.Model;
55

6-
namespace OpenFeature.SDK
6+
namespace OpenFeatureSDK
77
{
88
/// <summary>
99
/// The Hook abstract class describes the default implementation for a hook.

src/OpenFeature.SDK/IFeatureClient.cs renamed to src/OpenFeatureSDK/IFeatureClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Collections.Generic;
22
using System.Threading.Tasks;
3-
using OpenFeature.SDK.Model;
3+
using OpenFeatureSDK.Model;
44

5-
namespace OpenFeature.SDK
5+
namespace OpenFeatureSDK
66
{
77
internal interface IFeatureClient
88
{

src/OpenFeature.SDK/Model/ClientMetadata.cs renamed to src/OpenFeatureSDK/Model/ClientMetadata.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace OpenFeature.SDK.Model
1+
namespace OpenFeatureSDK.Model
22
{
33
/// <summary>
44
/// Represents the client metadata

src/OpenFeature.SDK/Model/EvaluationContext.cs renamed to src/OpenFeatureSDK/Model/EvaluationContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33

4-
namespace OpenFeature.SDK.Model
4+
namespace OpenFeatureSDK.Model
55
{
66
/// <summary>
77
/// A KeyValuePair with a string key and object value that is used to apply user defined properties

src/OpenFeature.SDK/Model/FlagEvaluationOptions.cs renamed to src/OpenFeatureSDK/Model/FlagEvaluationOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Collections.Generic;
22

3-
namespace OpenFeature.SDK.Model
3+
namespace OpenFeatureSDK.Model
44
{
55
/// <summary>
66
/// A structure containing the one or more hooks and hook hints

src/OpenFeature.SDK/Model/FlagEvalusationDetails.cs renamed to src/OpenFeatureSDK/Model/FlagEvalusationDetails.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using OpenFeature.SDK.Constant;
2-
using OpenFeature.SDK.Extension;
1+
using OpenFeatureSDK.Constant;
2+
using OpenFeatureSDK.Extension;
33

4-
namespace OpenFeature.SDK.Model
4+
namespace OpenFeatureSDK.Model
55
{
66
/// <summary>
77
/// The contract returned to the caller that describes the result of the flag evaluation process.

src/OpenFeature.SDK/Model/HookContext.cs renamed to src/OpenFeatureSDK/Model/HookContext.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
2-
using OpenFeature.SDK.Constant;
2+
using OpenFeatureSDK.Constant;
33

4-
namespace OpenFeature.SDK.Model
4+
namespace OpenFeatureSDK.Model
55
{
66
/// <summary>
77
/// Context provided to hook execution

src/OpenFeature.SDK/Model/Metadata.cs renamed to src/OpenFeatureSDK/Model/Metadata.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace OpenFeature.SDK.Model
1+
namespace OpenFeatureSDK.Model
22
{
33
/// <summary>
44
/// <see cref="OpenFeature"/> metadata

src/OpenFeature.SDK/Model/ResolutionDetails.cs renamed to src/OpenFeatureSDK/Model/ResolutionDetails.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using OpenFeature.SDK.Constant;
1+
using OpenFeatureSDK.Constant;
22

3-
namespace OpenFeature.SDK.Model
3+
namespace OpenFeatureSDK.Model
44
{
55
/// <summary>
66
/// Defines the contract that the <see cref="FeatureProvider"/> is required to return

src/OpenFeature.SDK/Model/Structure.cs renamed to src/OpenFeatureSDK/Model/Structure.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Collections.Generic;
44
using System.Diagnostics.CodeAnalysis;
55

6-
namespace OpenFeature.SDK.Model
6+
namespace OpenFeatureSDK.Model
77
{
88
/// <summary>
99
/// Structure represents a map of Values

src/OpenFeature.SDK/Model/Value.cs renamed to src/OpenFeatureSDK/Model/Value.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections;
33
using System.Collections.Generic;
44

5-
namespace OpenFeature.SDK.Model
5+
namespace OpenFeatureSDK.Model
66
{
77
/// <summary>
88
/// Values serve as a return type for provider objects. Providers may deal in JSON, protobuf, XML or some other data-interchange format.

src/OpenFeature.SDK/NoOpProvider.cs renamed to src/OpenFeatureSDK/NoOpProvider.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Threading.Tasks;
2-
using OpenFeature.SDK.Constant;
3-
using OpenFeature.SDK.Model;
2+
using OpenFeatureSDK.Constant;
3+
using OpenFeatureSDK.Model;
44

5-
namespace OpenFeature.SDK
5+
namespace OpenFeatureSDK
66
{
77
internal class NoOpFeatureProvider : FeatureProvider
88
{

src/OpenFeature.SDK/OpenFeature.cs renamed to src/OpenFeatureSDK/OpenFeature.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Collections.Generic;
22
using Microsoft.Extensions.Logging;
3-
using OpenFeature.SDK.Model;
3+
using OpenFeatureSDK.Model;
44

5-
namespace OpenFeature.SDK
5+
namespace OpenFeatureSDK
66
{
77
/// <summary>
88
/// The evaluation API allows for the evaluation of feature flag values, independent of any flag control plane or vendor.

src/OpenFeature.SDK/OpenFeatureClient.cs renamed to src/OpenFeatureSDK/OpenFeatureClient.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
using System.Threading.Tasks;
55
using Microsoft.Extensions.Logging;
66
using Microsoft.Extensions.Logging.Abstractions;
7-
using OpenFeature.SDK.Constant;
8-
using OpenFeature.SDK.Error;
9-
using OpenFeature.SDK.Extension;
10-
using OpenFeature.SDK.Model;
7+
using OpenFeatureSDK.Constant;
8+
using OpenFeatureSDK.Error;
9+
using OpenFeatureSDK.Extension;
10+
using OpenFeatureSDK.Model;
1111

12-
namespace OpenFeature.SDK
12+
namespace OpenFeatureSDK
1313
{
1414
/// <summary>
1515
///

src/OpenFeature.SDK/OpenFeature.SDK.csproj renamed to src/OpenFeatureSDK/OpenFeatureSDK.csproj

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

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
5-
<RootNamespace>OpenFeature.SDK</RootNamespace>
5+
<RootNamespace>OpenFeatureSDK</RootNamespace>
66
</PropertyGroup>
77

88
<ItemGroup>
@@ -11,7 +11,7 @@
1111

1212
<ItemGroup>
1313
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
14-
<_Parameter1>OpenFeature.SDK.Tests</_Parameter1>
14+
<_Parameter1>OpenFeatureSDK.Tests</_Parameter1>
1515
</AssemblyAttribute>
1616
</ItemGroup>
1717

test/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<Project>
2-
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeature.SDK.sln'))\build\Common.tests.props" />
2+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeatureSDK.sln'))\build\Common.tests.props" />
33
</Project>

test/OpenFeature.SDK.Tests/ClearOpenFeatureInstanceFixture.cs renamed to test/OpenFeatureSDK.Tests/ClearOpenFeatureInstanceFixture.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace OpenFeature.SDK.Tests
1+
namespace OpenFeatureSDK.Tests
22
{
33
public class ClearOpenFeatureInstanceFixture
44
{

test/OpenFeature.SDK.Tests/FeatureProviderExceptionTests.cs renamed to test/OpenFeatureSDK.Tests/FeatureProviderExceptionTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System;
22
using FluentAssertions;
3-
using OpenFeature.SDK.Constant;
4-
using OpenFeature.SDK.Error;
3+
using OpenFeatureSDK.Constant;
4+
using OpenFeatureSDK.Error;
55
using Xunit;
66

7-
namespace OpenFeature.SDK.Tests
7+
namespace OpenFeatureSDK.Tests
88
{
99
public class FeatureProviderExceptionTests
1010
{

test/OpenFeature.SDK.Tests/FeatureProviderTests.cs renamed to test/OpenFeatureSDK.Tests/FeatureProviderTests.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
using AutoFixture;
33
using FluentAssertions;
44
using Moq;
5-
using OpenFeature.SDK.Constant;
6-
using OpenFeature.SDK.Model;
7-
using OpenFeature.SDK.Tests.Internal;
5+
using OpenFeatureSDK.Constant;
6+
using OpenFeatureSDK.Model;
7+
using OpenFeatureSDK.Tests.Internal;
88
using Xunit;
99

10-
namespace OpenFeature.SDK.Tests
10+
namespace OpenFeatureSDK.Tests
1111
{
1212
public class FeatureProviderTests : ClearOpenFeatureInstanceFixture
1313
{

test/OpenFeature.SDK.Tests/Internal/SpecificationAttribute.cs renamed to test/OpenFeatureSDK.Tests/Internal/SpecificationAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace OpenFeature.SDK.Tests.Internal
3+
namespace OpenFeatureSDK.Tests.Internal
44
{
55
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
66
public class SpecificationAttribute : Attribute

test/OpenFeature.SDK.Tests/OpenFeatureClientTests.cs renamed to test/OpenFeatureSDK.Tests/OpenFeatureClientTests.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
using FluentAssertions;
66
using Microsoft.Extensions.Logging;
77
using Moq;
8-
using OpenFeature.SDK.Constant;
9-
using OpenFeature.SDK.Error;
10-
using OpenFeature.SDK.Extension;
11-
using OpenFeature.SDK.Model;
12-
using OpenFeature.SDK.Tests.Internal;
8+
using OpenFeatureSDK.Constant;
9+
using OpenFeatureSDK.Error;
10+
using OpenFeatureSDK.Extension;
11+
using OpenFeatureSDK.Model;
12+
using OpenFeatureSDK.Tests.Internal;
1313
using Xunit;
1414

15-
namespace OpenFeature.SDK.Tests
15+
namespace OpenFeatureSDK.Tests
1616
{
1717
public class OpenFeatureClientTests : ClearOpenFeatureInstanceFixture
1818
{

test/OpenFeature.SDK.Tests/OpenFeatureEvaluationContextTests.cs renamed to test/OpenFeatureSDK.Tests/OpenFeatureEvaluationContextTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
using System.Collections.Generic;
33
using AutoFixture;
44
using FluentAssertions;
5-
using OpenFeature.SDK.Model;
6-
using OpenFeature.SDK.Tests.Internal;
5+
using OpenFeatureSDK.Model;
6+
using OpenFeatureSDK.Tests.Internal;
77
using Xunit;
88

9-
namespace OpenFeature.SDK.Tests
9+
namespace OpenFeatureSDK.Tests
1010
{
1111
public class OpenFeatureEvaluationContextTests
1212
{

test/OpenFeature.SDK.Tests/OpenFeatureHookTests.cs renamed to test/OpenFeatureSDK.Tests/OpenFeatureHookTests.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
using AutoFixture;
55
using FluentAssertions;
66
using Moq;
7-
using OpenFeature.SDK.Constant;
8-
using OpenFeature.SDK.Model;
9-
using OpenFeature.SDK.Tests.Internal;
7+
using OpenFeatureSDK.Constant;
8+
using OpenFeatureSDK.Model;
9+
using OpenFeatureSDK.Tests.Internal;
1010
using Xunit;
1111

12-
namespace OpenFeature.SDK.Tests
12+
namespace OpenFeatureSDK.Tests
1313
{
1414
public class OpenFeatureHookTests : ClearOpenFeatureInstanceFixture
1515
{

test/OpenFeature.SDK.Tests/OpenFeature.SDK.Tests.csproj renamed to test/OpenFeatureSDK.Tests/OpenFeatureSDK.Tests.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>net6.0</TargetFrameworks>
55
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
6-
<RootNamespace>OpenFeature.SDK.Tests</RootNamespace>
6+
<RootNamespace>OpenFeatureSDK.Tests</RootNamespace>
77
</PropertyGroup>
88

99
<ItemGroup>
@@ -27,7 +27,7 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<ProjectReference Include="..\..\src\OpenFeature.SDK\OpenFeature.SDK.csproj" />
30+
<ProjectReference Include="..\..\src\OpenFeatureSDK\OpenFeatureSDK.csproj" />
3131
</ItemGroup>
3232

3333
</Project>

0 commit comments

Comments
 (0)