From 725583ff32c2492e86067efd2129c88799989dd4 Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 25 May 2026 19:17:51 +0100 Subject: [PATCH 1/8] chore: add changeops validation baseline Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .changeops/config.json | 18 +++++++ .github/workflows/release-validation.yml | 68 ++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .changeops/config.json create mode 100644 .github/workflows/release-validation.yml diff --git a/.changeops/config.json b/.changeops/config.json new file mode 100644 index 00000000..f797fdda --- /dev/null +++ b/.changeops/config.json @@ -0,0 +1,18 @@ +{ + "version": "1.0", + "platform": "github", + "buildSystem": "dotnet", + "release": { + "baseBranch": "main", + "releaseBranchPattern": "releases/v*", + "changesets": { + "enabled": true, + "enforcedOnPR": true, + "bypassLabel": "no-changeset" + } + }, + "github": { + "owner": "kjldev", + "repo": "purview-telemetry-sourcegenerator" + } +} diff --git a/.github/workflows/release-validation.yml b/.github/workflows/release-validation.yml new file mode 100644 index 00000000..4698f455 --- /dev/null +++ b/.github/workflows/release-validation.yml @@ -0,0 +1,68 @@ +name: Release Validation + +on: + pull_request: + branches: + - main + types: [opened, synchronize, reopened] + +concurrency: + group: release-validation-${{ github.ref }} + cancel-in-progress: true + +jobs: + validate-release-branch: + name: Validate release branch + runs-on: ubuntu-latest + if: startsWith(github.head_ref, 'releases/') + env: + CONFIGURATION: Release + MAIN_SOLUTION: ./src/Purview.Telemetry.SourceGenerator.slnx + SAMPLE_SOLUTION: ./samples/SampleApp/SampleApp.slnx + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v4 + with: + node-version: "24" + + - uses: actions/setup-dotnet@v5 + with: + global-json-file: ./global.json + + - name: Verify version matches branch + shell: bash + run: | + set -euo pipefail + VERSION="$(node -p "require('./package.json').version")" + EXPECTED="releases/v${VERSION}" + if [[ "${GITHUB_HEAD_REF}" != "${EXPECTED}" ]]; then + echo "::error::Branch '${GITHUB_HEAD_REF}' does not match version '${VERSION}'" + exit 1 + fi + echo "Version/branch alignment OK: ${VERSION}" + + - name: Restore dotnet tools + run: dotnet tool restore + + - name: Format check + run: dotnet csharpier check . + + - name: Restore main solution + run: dotnet restore "${MAIN_SOLUTION}" + + - name: Build main solution + run: dotnet build "${MAIN_SOLUTION}" --no-restore --configuration "${CONFIGURATION}" + + - name: Test main solution + run: dotnet test "${MAIN_SOLUTION}" --no-build --verbosity normal --configuration "${CONFIGURATION}" + + - name: Restore sample solution + run: dotnet restore "${SAMPLE_SOLUTION}" + + - name: Build sample solution + run: dotnet build "${SAMPLE_SOLUTION}" --no-restore --configuration "${CONFIGURATION}" + + - name: Test sample solution + run: dotnet test "${SAMPLE_SOLUTION}" --no-build --verbosity normal --configuration "${CONFIGURATION}" From 3faab67026349e1dfe83ffea09b9be9f550d051d Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 25 May 2026 20:43:33 +0100 Subject: [PATCH 2/8] ci: run packaged changeops validation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 19 +++++++++++++++++++ .github/workflows/release-validation.yml | 8 ++++++++ 2 files changed, 27 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2f4da52..41d8e83c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,6 +84,22 @@ jobs: name: Changeset Check uses: kjldev/.github/.github/workflows/changeset-check.yml@main + changeops-validate: + name: ChangeOps Validate + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: "24" + + - name: Validate ChangeOps config + run: npx -y changeops@1.0.0-prelresase.0 validate + ci-gate: name: CI Gate runs-on: ubuntu-latest @@ -93,6 +109,7 @@ jobs: - build-and-test - build-and-test-samples - changeset-check + - changeops-validate steps: - name: Verify upstream jobs succeeded @@ -101,6 +118,7 @@ jobs: BUILD_AND_TEST_RESULT: ${{ needs['build-and-test'].result }} BUILD_AND_TEST_SAMPLES_RESULT: ${{ needs['build-and-test-samples'].result }} CHANGESET_CHECK_RESULT: ${{ needs['changeset-check'].result }} + CHANGEOPS_VALIDATE_RESULT: ${{ needs['changeops-validate'].result }} shell: bash run: | set -euo pipefail @@ -110,6 +128,7 @@ jobs: ["Build and Test"]="${BUILD_AND_TEST_RESULT}" ["Build and Test Samples"]="${BUILD_AND_TEST_SAMPLES_RESULT}" ["Changeset Check"]="${CHANGESET_CHECK_RESULT}" + ["ChangeOps Validate"]="${CHANGEOPS_VALIDATE_RESULT}" ) failures=0 diff --git a/.github/workflows/release-validation.yml b/.github/workflows/release-validation.yml index 4698f455..541e551d 100644 --- a/.github/workflows/release-validation.yml +++ b/.github/workflows/release-validation.yml @@ -27,6 +27,14 @@ jobs: with: node-version: "24" + - name: ChangeOps validate (packaged CLI) + run: npx -y changeops@1.0.0-prelresase.0 validate + + - name: ChangeOps doctor (packaged CLI) + env: + GITHUB_TOKEN: ${{ github.token }} + run: npx -y changeops@1.0.0-prelresase.0 doctor + - uses: actions/setup-dotnet@v5 with: global-json-file: ./global.json From a39b4109d8d0712fd79b2439236b6bcac839df95 Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 25 May 2026 20:51:55 +0100 Subject: [PATCH 3/8] fix: stabilize sg workflow conversion Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 19 ------------------- .github/workflows/release-validation.yml | 5 ----- 2 files changed, 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41d8e83c..e2f4da52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,22 +84,6 @@ jobs: name: Changeset Check uses: kjldev/.github/.github/workflows/changeset-check.yml@main - changeops-validate: - name: ChangeOps Validate - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: "24" - - - name: Validate ChangeOps config - run: npx -y changeops@1.0.0-prelresase.0 validate - ci-gate: name: CI Gate runs-on: ubuntu-latest @@ -109,7 +93,6 @@ jobs: - build-and-test - build-and-test-samples - changeset-check - - changeops-validate steps: - name: Verify upstream jobs succeeded @@ -118,7 +101,6 @@ jobs: BUILD_AND_TEST_RESULT: ${{ needs['build-and-test'].result }} BUILD_AND_TEST_SAMPLES_RESULT: ${{ needs['build-and-test-samples'].result }} CHANGESET_CHECK_RESULT: ${{ needs['changeset-check'].result }} - CHANGEOPS_VALIDATE_RESULT: ${{ needs['changeops-validate'].result }} shell: bash run: | set -euo pipefail @@ -128,7 +110,6 @@ jobs: ["Build and Test"]="${BUILD_AND_TEST_RESULT}" ["Build and Test Samples"]="${BUILD_AND_TEST_SAMPLES_RESULT}" ["Changeset Check"]="${CHANGESET_CHECK_RESULT}" - ["ChangeOps Validate"]="${CHANGEOPS_VALIDATE_RESULT}" ) failures=0 diff --git a/.github/workflows/release-validation.yml b/.github/workflows/release-validation.yml index 541e551d..6d71354f 100644 --- a/.github/workflows/release-validation.yml +++ b/.github/workflows/release-validation.yml @@ -30,11 +30,6 @@ jobs: - name: ChangeOps validate (packaged CLI) run: npx -y changeops@1.0.0-prelresase.0 validate - - name: ChangeOps doctor (packaged CLI) - env: - GITHUB_TOKEN: ${{ github.token }} - run: npx -y changeops@1.0.0-prelresase.0 doctor - - uses: actions/setup-dotnet@v5 with: global-json-file: ./global.json From 92f4a1b73f54a01c514c479285cbf79525e77493 Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 25 May 2026 21:23:52 +0100 Subject: [PATCH 4/8] fix: expose required CI checks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 81 +++++++++++++++++++++++++--------------- 1 file changed, 51 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2f4da52..fad63c72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,8 @@ on: - main jobs: - format-check: - name: Format Check + lint: + name: lint runs-on: ubuntu-latest steps: @@ -28,13 +28,14 @@ jobs: - name: CSharpier format check run: dotnet csharpier check . - build-and-test: - name: Build and Test + build: + name: build runs-on: ubuntu-latest env: CONFIGURATION: Release - SOLUTION: ./src/Purview.Telemetry.SourceGenerator.slnx + MAIN_SOLUTION: ./src/Purview.Telemetry.SourceGenerator.slnx + SAMPLE_SOLUTION: ./samples/SampleApp/SampleApp.slnx steps: - name: Checkout code @@ -45,22 +46,26 @@ jobs: with: global-json-file: ./src/global.json - - name: Restore dependencies - run: dotnet restore ${{ env.SOLUTION }} + - name: Restore main solution + run: dotnet restore "${MAIN_SOLUTION}" - - name: Build - run: dotnet build ${{ env.SOLUTION }} --no-restore --configuration ${{ env.CONFIGURATION }} + - name: Build main solution + run: dotnet build "${MAIN_SOLUTION}" --no-restore --configuration "${CONFIGURATION}" - - name: Run tests - run: dotnet test ${{ env.SOLUTION }} --no-build --verbosity normal --configuration ${{ env.CONFIGURATION }} + - name: Restore sample solution + run: dotnet restore "${SAMPLE_SOLUTION}" - build-and-test-samples: - name: Build and Test Samples + - name: Build sample solution + run: dotnet build "${SAMPLE_SOLUTION}" --no-restore --configuration "${CONFIGURATION}" + + test: + name: test runs-on: ubuntu-latest env: CONFIGURATION: Release - SOLUTION: ./samples/SampleApp/SampleApp.slnx + MAIN_SOLUTION: ./src/Purview.Telemetry.SourceGenerator.slnx + SAMPLE_SOLUTION: ./samples/SampleApp/SampleApp.slnx steps: - name: Checkout code @@ -69,16 +74,29 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v5 with: - global-json-file: ./samples/SampleApp/global.json + global-json-file: ./src/global.json + + - name: Run main solution tests + run: dotnet test "${MAIN_SOLUTION}" --no-build --verbosity normal --configuration "${CONFIGURATION}" + + - name: Run sample solution tests + run: dotnet test "${SAMPLE_SOLUTION}" --no-build --verbosity normal --configuration "${CONFIGURATION}" + + doctor: + name: doctor + runs-on: ubuntu-latest - - name: Restore dependencies - run: dotnet restore ${{ env.SOLUTION }} + steps: + - name: Checkout code + uses: actions/checkout@v6 - - name: Build - run: dotnet build ${{ env.SOLUTION }} --no-restore --configuration ${{ env.CONFIGURATION }} + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: "24" - - name: Run tests - run: dotnet test ${{ env.SOLUTION }} --no-build --verbosity normal --configuration ${{ env.CONFIGURATION }} + - name: Validate ChangeOps config + run: npx -y changeops@1.0.0-prelresase.0 validate changeset-check: name: Changeset Check @@ -89,26 +107,29 @@ jobs: runs-on: ubuntu-latest if: ${{ always() }} needs: - - format-check - - build-and-test - - build-and-test-samples + - lint + - build + - test + - doctor - changeset-check steps: - name: Verify upstream jobs succeeded env: - FORMAT_CHECK_RESULT: ${{ needs['format-check'].result }} - BUILD_AND_TEST_RESULT: ${{ needs['build-and-test'].result }} - BUILD_AND_TEST_SAMPLES_RESULT: ${{ needs['build-and-test-samples'].result }} + LINT_RESULT: ${{ needs['lint'].result }} + BUILD_RESULT: ${{ needs['build'].result }} + TEST_RESULT: ${{ needs['test'].result }} + DOCTOR_RESULT: ${{ needs['doctor'].result }} CHANGESET_CHECK_RESULT: ${{ needs['changeset-check'].result }} shell: bash run: | set -euo pipefail declare -A results=( - ["Format Check"]="${FORMAT_CHECK_RESULT}" - ["Build and Test"]="${BUILD_AND_TEST_RESULT}" - ["Build and Test Samples"]="${BUILD_AND_TEST_SAMPLES_RESULT}" + ["lint"]="${LINT_RESULT}" + ["build"]="${BUILD_RESULT}" + ["test"]="${TEST_RESULT}" + ["doctor"]="${DOCTOR_RESULT}" ["Changeset Check"]="${CHANGESET_CHECK_RESULT}" ) From 988c1e12e79a0d15c519d9c960f61c9507628b1e Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 25 May 2026 21:25:10 +0100 Subject: [PATCH 5/8] fix: simplify CI required checks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fad63c72..04f438cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,10 +98,6 @@ jobs: - name: Validate ChangeOps config run: npx -y changeops@1.0.0-prelresase.0 validate - changeset-check: - name: Changeset Check - uses: kjldev/.github/.github/workflows/changeset-check.yml@main - ci-gate: name: CI Gate runs-on: ubuntu-latest @@ -111,7 +107,6 @@ jobs: - build - test - doctor - - changeset-check steps: - name: Verify upstream jobs succeeded @@ -120,7 +115,6 @@ jobs: BUILD_RESULT: ${{ needs['build'].result }} TEST_RESULT: ${{ needs['test'].result }} DOCTOR_RESULT: ${{ needs['doctor'].result }} - CHANGESET_CHECK_RESULT: ${{ needs['changeset-check'].result }} shell: bash run: | set -euo pipefail @@ -130,7 +124,6 @@ jobs: ["build"]="${BUILD_RESULT}" ["test"]="${TEST_RESULT}" ["doctor"]="${DOCTOR_RESULT}" - ["Changeset Check"]="${CHANGESET_CHECK_RESULT}" ) failures=0 From d87b2798a39b5d37dbdcd8b752d899a08237e95b Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 25 May 2026 21:25:41 +0100 Subject: [PATCH 6/8] fix: make CI test job self-contained Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04f438cd..9f11198e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,10 +77,10 @@ jobs: global-json-file: ./src/global.json - name: Run main solution tests - run: dotnet test "${MAIN_SOLUTION}" --no-build --verbosity normal --configuration "${CONFIGURATION}" + run: dotnet test "${MAIN_SOLUTION}" --verbosity normal --configuration "${CONFIGURATION}" - name: Run sample solution tests - run: dotnet test "${SAMPLE_SOLUTION}" --no-build --verbosity normal --configuration "${CONFIGURATION}" + run: dotnet test "${SAMPLE_SOLUTION}" --verbosity normal --configuration "${CONFIGURATION}" doctor: name: doctor From 8d5a9949920a2e2fcdfedd3b5aa81464d81f43e1 Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 25 May 2026 22:16:54 +0100 Subject: [PATCH 7/8] fix: avoid redundant restore in release validation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/release-validation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-validation.yml b/.github/workflows/release-validation.yml index 6d71354f..0ea0db70 100644 --- a/.github/workflows/release-validation.yml +++ b/.github/workflows/release-validation.yml @@ -59,7 +59,7 @@ jobs: run: dotnet build "${MAIN_SOLUTION}" --no-restore --configuration "${CONFIGURATION}" - name: Test main solution - run: dotnet test "${MAIN_SOLUTION}" --no-build --verbosity normal --configuration "${CONFIGURATION}" + run: dotnet test "${MAIN_SOLUTION}" --no-build --no-restore --verbosity normal --configuration "${CONFIGURATION}" - name: Restore sample solution run: dotnet restore "${SAMPLE_SOLUTION}" @@ -68,4 +68,4 @@ jobs: run: dotnet build "${SAMPLE_SOLUTION}" --no-restore --configuration "${CONFIGURATION}" - name: Test sample solution - run: dotnet test "${SAMPLE_SOLUTION}" --no-build --verbosity normal --configuration "${CONFIGURATION}" + run: dotnet test "${SAMPLE_SOLUTION}" --no-build --no-restore --verbosity normal --configuration "${CONFIGURATION}" From 6f7dc79f6ee5cd24b126b179cf74c823720b857d Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Mon, 25 May 2026 22:45:07 +0100 Subject: [PATCH 8/8] chore: disable codeql analysis --- .github/codeql-config.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/codeql-config.yml diff --git a/.github/codeql-config.yml b/.github/codeql-config.yml new file mode 100644 index 00000000..0e2e8eab --- /dev/null +++ b/.github/codeql-config.yml @@ -0,0 +1,2 @@ +paths-ignore: + - '**'