-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: rename namespace, add OpenFeature dep (#18)
feat!: rename namespace, add OpenFeature dependency and readmes.
- Loading branch information
Showing
24 changed files
with
153 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"src/OpenFeature.Hooks.Otel": "0.0.2", | ||
"src/OpenFeature.Providers.Flagd": "0.0.2" | ||
"src/OpenFeature.Contrib.Hooks.Otel": "0.0.2", | ||
"src/OpenFeature.Contrib.Providers.Flagd": "0.0.2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Contributing | ||
|
||
## System Requirements | ||
|
||
Dotnet 6+ is recommended. | ||
|
||
## Compilation target(s) | ||
|
||
As in the Dotnet-SDK, we target C# LangVersion 7.3. The `Common.props` configures this automatically. | ||
|
||
## Adding a project | ||
|
||
1. Create a new library project under `src/`: `dotnet new classlib -o src/OpenFeature.Contrib.MyComponent --langVersion 7.3` | ||
2. Create a new test project under `test/`: `dotnet new xunit -o test/OpenFeature.Contrib.MyComponent.Test` | ||
3. Add the library project to the solution: `dotnet sln DotnetSdkContrib.sln add src/OpenFeature.Contrib.MyComponent/OpenFeature.Contrib.MyComponent.csproj` | ||
4. Add the test project to the solution: `dotnet sln DotnetSdkContrib.sln add test/OpenFeature.Contrib.MyComponent.Test/OpenFeature.Contrib.MyComponent.Test.csproj` | ||
5. Add the desired properties to your library's `.csproj` file (see example below). | ||
5. Remove all content besides the root element from your test project's `.csproj` file (all settings will be inherited). | ||
6. Add the new library project to `release-please-config.json`. | ||
7. Add a `version.txt` file to the root of your library with a version matching that in your new `.csproj` file, e.g. `0.0.1`. | ||
8. If you care to release a pre `1.0.0` version, add the same version above to `.release-please-manifest.json`. Failing to do this will release a `1.0.0` initial release. | ||
|
||
Sample `.csproj` file: | ||
|
||
```xml | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<PackageId>OpenFeature.MyComponent</PackageId> | ||
<VersionNumber>0.0.1</VersionNumber> <!--x-release-please-version --> | ||
<Version>$(VersionNumber)</Version> | ||
<AssemblyVersion>$(VersionNumber)</AssemblyVersion> | ||
<FileVersion>$(VersionNumber)</FileVersion> | ||
<Description>A very valuable OpenFeature contribution!</Description> | ||
<PackageProjectUrl>https://openfeature.dev</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk-contrib</RepositoryUrl> | ||
<Authors>Me!</Authors> | ||
</PropertyGroup> | ||
|
||
</Project> | ||
``` | ||
|
||
## Documentation | ||
|
||
Any published modules must have documentation in their root directory, explaining the basic purpose of the module as well as installation and usage instructions. | ||
Instructions for how to develop a module should also be included (required system dependencies, instructions for testing locally, etc). | ||
|
||
## Testing | ||
|
||
Any published modules must have reasonable test coverage. | ||
The instructions above will generate a test project for you. | ||
|
||
Use `dotnet test` to test the entire project. | ||
|
||
## Versioning and releasing | ||
|
||
As described in the [README](./README.md), this project uses release-please, and semantic versioning. | ||
Breaking changes should be identified by using a semantic PR title. | ||
|
||
## Dependencies | ||
|
||
Keep dependencies to a minimum. | ||
Dependencies used only for building and testing should have a `<PrivateAssets>all</PrivateAssets>` element to prevent them from being exposed to consumers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
# dotnet-sdk-contrib | ||
OpenFeature Providers and Hooks for .NET | ||
# OpenFeature .NET Contributions | ||
|
||
![Experimental](https://img.shields.io/badge/experimental-breaking%20changes%20allowed-yellow) | ||
![Alpha](https://img.shields.io/badge/alpha-release-red) | ||
|
||
This repository is intended for OpenFeature contributions which are not included in the [OpenFeature SDK](https://github.com/open-feature/dotnet-sdk). | ||
|
||
## Releases | ||
|
||
This repo uses _Release Please_ to release packages. Release Please sets up a running PR that tracks all changes for the library components, and maintains the versions according to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), generated when [PRs are merged](https://github.com/amannn/action-semantic-pull-request). When Release Please's running PR is merged, any changed artifacts are published. | ||
|
||
## Contributing | ||
|
||
see: [CONTRIBUTING.md](./CONTRIBUTING.md) | ||
|
||
## License | ||
|
||
Apache 2.0 - See [LICENSE](./LICENSE) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<Project> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'DotnetSdkContribs.sln'))\build\Common.prod.props" /> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'DotnetSdkContrib.sln'))\build\Common.prod.props" /> | ||
</Project> |
2 changes: 1 addition & 1 deletion
2
src/OpenFeature.Hooks.Otel/Class1.cs → src/OpenFeature.Contrib.Hooks.Otel/Class1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace OpenFeature.Hooks.Otel | ||
namespace OpenFeature.Contrib.Hooks.Otel | ||
{ | ||
/// <summary> | ||
/// Stub. | ||
|
1 change: 1 addition & 0 deletions
1
....Hooks.Otel/OpenFeature.Hooks.Otel.csproj → ...tel/OpenFeature.Contrib.Hooks.Otel.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# OpenFeature OpenTelemetry hook for .NET | ||
|
||
Coming soon! |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
....Flagd/OpenFeature.Providers.Flagd.csproj → ...penFeature.Contrib.Providers.Flagd.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# OpenFeature flagd Provider for .NET | ||
|
||
Coming soon! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace OpenFeature.Contrib.Providers.Flagd | ||
{ | ||
/// <summary> | ||
/// A stub class. | ||
/// </summary> | ||
public class Stub | ||
{ | ||
/// <summary> | ||
/// Get the provider name. | ||
/// </summary> | ||
public static string GetProviderName() | ||
{ | ||
return Api.Instance.GetProviderMetadata().Name; | ||
} | ||
} | ||
} | ||
|
||
|
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<Project> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'DotnetSdkContribs.sln'))\build\Common.tests.props" /> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'DotnetSdkContrib.sln'))\build\Common.tests.props" /> | ||
</Project> |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../OpenFeature.Hooks.Otel.Test/UnitTest1.cs → ...ture.Contrib.Hooks.Otel.Test/UnitTest1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
.../OpenFeature.Contrib.Providers.Flagd.Test/OpenFeature.Contrib.Providers.Flagd.Test.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\OpenFeature.Contrib.Providers.Flagd\OpenFeature.Contrib.Providers.Flagd.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
15 changes: 15 additions & 0 deletions
15
test/OpenFeature.Contrib.Providers.Flagd.Test/UnitTest1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
using Xunit; | ||
using OpenFeature.Contrib.Providers.Flagd; | ||
|
||
namespace OpenFeature.Contrib.Providers.Flagd.Test | ||
{ | ||
public class UnitTest1 | ||
{ | ||
[Fact] | ||
public void TestMethod1() | ||
{ | ||
Assert.Equal("No-op Provider", Stub.GetProviderName()); | ||
} | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
test/OpenFeature.Providers.Flagd.Test/OpenFeature.Providers.Flagd.Test.csproj
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.