chore(build): centralize the shared build properties in Directory.Build.props - #647
Conversation
…ld.props Four .csproj files each declared ImplicitUsings, Nullable and TreatWarningsAsErrors by hand, and they had drifted: Daqifi.Mcp, the only shipped tool in the repo, never opted in to TreatWarningsAsErrors, so a new warning there built green. Move those three properties to a repo-root Directory.Build.props and delete the per-project copies. TargetFramework(s) is deliberately left alone - the projects genuinely differ and a shared default would hide that (issue #643). Also move the CA2007 .editorconfig to the repo root, scoped to [src/Daqifi.Core/**.cs] so the library keeps the rule and test projects keep their documented exemption, and add DirectoryBuildPropsTests to fail the build if a project ever redeclares a centralized property again. closes #638 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
/agentic_review |
PR Summary by QodoCentralize shared MSBuild properties via root Directory.Build.props
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1.
|
MSBuild property names are case-insensitive, so <nullable> overrides the centralized <Nullable> just as an exact-case redeclaration would. The drift guard compared them with StringComparer.Ordinal and would have let that through. Use an OrdinalIgnoreCase HashSet, and add a test that pins the comparer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Good catch on the case-sensitivity — conceded and fixed in 11fb0c8. MSBuild property names are case-insensitive, so Verified rather than assumed: adding On the alternative approaches: agreed that a Full suite re-run green on both frameworks: net9.0 3821 Core + 217 MCP, net10.0 3821 Core. |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 11fb0c8 |
|
Qodo round 2 is clean on head Ready for review — not merging. |
What was wrong
The repo had no
Directory.Build.props, so all four project files declared the same three build settings by hand — and they had already drifted apart.Daqifi.Mcp, the MCP server we publish as adotnet tool, was the only project in the repo withoutTreatWarningsAsErrors. Every other project, includingDaqifi.Mcp's own test project, treats warnings as errors; the shipping tool did not, so a new compiler warning inDaqifiAgent.csorTools/DaqifiTools.cswould have built green and shipped. Nothing prevented the next drift either: each new project starts life as a copy-paste of the previous one'sPropertyGroup, and any repo-wide decision has to be remembered in four places.How it was fixed
ImplicitUsings,NullableandTreatWarningsAsErrorsnow live once in a rootDirectory.Build.props, and the per-project copies are gone. That closes theDaqifi.Mcpgap as a side effect — it was already warning-clean in both Debug and Release, so nothing had to be fixed to turn the flag on. The CA2007.editorconfigmoves to the repo root as well, with its section changed from[*.cs]to[src/Daqifi.Core/**.cs]so the library keeps the rule and the test-project exemption documented inCONTRIBUTING.mdsurvives verbatim; the root is simply where a repo-wide rule can now go (which is what #484 will need).Two things a reviewer might expect and won't find, both deliberate:
TargetFramework(s)is not centralized.Daqifi.Coremulti-targetsnet9.0;net10.0andDaqifi.Mcpisnet9.0only. That is a real asymmetry with a user-visible consequence (a .NET 10-only machine cannot rundotnet tool install -g Daqifi.Mcpwithout also installing .NET 9), but resolving it changes what the released package contains, which does not belong in a no-behavior-change cleanup. It is now filed as chore(build): decide whether Daqifi.Mcp should multi-target net9.0;net10.0 like Daqifi.Core #643 and referenced from a comment next to theTargetFrameworkline in both MCP projects, so it is a recorded decision rather than an omission.Daqifi.Coresets license, project URL, repository URL, tags and SourceLink;Daqifi.Mcpsets none of them. OnlyAuthorsis genuinely common, so hoisting the rest would have silently rewritten the publishedDaqifi.Mcppackage's metadata. Filed as chore(build): the published Daqifi.Mcp package has no license, project URL, repository URL, tags, or SourceLink #644.Verification
dotnet msbuild <csproj> -getProperty:<Name>for all ten (project, target-framework) pairs, onorigin/mainand on this branch with restore warm on both sides, and diffed. The only difference anywhere isDaqifi.Mcp'sTreatWarningsAsErrors:false→true..ConfigureAwait(false)inTcpStreamTransport.csfails the build witherror CA2007, and the test projects — which contain plenty of nakedawaits — still build clean.daqifi-core-example-appbuilds and runs against this branch'sDaqifi.Core, and streamed for 5 s from a real Nyquist over/dev/cu.usbmodem1101.New tests (
DirectoryBuildPropsTests) fail the build if any project redeclares a property thatDirectory.Build.propsowns, which is the exact regression that produced this issue. They were confirmed to fail when the drift is reintroduced.closes #638
Not merging — for review.