Skip to content
Purview Dev logo

Contributing

Stable Telemetry SourceGenerator Reviewed 2026-10-28 purview-dev/telemetry-sourcegenerator Star on GitHub 36 activity c-sharp distributed-tracing dotnet events high-performance-logging instrumentation logging melt metrics nuget observability open-telemetry open-telemetry-csharp otel roslyn source-generator spans telemetry tracing

Contributions are welcome! This page covers development setup, build commands, and the conventions enforced in this repository.

  • .NET 10 SDK (projects target net10.0; the source generator targets netstandard2.0)
  • Bun for the package.json/.build/*.ts scripts
  • The Purview.BuildSdk MSBuild SDK (pinned in global.json under msbuild-sdks)
  • csharpier dotnet tool (pinned in .config/dotnet-tools.json) for linting/formatting
Terminal window
git clone https://github.com/purview-dev/telemetry-sourcegenerator
cd telemetry-sourcegenerator

All just recipes read the Justfile; configuration defaults to Debug.

CommandPurpose
just buildBuilds src/Telemetry.SourceGenerator.slnx (Debug).
just testRuns the integration tests (Debug) with a tree-node filter.
just build-sBuilds samples/SampleApp/SampleApp.slnx.
just test-sRuns the sample test solution.
just lintRuns dotnet csharpier check . (no writes).
just lint-fixRuns dotnet csharpier format . (writes).
just cleanCleans the main solution.
just restoreRestores packages for the main solution.
just scrubRemoves bin/obj folders, cleans, restores, and shuts down build servers.

After making changes to the source generator:

  1. just build — build the main solution.
  2. just test — run the integration tests.
  3. just build-s && just test-s — build and test the sample application end to end.
  4. just lint / just format — ensure C# formatting compliance before committing.

Integration tests live in src/tests/SourceGenerator.IntegrationTests and target net8.0;net9.0;net10.0, plus net48 on Windows only. They use Purview.SourceGeneratorFramework.Testing.TUnit (TUnit + the framework’s CodeQuery syntax-lookup API and assertion extensions). There is no Verify/snapshot library; refactoring tests use the framework’s CodeRefactoringTestBase snapshot approach.

When generator behaviour changes, add or update tests in src/tests/SourceGenerator.IntegrationTests/.

  • Conventional commits — enforced by commitlint (.config/lefthook.yml). Types: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test.
  • Formatting — C# is formatted with csharpier; check with just lint.
  • Solutions — .slnx solution files are used.
  • Source generator — targets netstandard2.0 and uses Purview.SourceGeneratorFramework (CodeWriter-based emission, incremental pipeline, value-equatable models).

The repo mirrors its GitHub CI/CD pipelines locally with the reusable purview-build tool:

CommandPurpose
just pipeline-prRestore, build, lint, and tests (the PR gate).
just pipeline-buildRestore, build, lint (no tests).
just pipeline-testsBuild with tests enabled.
just pipeline-releaseFull release: build, test, pack, publish, GitHub release.
just pipeline-local-releasePack + publish to a local NuGet feed (see the Justfile note on argument quoting).

Before doing specialist work, load the relevant skill from .agents/skills/ — see AGENTS.md (“Installed skills”) for the full list, when to load each one, and how to add or update them. The installed skills and skills-lock.json are committed; install only into .agents/ (-a universal), never into .claude/ or another per-agent folder.

See docs/release-process.md for the full flow. In short: push a feature branch and open a PR to main (pr.yml runs build + lint + tests); merging to main triggers the reusable release pipeline (build, test, pack, publish, GitHub release). The version lives in package.json; after bumping it, run just update-version to sync docs/samples, then just pipeline-local-release to validate locally.

  • Release Flow — how releases are produced
  • Testing — mocking generated telemetry interfaces