Repository navigation
Document and repair local template validation - #68899
Merged
Merged
Conversation
javiercn
force-pushed
the
javiercn-template-validation-guidance
branch
from
September 1, 2026 10:38
aa88251 to
fda686c
Compare
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 740028aa-f9af-4e33-831a-425d403b0ab3
javiercn
force-pushed
the
javiercn-template-validation-guidance
branch
from
September 1, 2026 13:32
fda686c to
868b9bf
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the ProjectTemplates local-validation workflow by consolidating all Run-*-Locally.ps1 entry points onto a single fail-fast PowerShell module helper and by expanding the ProjectTemplates documentation/guidance so contributors can reliably validate generated application behavior (not just packaging).
Changes:
- Replaced the legacy
Test-Template.ps1approach with a reusableTest-Template.psm1module that repacks, (re)installs, generates, patches imports, and publishes templates in a consistent way. - Updated all local runner scripts to import the module and to use explicit argument arrays (and standardized options like
--aot,--minimal, etc.). - Added/expanded ProjectTemplates guidance and documentation to distinguish package-only validation vs. full product/package graph + generated-app validation workflows.
File summaries
| File | Description |
|---|---|
| src/ProjectTemplates/scripts/Test-Template.psm1 | New consolidated helper that validates prerequisites, repacks/reinstalls templates, patches imports, and publishes generated apps. |
| src/ProjectTemplates/scripts/Test-Template.ps1 | Removed legacy helper script superseded by the module. |
| src/ProjectTemplates/scripts/Run-WorkerProgramMain-Locally.ps1 | Switched to importing Test-Template.psm1 and passing structured args. |
| src/ProjectTemplates/scripts/Run-WorkerNativeAot-Locally.ps1 | Uses module + publish args for win-x64/AOT scenario. |
| src/ProjectTemplates/scripts/Run-Worker-Locally.ps1 | Uses module + structured args. |
| src/ProjectTemplates/scripts/Run-WebApiProgamMainMinimal-Locally.ps1 | Uses module + structured args for Program.Main + minimal APIs variant. |
| src/ProjectTemplates/scripts/Run-WebApiProgamMain-Locally.ps1 | Uses module + structured args for Program.Main variant. |
| src/ProjectTemplates/scripts/Run-WebApiMinimal-Locally.ps1 | Uses module + long-form --minimal arg. |
| src/ProjectTemplates/scripts/Run-WebApiAotProgramMain-Locally.ps1 | Uses module + publish args for win-x64 AOT Program.Main variant. |
| src/ProjectTemplates/scripts/Run-WebApiAot-Locally.ps1 | Uses module + publish args for win-x64 AOT variant. |
| src/ProjectTemplates/scripts/Run-WebApi-Locally.ps1 | Uses module + structured args. |
| src/ProjectTemplates/scripts/Run-StarterwebProgramMain-Locally.ps1 | Uses module + structured args for MVC Program.Main + auth variant. |
| src/ProjectTemplates/scripts/Run-Starterweb-Locally.ps1 | Appends remaining args and uses module-based helper. |
| src/ProjectTemplates/scripts/Run-RazorProgramMain-Locally.ps1 | Normalized to pwsh, added strict mode/error preference, and uses module helper. |
| src/ProjectTemplates/scripts/Run-Razor-Locally.ps1 | Appends remaining args and uses module-based helper. |
| src/ProjectTemplates/scripts/Run-McpServer-Locally.ps1 | Uses module helper with MCP template package/project paths + publish args. |
| src/ProjectTemplates/scripts/Run-GrpcNativeAot-Locally.ps1 | Uses module + publish args for win-x64 AOT variant. |
| src/ProjectTemplates/scripts/Run-gRPC-Locally.ps1 | Uses module + structured args. |
| src/ProjectTemplates/scripts/Run-EmptyWebProgramMain-Locally.ps1 | Uses module + structured args for Program.Main variant. |
| src/ProjectTemplates/scripts/Run-EmptyWeb-Locally.ps1 | Uses module + structured args. |
| src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 | Uses module helper; forwards remaining args and -NoRestore. |
| src/ProjectTemplates/scripts/Run-BlazorWasmServiceDefaults-Locally.ps1 | Forwards remaining args and uses module helper for service-defaults template. |
| src/ProjectTemplates/scripts/Run-BlazorWasmProgramMain-Locally.ps1 | Uses module helper and structured args (Program.Main variant). |
| src/ProjectTemplates/scripts/Run-BlazorWasm-Locally.ps1 | Uses module helper; forwards remaining args and -NoRestore. |
| src/ProjectTemplates/README.md | Expanded step-by-step local build + generated-app validation workflow and clarified prerequisites (including WiX). |
| src/ProjectTemplates/README-BASELINES.md | Updated baseline workflow to reference the new README workflow + local scripts. |
| src/ProjectTemplates/AGENTS.md | Added ProjectTemplates-specific preflight and validation-boundary guidance for contributors/agents. |
| .github/instructions/project-templates.instructions.md | Hooks ProjectTemplates-specific guidance into GitHub Copilot instructions for that folder. |
| .github/copilot-instructions.md | Adds guidance about reporting blocked automated tests and the fallback validation boundary used. |
Review details
- Files reviewed: 29/29 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 740028aa-f9af-4e33-831a-425d403b0ab3
wtgodbe
approved these changes
Sep 1, 2026
Member
Author
|
/ba-g got stuck |
1 task done
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Run-*-Locally.ps1entry points on one fail-fast helper and remove stale package versions/optionsTemplates.Testspreparation, and application-boundary validationThis follow-up was originally developed from the validation evidence for #68898, which is now merged into
main.Bootstrap validation evidence
The ProjectTemplates area pack produced the four template nupkgs but not the runtime archive, complete Shipping/NonShipping package graph, or generated
Templates.Testsimports required by locally generated applications. Direct delayed-project selection requiredOnlyTestProjectTemplates=true. On Windows,-NoBuildInstallersexcluded installer projects but runtime/ref packs still invokedwix.exe; applyingGenerateInstallers=falseto that full graph removed a target those packs still expected. A missing local source had to be fixed by running its producer, not by creating an empty directory.The script audit also found legacy Debug-only paths, exact
11.0.0-devpackage filenames, a bare ambiguousdotnet pack, removed template options (--hosted,-aot, and-minimal), multi-RID restore failures for MCP/native-AOT variants, and a same-shell rerun failure after the helper prepended its isolated SDK.Validation
Templates.Testsproducer build succeeded withOnlyTestProjectTemplates=true,GenerateInstallers=false, and-NoBuildDepsdotnet new --dry-run/weatherforecastresultsinitializeexchangegit diff --checkThe full product pack produced the package graph, runtime archive, and test inputs used above, but the overall repository build later stopped because
wix.exewas unavailable on this machine; the README now names that Windows prerequisite.