From 20d163ac1dec1bfd211834aa01722ef9cef6cf7b Mon Sep 17 00:00:00 2001 From: Dan Moisan Date: Sat, 18 Jul 2026 19:20:17 -0400 Subject: [PATCH] ci(nullable-gate): use /t:Rebuild to stop the nullable gate from silently no-op'ing The "Build with nullable warnings treated as errors" step ran /t:Build immediately after "Build with analyzers" had already compiled everything under the projects' own Nullable settings. MSBuild's incremental up-to-date check does not invalidate on a changed -p:Nullable command-line property alone, so this step was silently skipping recompilation and never actually enforcing the gate -- it reliably passed in a few seconds regardless of the code's real nullable-safety state. Switching to /t:Rebuild forces a genuine full recompile under /p:Nullable=enable every run. This is expected to surface a large body of pre-existing nullable debt across UtilitiesCS (confirmed locally: ~2131 errors on main itself, unrelated to any pending PR's changes) that this gate was never actually catching. Remediating that debt is tracked separately; this change only makes the gate report the true state. --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bebe41e..7603dcf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,7 +103,13 @@ jobs: - name: Build with nullable warnings treated as errors shell: pwsh run: | - & msbuild $env:SOLUTION_PATH /t:Build /m /p:Configuration=Debug ` + # Use /t:Rebuild (not /t:Build) so this step always performs a genuine full + # recompile under /p:Nullable=enable. The preceding "Build with analyzers" + # step already compiled everything under the projects' own Nullable settings; + # MSBuild's incremental up-to-date check does not invalidate on a changed + # -p:Nullable command-line property alone, so a plain /t:Build here would + # silently skip recompilation and never actually enforce this gate. + & msbuild $env:SOLUTION_PATH /t:Rebuild /m /p:Configuration=Debug ` "/p:Platform=Any CPU" ` /p:Nullable=enable /p:TreatWarningsAsErrors=true if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }