From fd13ae38b11da95fdc8a4a9c5f17accf8d30001a Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 12 Oct 2026 20:19:01 +0100 Subject: [PATCH 1/5] perf: updating to the latest source-gen-fw for improved test performance --- Directory.Packages.props | 4 ++-- global.json | 2 +- package.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6fa522a8..96661c3a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,8 +2,8 @@ true 5.9.0 - 1.67.0 - 1.0.0 + 1.74.0 + 1.1.0 10.0.12 10.10.0 1.18.0 diff --git a/global.json b/global.json index 9ece9928..5ad43180 100644 --- a/global.json +++ b/global.json @@ -3,7 +3,7 @@ "allowPrerelease": false }, "msbuild-sdks": { - "Purview.BuildSdk": "1.0.4" + "Purview.BuildSdk": "1.0.5" }, "test": { "runner": "Microsoft.Testing.Platform" diff --git a/package.json b/package.json index 5cd1cc09..a165d518 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "purview-telemetry-sourcegenerator", - "version": "5.0.2", + "name": "telemetry-sourcegenerator", + "version": "5.0.3", "description": "Generates [`ActivitySource`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.activitysource), [`ILogger`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger), and [`Metrics`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics) based on interface methods.", "license": "MIT", "readme": "README.md", From 83a1b43e52554ee260ee8e10a1be05143484974f Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 12 Oct 2026 22:54:50 +0100 Subject: [PATCH 2/5] docs: stop duplicating the package version in the docs AGENTS.md and docs/release-process.md carried a hardcoded "Current Version", and docs/wiki/Release-Flow.md had drifted to 5.0.0 because it is not in the filesToUpdate list in .build/update-version.ts. Replace the literal version with * and point at `just version`, so package.json stays the single source of truth. The first pattern in update-version.ts now matches nothing by design; its install-snippet patterns are unaffected. --- AGENTS.md | 5 +++-- docs/release-process.md | 2 +- docs/wiki/Release-Flow.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 0f8804ae..773c0d93 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -64,8 +64,9 @@ conventional-commits check. | `just update-version` | Runs `.build/update-version.ts` to sync the version into docs/samples. | | `just pack` | Updates the version then packs the NuGet package into `artifacts/`. | -The version lives in `package.json`. **Current Version:** 5.0.2 — applied to `Version` / -`PackageVersion` via the SDK's package.json version detection. +The version lives in `package.json`. **Current Version:** `*` — read from `package.json` at build +time and applied to `Version` / `PackageVersion` via the SDK's package.json version detection. Run +`just version` to print the current value; it is deliberately not duplicated here. ### Pipelines (reusable `purview-build` tool) diff --git a/docs/release-process.md b/docs/release-process.md index 34cce6f7..100860fe 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -70,7 +70,7 @@ Merging to `main` triggers `release.yml`, which runs the reusable `purview-relea ## Versioning -- The version lives in `package.json`. **Current Version:** 5.0.2 +- The version lives in `package.json`. **Current Version:** `*` (run `just version` to print it) - It is applied to `Version` / `PackageVersion` by `Purview.BuildSdk` via package.json version detection (`UsePackageJsonVersion`, default `true`). - `just version` prints the current version. diff --git a/docs/wiki/Release-Flow.md b/docs/wiki/Release-Flow.md index 98289bd1..156cd446 100644 --- a/docs/wiki/Release-Flow.md +++ b/docs/wiki/Release-Flow.md @@ -27,7 +27,7 @@ Feature branch ## Versioning -- The version lives in `package.json`. **Current Version:** 5.0.0 +- The version lives in `package.json`. **Current Version:** `*` (run `just version` to print it) - It is applied to `Version`/`PackageVersion` by `Purview.BuildSdk` via package.json version detection. - `just version` prints the current version. - After bumping `package.json`, run `just update-version` to sync the version into docs/samples. From 17684bbac5dd7a3115392245d9cb33e9586a862e Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 12 Oct 2026 23:03:59 +0100 Subject: [PATCH 3/5] build: install Purview.Build as a .NET local tool Add Purview.Build 0.5.2 to .config/dotnet-tools.json and replace the hand-rolled dotnet tool install --tool-path .tools/purview-build in the Justfile with dotnet tool restore, running the pipeline as dotnet purview-build. The version is now pinned in the tool manifest alongside CSharpier, so it is restored by the same command as every other tool and needs no bespoke install step, no --add-source feed argument and no platform-specific executable suffix. The dead pipeline_feed variable is removed, and the docs describing the old .tools/purview-build path are updated to match. --- .config/dotnet-tools.json | 7 +++++++ Justfile | 21 +++++++++------------ docs/release-process.md | 2 +- docs/wiki/Release-Flow.md | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index fb057632..922c9482 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,6 +15,13 @@ "dotnet-inspect" ], "rollForward": false + }, + "purview.build": { + "version": "0.5.2", + "commands": [ + "purview-build" + ], + "rollForward": false } } } \ No newline at end of file diff --git a/Justfile b/Justfile index 075fed5b..939da973 100644 --- a/Justfile +++ b/Justfile @@ -5,8 +5,7 @@ solution_file := root_folder + "Telemetry.SourceGenerator.slnx" test_solution := solution_file build_configuration := "Debug" -pipeline_feed := "https://api.nuget.org/v3/index.json" -pipeline_tool := ".tools/purview-build/purview-build" +pipeline_tool := "dotnet purview-build" sample_solution_file := "./samples/SampleApp/SampleApp.slnx" multiproject_sample_solution_file := "./samples/SampleApp.MultiProject/SampleApp.MultiProject.slnx" @@ -20,33 +19,31 @@ benchmark_solution := "./benchmarks/Purview.Telemetry.Benchmarks/Purview.Telemet default: just --list -# Install the shared Purview.Build tool (authenticated to the Purview-Dev feed) if not present +# Restore the repository's .NET local tools (.config/dotnet-tools.json) [private] ensure-pipeline-tool: - if [ ! -x "{{ pipeline_tool }}" ]; then \ - dotnet tool install Purview.Build --tool-path .tools/purview-build --add-source "{{ pipeline_feed }}"; \ - fi + dotnet tool restore # Run the PR pipeline (restore, build, lint, tests) [group('Pipeline')] pipeline-pr *args: just ensure-pipeline-tool echo "Running PR pipeline..." - "{{ pipeline_tool }}" {{ args }} + {{ pipeline_tool }} {{ args }} # Run the build pipeline (restore, build, lint) [group('Pipeline')] pipeline-build *args: just ensure-pipeline-tool echo "Running build pipeline..." - "{{ pipeline_tool }}" --Build:RunTests=false --Release:Mode=None {{ args }} + {{ pipeline_tool }} --Build:RunTests=false --Release:Mode=None {{ args }} # Run the release pipeline (restore, build, lint, tests, pack, publish, GitHub release) [group('Pipeline')] pipeline-release *args: just ensure-pipeline-tool echo "Running release pipeline..." - "{{ pipeline_tool }}" --Release:Mode=NuGet {{ args }} + {{ pipeline_tool }} --Release:Mode=NuGet {{ args }} # Run the release pipeline (restore, build, lint, tests, pack, local nuget publish) # Note: `just` runs recipes through the shell, which strips backslashes from unquoted arguments. @@ -56,21 +53,21 @@ pipeline-release *args: pipeline-local-release *args: just ensure-pipeline-tool echo "Running local release pipeline..." - "{{ pipeline_tool }}" --Release:Mode=LocalNuGet {{ args }} + {{ pipeline_tool }} --Release:Mode=LocalNuGet {{ args }} # Run the pipeline with tests enabled [group('Pipeline')] pipeline-tests *args: just ensure-pipeline-tool echo "Running tests pipeline..." - "{{ pipeline_tool }}" --Build:RunTests=true --Release:Mode=None {{ args }} + {{ pipeline_tool }} --Build:RunTests=true --Release:Mode=None {{ args }} # Run the pipeline through pack + validate (restore, build, lint, tests, pack, validate pack contents) without publishing/releasing [group('Pipeline')] pipeline-pack-validate *args: just ensure-pipeline-tool echo "Running pack + validate pipeline..." - "{{ pipeline_tool }}" --Build:RunPack=true --Build:ValidatePack=true --Release:Mode=None {{ args }} + {{ pipeline_tool }} --Build:RunPack=true --Build:ValidatePack=true --Release:Mode=None {{ args }} # ----------------------------------------------------------------------------- # Build and Test diff --git a/docs/release-process.md b/docs/release-process.md index 100860fe..3e99e21b 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -23,7 +23,7 @@ Feature branch | ----------- | ------ | --------- | | PR gate | `.github/workflows/pr.yml` | Runs the reusable `purview-dev/build` `purview-build.yml` pipeline (restore, build, lint, tests) and builds/tests the sample solution | | CD pipeline | `.github/workflows/release.yml` | Runs the reusable `purview-dev/build` `purview-release.yml` pipeline on push to `main` | -| Local pipeline | `Justfile` `pipeline-*` recipes | Mirror the CI/CD pipelines locally via the `Purview.Build` tool (`.tools/purview-build`) | +| Local pipeline | `Justfile` `pipeline-*` recipes | Mirror the CI/CD pipelines locally via the `Purview.Build` local tool (`dotnet purview-build`) | ## Developer workflow diff --git a/docs/wiki/Release-Flow.md b/docs/wiki/Release-Flow.md index 156cd446..078a04f8 100644 --- a/docs/wiki/Release-Flow.md +++ b/docs/wiki/Release-Flow.md @@ -15,7 +15,7 @@ Feature branch | --- | --- | --- | | PR gate | `.github/workflows/pr.yml` | Runs the reusable `purview-dev/build` `purview-build.yml` pipeline (restore, build, lint, tests) and builds/tests the sample solution. | | CD pipeline | `.github/workflows/release.yml` | Runs the reusable `purview-dev/build` `purview-release.yml` pipeline on push to `main`. | -| Local pipeline | `Justfile` `pipeline-*` recipes | Mirror the CI/CD pipelines locally via the `Purview.Build` tool (`.tools/purview-build`). | +| Local pipeline | `Justfile` `pipeline-*` recipes | Mirror the CI/CD pipelines locally via the `Purview.Build` local tool (`dotnet purview-build`). | ## Developer workflow From 3012b8013ef8edffed7cb17aa477e6e831b20053 Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Tue, 13 Oct 2026 08:42:16 +0100 Subject: [PATCH 4/5] build: declare RequiredCompilerFlags explicitly Purview.Build 0.5.3 defaults RequiredCompilerFlags to empty. Earlier versions forced the optimization=release check on and could not be configured off, because binding an empty JSON array contributes no configuration keys and so never overwrote the tool's non-empty code default. These packages have therefore always been validated against that flag. Declaring it keeps that behaviour rather than silently losing the check on the move to 0.5.3. Verified with just pipeline-pack-validate: all packages still valid. --- .config/purview-build.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/purview-build.json b/.config/purview-build.json index e29fae1f..d6a2629a 100644 --- a/.config/purview-build.json +++ b/.config/purview-build.json @@ -6,6 +6,10 @@ "TestFilter": "/*/*/*/*" }, "PackValidation": { + // Explicit because Purview.Build 0.5.3 defaults RequiredCompilerFlags to empty. Earlier + // versions forced this check on and could not be configured off, so these packages have + // always been validated against it; declaring it keeps that behaviour. + "RequiredCompilerFlags": ["optimization=release"], "RequireSymbolPackage": false, "RequiredContent": { "purview.telemetry.sourcegenerator": [ @@ -20,4 +24,4 @@ "Release": { "Mode": "None" } -} \ No newline at end of file +} From d298eefe7ef5a0e5664983ea3c9769056b8d31fa Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Tue, 13 Oct 2026 09:16:00 +0100 Subject: [PATCH 5/5] build: take Purview.Build 0.5.3 Picks up the fix that makes RequiredCompilerFlags configurable: earlier versions forced the compiler-flag check on because binding an empty JSON array contributes no configuration keys, so the tool's non-empty code default could never be overridden. This repository declares "RequiredCompilerFlags": ["optimization=release"] explicitly, so the check it has always run under is preserved. Verified with just pipeline-pack-validate against 0.5.3. --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 922c9482..42b8dea3 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -17,7 +17,7 @@ "rollForward": false }, "purview.build": { - "version": "0.5.2", + "version": "0.5.3", "commands": [ "purview-build" ],