Skip to content

Commit

Permalink
refactor!: Rename namespace from OpenFeature.SDK to OpenFeatureSDK
Browse files Browse the repository at this point in the history
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 <2031163+benjiro@users.noreply.github.com>
  • Loading branch information
benjiro committed Sep 22, 2022
1 parent a6e5ccb commit fac92ad
Show file tree
Hide file tree
Showing 42 changed files with 84 additions and 84 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions OpenFeature.SDK.sln → OpenFeatureSDK.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFeature.SDK", "src\OpenFeature.SDK\OpenFeature.SDK.csproj", "{07A6E6BD-FB7E-4B3B-9CBE-65AE9D0EB223}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFeatureSDK", "src\OpenFeatureSDK\OpenFeatureSDK.csproj", "{07A6E6BD-FB7E-4B3B-9CBE-65AE9D0EB223}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{72005F60-C2E8-40BF-AE95-893635134D7D}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -30,7 +30,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{65FBA159-2
test\Directory.Build.props = test\Directory.Build.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFeature.SDK.Tests", "test\OpenFeature.SDK.Tests\OpenFeature.SDK.Tests.csproj", "{49BB42BA-10A6-4DA3-A7D5-38C968D57837}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFeatureSDK.Tests", "test\OpenFeatureSDK.Tests\OpenFeatureSDK.Tests.csproj", "{49BB42BA-10A6-4DA3-A7D5-38C968D57837}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The packages will aim to support all current .NET versions. Refer to the current
### Basic Usage

```csharp
using OpenFeature.SDK;
using OpenFeatureSDK;

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

```csharp
using OpenFeature.SDK;
using OpenFeature.SDK.Model;
using OpenFeatureSDK;
using OpenFeatureSDK.Model;

public class MyFeatureProvider : FeatureProvider
{
Expand Down
2 changes: 1 addition & 1 deletion build/Common.tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">
<Content Include="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeature.SDK.sln'))\build\xunit.runner.json">
<Content Include="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeatureSDK.sln'))\build\xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion build/dotnet-releaser.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# configuration file for dotnet-releaser
[msbuild]
project = "../OpenFeature.SDK.sln"
project = "../OpenFeatureSDK.sln"
configuration = "Release"
[msbuild.properties]
Deterministic = true
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeature.SDK.sln'))\build\Common.prod.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeatureSDK.sln'))\build\Common.prod.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel;

namespace OpenFeature.SDK.Constant
namespace OpenFeatureSDK.Constant
{
/// <summary>
/// These errors are used to indicate abnormal execution when evaluation a flag
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.SDK.Constant
namespace OpenFeatureSDK.Constant
{
/// <summary>
/// Used to identity what object type of flag being evaluated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.SDK.Constant
namespace OpenFeatureSDK.Constant
{
internal static class NoOpProvider
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.SDK.Constant
namespace OpenFeatureSDK.Constant
{
/// <summary>
/// Common reasons used during flag resolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using OpenFeature.SDK.Constant;
using OpenFeature.SDK.Extension;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Extension;

namespace OpenFeature.SDK.Error
namespace OpenFeatureSDK.Error
{
/// <summary>
/// Used to represent an abnormal error when evaluating a flag. This exception should be thrown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.ComponentModel;
using System.Linq;

namespace OpenFeature.SDK.Extension
namespace OpenFeatureSDK.Extension
{
internal static class EnumExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OpenFeature.SDK.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature.SDK.Extension
namespace OpenFeatureSDK.Extension
{
internal static class ResolutionDetailsExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenFeature.SDK.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature.SDK
namespace OpenFeatureSDK
{
/// <summary>
/// The provider interface describes the abstraction layer for a feature flag provider.
Expand Down
4 changes: 2 additions & 2 deletions src/OpenFeature.SDK/Hook.cs → src/OpenFeatureSDK/Hook.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenFeature.SDK.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature.SDK
namespace OpenFeatureSDK
{
/// <summary>
/// The Hook abstract class describes the default implementation for a hook.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenFeature.SDK.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature.SDK
namespace OpenFeatureSDK
{
internal interface IFeatureClient
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.SDK.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// Represents the client metadata
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace OpenFeature.SDK.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// A KeyValuePair with a string key and object value that is used to apply user defined properties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace OpenFeature.SDK.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// A structure containing the one or more hooks and hook hints
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using OpenFeature.SDK.Constant;
using OpenFeature.SDK.Extension;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Extension;

namespace OpenFeature.SDK.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// The contract returned to the caller that describes the result of the flag evaluation process.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using OpenFeature.SDK.Constant;
using OpenFeatureSDK.Constant;

namespace OpenFeature.SDK.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// Context provided to hook execution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.SDK.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// <see cref="OpenFeature"/> metadata
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OpenFeature.SDK.Constant;
using OpenFeatureSDK.Constant;

namespace OpenFeature.SDK.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// Defines the contract that the <see cref="FeatureProvider"/> is required to return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace OpenFeature.SDK.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// Structure represents a map of Values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections;
using System.Collections.Generic;

namespace OpenFeature.SDK.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// Values serve as a return type for provider objects. Providers may deal in JSON, protobuf, XML or some other data-interchange format.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Threading.Tasks;
using OpenFeature.SDK.Constant;
using OpenFeature.SDK.Model;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Model;

namespace OpenFeature.SDK
namespace OpenFeatureSDK
{
internal class NoOpFeatureProvider : FeatureProvider
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using OpenFeature.SDK.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature.SDK
namespace OpenFeatureSDK
{
/// <summary>
/// The evaluation API allows for the evaluation of feature flag values, independent of any flag control plane or vendor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using OpenFeature.SDK.Constant;
using OpenFeature.SDK.Error;
using OpenFeature.SDK.Extension;
using OpenFeature.SDK.Model;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Error;
using OpenFeatureSDK.Extension;
using OpenFeatureSDK.Model;

namespace OpenFeature.SDK
namespace OpenFeatureSDK
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<RootNamespace>OpenFeature.SDK</RootNamespace>
<RootNamespace>OpenFeatureSDK</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,7 +11,7 @@

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>OpenFeature.SDK.Tests</_Parameter1>
<_Parameter1>OpenFeatureSDK.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeature.SDK.sln'))\build\Common.tests.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenFeatureSDK.sln'))\build\Common.tests.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.SDK.Tests
namespace OpenFeatureSDK.Tests
{
public class ClearOpenFeatureInstanceFixture
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using FluentAssertions;
using OpenFeature.SDK.Constant;
using OpenFeature.SDK.Error;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Error;
using Xunit;

namespace OpenFeature.SDK.Tests
namespace OpenFeatureSDK.Tests
{
public class FeatureProviderExceptionTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using AutoFixture;
using FluentAssertions;
using Moq;
using OpenFeature.SDK.Constant;
using OpenFeature.SDK.Model;
using OpenFeature.SDK.Tests.Internal;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Model;
using OpenFeatureSDK.Tests.Internal;
using Xunit;

namespace OpenFeature.SDK.Tests
namespace OpenFeatureSDK.Tests
{
public class FeatureProviderTests : ClearOpenFeatureInstanceFixture
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace OpenFeature.SDK.Tests.Internal
namespace OpenFeatureSDK.Tests.Internal
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public class SpecificationAttribute : Attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
using FluentAssertions;
using Microsoft.Extensions.Logging;
using Moq;
using OpenFeature.SDK.Constant;
using OpenFeature.SDK.Error;
using OpenFeature.SDK.Extension;
using OpenFeature.SDK.Model;
using OpenFeature.SDK.Tests.Internal;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Error;
using OpenFeatureSDK.Extension;
using OpenFeatureSDK.Model;
using OpenFeatureSDK.Tests.Internal;
using Xunit;

namespace OpenFeature.SDK.Tests
namespace OpenFeatureSDK.Tests
{
public class OpenFeatureClientTests : ClearOpenFeatureInstanceFixture
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using System.Collections.Generic;
using AutoFixture;
using FluentAssertions;
using OpenFeature.SDK.Model;
using OpenFeature.SDK.Tests.Internal;
using OpenFeatureSDK.Model;
using OpenFeatureSDK.Tests.Internal;
using Xunit;

namespace OpenFeature.SDK.Tests
namespace OpenFeatureSDK.Tests
{
public class OpenFeatureEvaluationContextTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
using AutoFixture;
using FluentAssertions;
using Moq;
using OpenFeature.SDK.Constant;
using OpenFeature.SDK.Model;
using OpenFeature.SDK.Tests.Internal;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Model;
using OpenFeatureSDK.Tests.Internal;
using Xunit;

namespace OpenFeature.SDK.Tests
namespace OpenFeatureSDK.Tests
{
public class OpenFeatureHookTests : ClearOpenFeatureInstanceFixture
{
Expand Down
Loading

0 comments on commit fac92ad

Please sign in to comment.