Skip to content

Fail the build when a template fails to build - #524

Merged
danielchalmers merged 2 commits into
devfrom
fix/template-build-failures-are-fatal
Oct 10, 2026
Merged

danielchalmers merged 2 commits into
devfrom
fix/template-build-failures-are-fatal

Conversation

@danielchalmers

@danielchalmers danielchalmers commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

InstallAndBuildAllTemplates.ps1 runs 52 dotnet commands and never checks an exit code between them. A non-zero exit from a native command is not a PowerShell error, so $ErrorActionPreference does not catch it, and the step's exit code is whatever the last command returned.

If InteractivityServer_Auth breaks at permutation 5 of 26, WasmStandalone_CallsWebApi succeeding at the end still turns the job green.

The last 30 mudblazor-ci runs are 30/30 success. For a workflow that compiles 26 generated projects with /warnaserror against a moving MudBlazor dependency, that record is more suspicious than reassuring.

InstallAndBuildAllTemplates.ps1 runs 52 dotnet commands and never checks an
exit code between them. A non-zero exit from a native command is not a
PowerShell error, so the script runs to the end regardless, and the step
reports the exit code of the last build only.

A template breaking anywhere except the final permutation therefore leaves
mudblazor-ci green. The last 30 runs have all passed.

Setting ErrorActionPreference and PSNativeCommandUseErrorActionPreference
makes the first failing dotnet command terminate the script.
@danielchalmers

danielchalmers commented Jul 27, 2026 •

Copy link
Copy Markdown
Member Author

Holding this until the SQLitePCLRaw advisory is resolved upstream.

#525 proposed pinning the package in the template; that was closed in favour of waiting for EF Core, since the pin would become stale as soon as upstream moves.

@danielchalmers

danielchalmers commented Oct 10, 2026 •

Copy link
Copy Markdown
Member Author

The SQLitePCLRaw hold is cleared, so this is ready to merge.

  • The Sqlite auth templates reference Microsoft.EntityFrameworkCore.Sqlite 10.*, which now resolves to EF Core 10.0.12 and SQLitePCLRaw 2.1.12.
  • dotnet list package --vulnerable --include-transitive reports no vulnerable packages for that graph, and the repo has no audit suppressions, so the fix came from upstream, which is what closing Resolve the SQLitePCLRaw advisory in the Sqlite auth templates #525's pin in favour of waiting for EF Core was for.
  • mudblazor-ci passes on 2b52106 with this script, which now fails on the first non-zero dotnet exit, so all 25 template permutations build under /warnaserror.

@danielchalmers
danielchalmers merged commit 8b00450 into dev Oct 10, 2026
4 checks passed
@ScarletKuro
ScarletKuro deleted the fix/template-build-failures-are-fatal branch October 11, 2026 11:22
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.

1 participant