Skip to content

feat(dotnet): add C# 10 SDK, OpenFeature provider and NuGet releases - #35

Open
zote wants to merge 6 commits into
cloudflare:mainfrom
zote:feat/dotnet-openfeature-sdk
Open

zote wants to merge 6 commits into
cloudflare:mainfrom
zote:feat/dotnet-openfeature-sdk

Conversation

@zote

@zote zote commented Sep 11, 2026 •

Copy link
Copy Markdown

Adds a C# 10 .NET SDK for applications that evaluate Flagship flags over HTTP. The new FlagshipServerProvider integrates with the official OpenFeature SDK to resolve boolean, string, integer, double, and object flags, preserving evaluation reasons, variants, and caller defaults.

  • Two packages: Cloudflare.Flagship, with no external dependencies, and Cloudflare.Flagship.OpenFeature, using OpenFeature 2.14.1. Both target .NET 8 and .NET 10 with LangVersion=10.0.
  • Async HTTP client with configurable endpoints, bearer authentication, static and dynamic headers, per-attempt timeouts, bounded retries, cancellation, and an injectable HttpClient that remains caller-owned.
  • Culture-independent scalar context serialization, response validation, typed errors, and handling for disabled flags and type mismatches.
  • README, compiled example, Changeset, xUnit v3 tests, and a CI job covering formatting, tests, and NuGet packaging. Both package versions are read from the package.json synchronized by the existing Changesets workflow.
  • Automated nuget.org publication integrated with the existing Changesets release flow. Maintainers only need to configure the optional NUGET_API_KEY Actions secret with permission to publish both package IDs. Without it, the credential check succeeds and the publishing job is skipped.
  • A sdks/dotnet/v<version> tag is created only after both package pushes succeed. Unpublished changes remain eligible across releases; --skip-duplicate supports retries after partial publication. Setup, credential scope, rotation, and recovery are documented in sdks/dotnet/PUBLISHING.md.

Local validation completed:

  • pnpm run check, pnpm run changeset:validate, and pnpm run test passed, including 308 TypeScript tests and 23 release/publication tests, including missing credentials, partial upload failures, and publication baseline tracking.
  • actionlint passed for the release and reusable NuGet workflows; the exact library packing commands used by the publishing workflow also passed locally.
  • dotnet format Flagship.sln --verify-no-changes --no-restore passed.
  • dotnet test Flagship.sln -c Release: 32 tests passed for each target (.NET 8 and .NET 10), covering integration through the official OpenFeature client, HTTP errors, retries, timeouts, cancellation, context serialization, and resource ownership.
  • dotnet pack Flagship.sln -c Release --no-build -o artifacts produced both packages. Installation and flag evaluation were also verified in a separate application consuming the generated NuGet packages on both runtimes.

This contribution provides HTTP evaluation without response caching or native Workers bindings. Tests use a simulated HTTP transport and do not contact a live Flagship account. Publication scripts are tested with simulated commands; no packages have been uploaded to nuget.org during development. Live publication starts after maintainers configure the secret and run an eligible release.

@zote
zote requested review from a team and akshitsinha as code owners September 11, 2026 15:58
@changeset-bot

changeset-bot Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3001d1e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@zote zote changed the title feat(dotnet): adiciona SDK C# 10 e provider OpenFeature feat(dotnet): add C# 10 SDK, OpenFeature provider and NuGet releases Sep 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants