Skip to content

ci: adopt the consolidated .NET workflow (needs a repo variable set before merge) - #188

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/happy-rubin-w67sx1
Sep 14, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/happy-rubin-w67sx1

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Important

Set the repository variable SONAR_COVERAGE_EXCLUSIONS_EXTRA to Schema.Editor/Program.cs before merging. I have no API for setting repository variables, so this one is yours. Without it, Schema.Editor/Program.cs stops being excluded and starts counting against coverage.

Adopts the one canonical .github/workflows/dotnet.yml, byte-identical across every ktsu .NET repository. They had drifted into five different files; this folds the drift in rather than flattening it.

This repository was the reason two of the shared features exist

It held variant 30fbfeb, the only one with genuinely repo-specific behaviour rather than just stale prose. Both of its differences are now carried by everyone:

  • The 8.0 and 9.0 runtimes installed alongside the pinned SDK in the test and release jobs. Your comment explained it exactly right — Schema.Test multi-targets every framework the library publishes, so the test hosts for the older ones need those runtimes present. That is true of most ktsu libraries, so it is now the shared default. global.json still pins the SDK, so it only adds runtimes.
  • Schema.Editor/Program.cs excluded from coverage. Rather than putting one repository's path in every repository's file, the exclusion list is now extensible through the SONAR_COVERAGE_EXCLUSIONS_EXTRA variable, appended to the shared list when set. Your reasoning for the exclusion — that Program.cs holds only a Main which opens a window and does not return, so it cannot be executed rather than merely being untested — is exactly the case the variable is documented for.

What this repository also gains

  • macOS back in the test matrix. It was excluded org-wide as collateral from one repository's net10.0-ios head, which needed a workload this job does not install; that widening is now opt-in. UI tests stay Linux-only, so the cell stays cheap.
  • The UI-test rule names Linux rather than Windows, so a platform added later gets the cheap treatment by default instead of silently inheriting the expensive one.
  • Linux coverage paths rewritten to the analysis workspace, so Linux-produced coverage stops being silently dropped by Sonar's path matching. No-ops where there is no Linux report.
  • A SonarQube Cloud outage skips analysis instead of failing the build — probed before the Sonar caches and the scanner install, so nothing is fetched only to be thrown away. Never dressed up as a pass: no gate is produced and the check does not report. A blocking gate is held at the release, not at every pull request.

Same four jobs, same steps, same order.

Already merged and green: ktsu-dev/KtsuBuild#128 (live SonarCloud analysis, quality gate passed), ktsu-dev/Invoker#43 (all four matrix cells, macOS included), ktsu-dev/ImGuiApp#396 (where the blocking-gate fix was found and proven).

Built by anchored transforms that refuse to apply on a missing or ambiguous anchor; checked by 18 structural assertions over the parsed YAML, comment-stripped diffs against all five variants, and nine pwsh cases over both Sonar scripts capturing process exit codes and written $GITHUB_OUTPUT.

🤖 Generated with Claude Code

https://claude.ai/code/session_015qxqZVzN8CJcDxTb5gtWua


Generated by Claude Code

Every ktsu .NET repository carried its own copy of dotnet.yml and they had
drifted into five different files. This replaces the local copy with one
canonical workflow that is byte-identical in every repository, folding in the
drift rather than flattening it.

The drift, and where it went:

* macOS is back in the test matrix. It had been excluded org-wide because a
  macOS runner widened one repository's target frameworks to include a
  net10.0-ios head needing a workload this job does not install. That widening
  is now opt-in, so every other repository stops paying for it. UI test
  projects still run on Linux only, so a macOS cell stays cheap.
* The UI-test rule is now "Linux runs them, every other platform does not",
  rather than naming Windows, so a platform added later gets the cheap
  treatment by default instead of silently inheriting the expensive one.
* The Linux coverage report's paths are rewritten to this job's workspace
  before analysis. Sonar matches coverage to source by path, so a Linux-only
  suite's coverage was being dropped without a word. The step no-ops where
  there is no Linux report.
* The test and release jobs install the 8.0 and 9.0 runtimes alongside the
  pinned SDK, because test projects commonly multi-target every framework
  their library publishes and the test host needs those runtimes present.
  global.json still pins the SDK, so this only adds runtimes.
* Coverage exclusions are extensible per repository through the
  SONAR_COVERAGE_EXCLUSIONS_EXTRA variable, so a repository with a file that
  cannot be executed rather than one nobody has tested yet can say so without
  editing this file and making every other repository carry its paths.
* A SonarQube Cloud outage skips analysis instead of failing the build, and is
  never dressed up as a pass. Where the gate is blocking, an outage still fails.
* Stale comments explaining one repository's circumstances are rewritten to
  explain the shared rule, with the measurements kept and attributed.

Nothing in the pipeline's shape changed: the same jobs, the same steps, the
same order.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015qxqZVzN8CJcDxTb5gtWua

Copy link
Copy Markdown
Contributor Author

Test on macos-latest is failing, and this one is genuinely caused by this PR — or more precisely, exposed by it.

./Kilograms.gen.hpp:35:36: error: cannot default 'operator<=>' because type
  'std::partial_ordering' was not found; include <compare>
1 error generated.
ktsu.Schema.Cpp.Test.dll (net10.0|arm64) failed with 1 error(s)
ktsu.Schema.Cpp.Test.dll (net9.0|arm64)  failed with 1 error(s)

Schema.Cpp.Test compiles generated C++. Apple clang's libc++ does not transitively pull in <compare> the way libstdc++ and MSVC's STL do, so a header that defaults operator<=> has to include it explicitly. The generated header never did — it has simply never been compiled on macOS before, because the matrix had no macOS cell. Adding one is what surfaced it.

So the defect is real and pre-dates this PR; only its visibility is new. ubuntu and windows are green here, which is the tell: this is a portability gap in the generated output, not a regression.

The fix is one line in whatever emits Kilograms.gen.hpp — add #include <compare> to the generated header's include block, alongside whatever already brings in <cstdint>/<string>. It is correct on every platform (the standard requires that header for std::partial_ordering; the other STLs just happen to provide it transitively), so it needs no platform conditional.

I have not made that change here. This PR is a CI consolidation touching exactly one file, and turning it into a codegen change would widen it past what it claims to be. The codegen fix is better landed on its own, where it can be reviewed as the portability fix it is.

Two ways forward, your call:

  • Land the #include <compare> fix separately and this goes green on its own; or
  • If you would rather not run macOS in this repository, say so — but it would then be the only repository in the org whose workflow differs, which is the thing this change exists to end.

The rest of this PR is unaffected: the Sonar outage probe, the coverage-path rewrite and the extra runtimes all worked, and the quality gate passed.


Generated by Claude Code

@matt-edmondson
matt-edmondson merged commit 753b6b5 into main Sep 14, 2026
11 of 12 checks passed
@matt-edmondson
matt-edmondson deleted the claude/happy-rubin-w67sx1 branch September 14, 2026 06:57
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