Repository navigation
feat(dotnet): add dotnet-build and dotnet-format composite actions - #16
Conversation
Migrate the .NET overlay execution from medley into the platform as two single-owner composite actions, mirroring the python (ruff/pyright) and typescript (biome/tsc) slices. - dotnet-build: owns all semantic analysis — code-quality (CAxxxx via AnalysisMode=All), code-style (IDExxxx via EnforceCodeStyleInBuild), nullable, and compiler warnings, all as warnings-as-errors. Strict ruleset is the caller's copied Directory.Build.props + dotnet.globalconfig (discovered by MSBuild tree-walk), so the action carries no rule flags. - dotnet-format: owns whitespace/layout only, via `dotnet format whitespace --verify-no-changes`. The build owns IDE/CA, so the two never double-report. Both SHA-pin actions/setup-dotnet (v5.3.0), least-privilege, no PAT. Vendored modules/dotnet config copy + a minimal good fixture dogfood both lanes in ci.yml behind the ci-status gateway. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2679ea5adb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # analyzer (CA + IDE) diagnostics — so no rule flags are needed here. | ||
| # $PROJECT is unquoted so an empty value expands to nothing and the | ||
| # working-directory project/solution is built. | ||
| run: dotnet build $PROJECT --configuration "$CONFIGURATION" --nologo |
There was a problem hiding this comment.
When project contains a valid .NET path with spaces, such as src/My App/My App.csproj, this unquoted expansion is word-split into multiple argv entries. The dotnet build synopsis takes a single <PROJECT>|<SOLUTION> argument, so those consumers fail before the build runs; use a conditional args array instead of relying on unquoted empty expansion.
Useful? React with 👍 / 👎.
| # analyzers), so it never double-reports what the build enforces. | ||
| # --verify-no-changes exits non-zero on any file that is not already | ||
| # formatted. $PROJECT is unquoted so an empty value expands to nothing. | ||
| run: dotnet format whitespace $PROJECT --verify-no-changes |
There was a problem hiding this comment.
When project points at a project or solution path containing spaces, this unquoted expansion splits it before dotnet format sees it. The format command accepts one optional <PROJECT | SOLUTION> argument, so a valid path like src/My App/My App.sln is passed as multiple arguments and the formatting lane fails; build the argument list conditionally so the empty default still omits it.
Useful? React with 👍 / 👎.
## Summary WP-13 (Execution Plan: https://claude.ai/code/artifact/1f2e97bf-823a-4221-99df-b36e7a7f2a55). Closes decision #16, confirms #17 as still correctly a no-op (Decisions Log: https://claude.ai/code/artifact/232ecdce-8316-4880-8c0a-dc3c7dcf3a63). Generalizes `melodic-software/provisioning`'s `pr-body.yml` (decisions #58/#59, already built and verified this session) into a shared reusable workflow, mirroring `pr-title.yml`'s own history: a repo-specific implementation first, then a shared workflow other repos call. The ported logic is verbatim from provisioning's proven, working implementation — not rewritten — so behavior is identical: a native closing keyword (`Closes`/`Fixes`/`Resolves #N`, including `owner/repo#N`, or `"No linked issue"`) plus a non-empty `## Related` section, with HTML comments stripped first so an unedited PR template (whose instructional prose lives in comments) fails rather than passing vacuously. `provisioning`'s own `pr-body.yml` caller is untouched — its PR predates this workflow and isn't required to switch; its own file comment already flagged "wiring it into github-iac's ci-gate ruleset is a follow-up (out of scope for this repo)", which is exactly the shared-workflow path this PR opens for every other repo. **Deliberately not done here**, same shape as WP-2's `do-not-merge-gate` sequencing: rolling out per-repo callers (up to 9 `requires-ci` repos) and adding the `pr-issue-linkage / pr-issue-linkage` required check to `github-iac`'s `ci-gate` ruleset. Both need this PR's merge-commit SHA to pin to, and the ruleset entry specifically must not land before every caller exists and reports green, or open PRs across the org block on a check that never runs. Queued as explicit follow-up work. ## Verification - New `.github/scripts/pr-issue-linkage.test.cjs`: extracts the inline `actions/github-script` body (same technique used to verify the equivalent block ported into medley's `issue-labeling.yml` this session) and runs it in a `vm` sandbox against 9 cases: closing-keyword variants (Fixes/Resolves/past-tense/cross-repo), "No linked issue", missing-both failure naming both problems, an empty Related section, an unedited-template-still-fails proof, a commented-out closing keyword not counting, and case-insensitivity. All 9 pass — confirms the ported logic matches the original byte-for-byte in behavior. - `actionlint`: clean. - `markdownlint-cli2`, `lychee --offline`: clean on the README changes. - `typos`: clean on all 3 files. Opened as draft — leaving merge-ready work queued for review rather than merging autonomously.
What
Adds the .NET overlay execution to the platform as two single-owner composite actions, the final language slice in the dedup program (mirrors the python ruff/pyright and typescript biome/tsc slices).
dotnet-builddotnet build(strictness from the caller-suppliedDirectory.Build.props+dotnet.globalconfig)dotnet-formatdotnet format whitespace --verify-no-changesSingle owner per concern: the build owns all semantic rules,
dotnet format whitespaceowns whitespace — no double-reporting (IDE0055is held off the build, the direct analog of ruff ignoringE501because the formatter owns wrapping).Decomposition rationale
Re-derived from official docs + verified empirically on SDK 10.0.301, not ported from medley:
EnforceCodeStyleInBuildruns IDExxxx on build;EnableNETAnalyzers+AnalysisMode=Allruns CAxxxx;TreatWarningsAsErrorsescalates both compiler and analyzer warnings to errors (confirmed: CA1812/CA1051/CA1822 + IDE0008/0040/0161/1006 all fire as errors on a bad fixture; a clean modern library passesAll).dotnet format whitespaceruns only the formatting fixers (no IDE/CA), so it cannot double-report the build's rules.LangVersion/TargetFrameworkomitted from the shared base (runtime floor stays consumer-supplied; Microsoft discouragesLangVersion=latest).Wiring & posture
actions/setup-dotnetSHA-pinned tov5.3.0; least-privilege (contents: read), no PAT.modules/dotnet/{Directory.Build.props,dotnet.globalconfig}+ a minimal good fixture dogfood both lanes inci.ymlbehind theci-statusgateway.bin//obj/added to.gitignore.The canonical config ships in
standards/modules/dotnet; the follow-up standards PR references these actions by merged SHA.🤖 Generated with Claude Code