Skip to content

Centralize .NET Build and Package Configuration per the Fleet - #589

Merged
ptr727 merged 3 commits into
developfrom
feature/dotnet-fleet-conformance
Sep 26, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/dotnet-fleet-conformance

Conversation

@ptr727

@ptr727 ptr727 commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Conforms the .NET projects to the fleet's dotnet-codestyle rules, a finding the resync in #588 left open.

  • Directory.Build.props at the root carries the shared properties: TargetFramework, LangVersion, Nullable, the full analyzer set (AnalysisLevel latest-all, AnalysisMode All), TreatWarningsAsErrors, and IsPackable. Of those, AnalysisMode All and TreatWarningsAsErrors are new to this repo, and the build is clean under both.
  • Directory.Packages.props enables central package management and declares every version once. Both .csproj files now carry versionless PackageReference items, and every name and version carries over unchanged. Dependabot's NuGet entry already reads from /.
  • CreateMatrix.csproj is IsAotCompatible for every build. VerifyReferenceAotCompatibility stays scoped to an AOT publish, the shape PhotoCleaner uses, because System.CommandLine, the Serilog enricher and sink, and the assemblies Microsoft.Extensions.Http.Resilience brings in are not built as AOT-compatible. In that configuration IL3058 stays a warning, so the documented -p:PublishAot=true publish still produces the native binary. The skill's own text states the verification as unconditional, which fails with these dependencies, and that is filed at the source as Scope VerifyReferenceAotCompatibility to an AOT Publish in dotnet-codestyle ProjectTemplate#1857.
  • NxWitness.slnx lists the two props files, and CODESTYLE.md "NxWitness .NET Conventions" records the AOT scoping.

With TreatWarningsAsErrors on, a NuGet audit advisory against any direct or transitive dependency now fails restore until a Dependabot bump lands. That matches every conformant fleet repo, none of which exempts NU1901-NU1904.

Local verification: dotnet build with 0 warnings and 0 errors, dotnet format style --verify-no-changes --severity=info and CSharpier clean, all 21 tests passing (test executable run directly), the AOT publish producing its binary, and markdownlint and the prose gate clean. Three adversarial local review rounds, the last with no findings.

🤖 Generated with Claude Code

ptr727 and others added 3 commits September 25, 2026 20:10
Move the shared project properties into a root Directory.Build.props,
adding AnalysisMode All and TreatWarningsAsErrors, and move every
package version into a root Directory.Packages.props with central
package management, leaving each PackageReference versionless.

Mark CreateMatrix IsAotCompatible for every build. Reference
verification stays scoped to an AOT publish, since System.CommandLine,
the Serilog sinks, and the Polly assemblies are not built as
AOT-compatible and verifying them fails every build with IL3058.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The AOT publish CODESTYLE.md documents failed once warnings became
errors, since reference verification raises IL3058 for dependencies not
built as AOT-compatible. Keep IL3058 a warning in that configuration and
correct the dependency list the note gives.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 26, 2026 03:14
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: e2349502-cd83-4c2d-81ec-f95fc062da93

📥 Commits

Reviewing files that changed from the base of the PR and between 4eee589 and a601f4d.

📒 Files selected for processing (6)
  • CODESTYLE.md
  • CreateMatrix/CreateMatrix.csproj
  • CreateMatrixTests/CreateMatrixTests.csproj
  • Directory.Build.props
  • Directory.Packages.props
  • NxWitness.slnx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.01%. Comparing base (4eee589) to head (a601f4d).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #589   +/-   ##
========================================
  Coverage    57.01%   57.01%           
========================================
  Files           15       15           
  Lines         1375     1375           
  Branches       108      108           
========================================
  Hits           784      784           
  Misses         573      573           
  Partials        18       18           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes consistently centralize build and package configuration without introducing inconsistencies across the two projects or contradicting the documented AOT publish approach.

Review effort: Lite
Findings: None

What changed in this PR

Centralizes the repository’s .NET build and NuGet package configuration into root-level Directory.Build.props and Directory.Packages.props, aligning both projects with the fleet’s “central props + central package management” model while preserving the repo’s opt-in AOT publish behavior.

Changes:

  • Added root Directory.Build.props to standardize target framework, analyzers, nullable, and warnings-as-errors policy.
  • Added root Directory.Packages.props to enable Central Package Management and consolidate all NuGet versions.
  • Simplified both .csproj files to inherit shared configuration and use versionless PackageReference, with AOT compatibility handling scoped to AOT publish.
File Description
NxWitness.slnx Adds the new central props files to solution items for discoverability.
Directory.Packages.props Enables central package management and defines all package versions once.
Directory.Build.props Centralizes shared .NET build/analyzer configuration and warnings-as-errors policy.
CreateMatrixTests/​CreateMatrixTests.csproj Removes duplicated build properties and switches to versionless package references.
CreateMatrix/​CreateMatrix.csproj Removes duplicated build properties, switches to versionless package references, and scopes IL3058 to remain a warning during AOT publish.
CODESTYLE.md Documents the repo’s AOT publish scoping and rationale alongside other NxWitness .NET conventions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727
ptr727 merged commit 54e66f5 into develop Sep 26, 2026
15 checks passed
@ptr727
ptr727 deleted the feature/dotnet-fleet-conformance branch September 26, 2026 03:18
ptr727 added a commit that referenced this pull request Sep 26, 2026
Promotes `develop` at `54e66f5` to `main`:

- #588, which resyncs the instruction set and the carried Skills tree
with the hub.
- #589, which centralizes the .NET build and package configuration per
the fleet.
- The Dependabot bumps merged on `develop` since the last promotion.

It is opened from a branch off `main` rather than from `develop`,
because both project files conflicted. `develop` moved their versions
into `Directory.Packages.props`, while `main` took the same Dependabot
bumps inline. Every version `main` carries equals the one
`Directory.Packages.props` declares, and every property it keeps moved
to `Directory.Build.props` with the same value. So the resolution takes
`develop`'s side, and the merged tree is byte-identical to `develop`
(`git diff 54e66f5 HEAD` is empty). The workflow action bumps `main`
took directly are already on `develop`, so nothing `main`-only is
dropped.

Merge with `--merge`, per the promotion convention.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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