From 3d089f5c48478d7151fcf5964aa545471a0afe5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Kj=C3=A6r=20Henneberg?= Date: Tue, 9 Apr 2024 01:31:59 +1200 Subject: [PATCH 1/2] fix: Fix Statsig nuget package name (#172) Signed-off-by: Jens Henneberg --- ...enFeature.Contrib.Providers.Statsig.csproj | 2 +- .../README.md | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/OpenFeature.Contrib.Providers.Statsig/OpenFeature.Contrib.Providers.Statsig.csproj b/src/OpenFeature.Contrib.Providers.Statsig/OpenFeature.Contrib.Providers.Statsig.csproj index 712d5029..d3e6084b 100644 --- a/src/OpenFeature.Contrib.Providers.Statsig/OpenFeature.Contrib.Providers.Statsig.csproj +++ b/src/OpenFeature.Contrib.Providers.Statsig/OpenFeature.Contrib.Providers.Statsig.csproj @@ -1,7 +1,7 @@  - OpenFeature.Contrib.Provider.Statsig + OpenFeature.Contrib.Providers.Statsig 0.0.3 $(VersionNumber) preview diff --git a/src/OpenFeature.Contrib.Providers.Statsig/README.md b/src/OpenFeature.Contrib.Providers.Statsig/README.md index 20b68fd8..070c5571 100644 --- a/src/OpenFeature.Contrib.Providers.Statsig/README.md +++ b/src/OpenFeature.Contrib.Providers.Statsig/README.md @@ -10,32 +10,32 @@ The first things we will do is install the **Open Feature SDK** and the **Statsi ### .NET Cli ```shell -dotnet add package OpenFeature.Contrib.Provider.Statsig +dotnet add package OpenFeature.Contrib.Providers.Statsig ``` ### Package Manager ```shell -NuGet\Install-Package OpenFeature.Contrib.Provider.Statsig +NuGet\Install-Package OpenFeature.Contrib.Providers.Statsig ``` ### Package Reference ```xml - + ``` ### Packet cli ```shell -paket add OpenFeature.Contrib.Provider.Statsig +paket add OpenFeature.Contrib.Providers.Statsig ``` ### Cake ```shell -// Install OpenFeature.Contrib.Provider.Statsig as a Cake Addin -#addin nuget:?package= OpenFeature.Contrib.Provider.Statsig +// Install OpenFeature.Contrib.Providers.Statsig as a Cake Addin +#addin nuget:?package= OpenFeature.Contrib.Providers.Statsig -// Install OpenFeature.Contrib.Provider.Statsig as a Cake Tool -#tool nuget:?package= OpenFeature.Contrib.Provider.Statsig +// Install OpenFeature.Contrib.Providers.Statsig as a Cake Tool +#tool nuget:?package= OpenFeature.Contrib.Providers.Statsig ``` ## Using the Statsig Provider with the OpenFeature SDK @@ -44,7 +44,7 @@ The following example shows how to use the Statsig provider with the OpenFeature ```csharp using OpenFeature; -using OpenFeature.Contrib.Provider.Statsig; +using OpenFeature.Contrib.Providers.Statsig; using System; StatsigProvider statsigProvider = new StatsigProvider("#YOUR-SDK-KEY#"); @@ -52,7 +52,10 @@ StatsigProvider statsigProvider = new StatsigProvider("#YOUR-SDK-KEY#"); // Set the statsigProvider as the provider for the OpenFeature SDK await Api.Instance.SetProviderAsync(statsigProvider); -IFeatureClient client = OpenFeature.Api.Instance.GetClient(); +var eb = EvaluationContext.Builder(); +eb.SetTargetingKey("john@doe.acme"); + +IFeatureClient client = Api.Instance.GetClient(context: eb.Build()); bool isMyAwesomeFeatureEnabled = await client.GetBooleanValue("isMyAwesomeFeatureEnabled", false); @@ -65,10 +68,10 @@ if (isMyAwesomeFeatureEnabled) ### Customizing the Statsig Provider -The Statsig provider can be customized by passing a `Action` object to the constructor. +The Statsig provider can be customized by passing a `StatsigServerOptions` object to the constructor. ```csharp -var statsigProvider = new StatsigProvider("#YOUR-SDK-KEY#", options => options.LocalMode = true); +var statsigProvider = new StatsigProvider("#YOUR-SDK-KEY#", new StatsigServerOptions() { LocalMode = true }); ``` For a full list of options see the [Statsig documentation](https://docs.statsig.com/server/dotnetSDK#statsig-options). From 5ff0e5f4c5939e9a584809e623b1306f7546c5b1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:18:12 -0400 Subject: [PATCH 2/2] chore(deps): update dotnet monorepo (#141) Signed-off-by: Michael Beemer --- .github/workflows/ci.yml | 3 +++ .github/workflows/release.yml | 1 + global.json | 2 +- .../OpenFeature.Contrib.Providers.Flagsmith.csproj | 2 +- .../OpenFeature.Contrib.Providers.GOFeatureFlag.csproj | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ac8af2d..a37ee987 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x source-url: https://nuget.pkg.github.com/open-feature/index.json - name: Restore @@ -72,6 +73,7 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x source-url: https://nuget.pkg.github.com/open-feature/index.json - name: Copy Gherkin @@ -106,6 +108,7 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x source-url: https://nuget.pkg.github.com/open-feature/index.json - name: Restore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 74505035..e107b87b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,7 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x source-url: https://nuget.pkg.github.com/open-feature/index.json - name: Install dependencies diff --git a/global.json b/global.json index 0aca8b12..8d00746b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { "rollForward": "latestFeature", - "version": "8.0.100" + "version": "8.0.203" } } diff --git a/src/OpenFeature.Contrib.Providers.Flagsmith/OpenFeature.Contrib.Providers.Flagsmith.csproj b/src/OpenFeature.Contrib.Providers.Flagsmith/OpenFeature.Contrib.Providers.Flagsmith.csproj index 3cac844d..19acfeae 100644 --- a/src/OpenFeature.Contrib.Providers.Flagsmith/OpenFeature.Contrib.Providers.Flagsmith.csproj +++ b/src/OpenFeature.Contrib.Providers.Flagsmith/OpenFeature.Contrib.Providers.Flagsmith.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/OpenFeature.Contrib.Providers.GOFeatureFlag/OpenFeature.Contrib.Providers.GOFeatureFlag.csproj b/src/OpenFeature.Contrib.Providers.GOFeatureFlag/OpenFeature.Contrib.Providers.GOFeatureFlag.csproj index 18db0302..5cabdd99 100644 --- a/src/OpenFeature.Contrib.Providers.GOFeatureFlag/OpenFeature.Contrib.Providers.GOFeatureFlag.csproj +++ b/src/OpenFeature.Contrib.Providers.GOFeatureFlag/OpenFeature.Contrib.Providers.GOFeatureFlag.csproj @@ -11,7 +11,7 @@ - +