Skip to content

Make ProjectTemplates replacement incremental - #19413

Open
Clint Rutkas (crutkas) wants to merge 2 commits into
microsoft:mainfrom
crutkas:crutkas-incremental-template-replacement
Open

Make ProjectTemplates replacement incremental#19413
Clint Rutkas (crutkas) wants to merge 2 commits into
microsoft:mainfrom
crutkas:crutkas-incremental-template-replacement

Conversation

@crutkas

@crutkas Clint Rutkas (crutkas) commented Aug 15, 2026

Copy link
Copy Markdown
Member

Description

ProjectTemplates replacement currently runs after every Build, even when neither the template inputs nor replacement values changed. This makes the response-file preparation stable and the replacement target incremental while preserving generated and packaged output.

Summary

  • Split stable response-file preparation from template replacement.
  • Make replacement incremental across template, project, localization, script, and every replacement-value change.
  • Invalidate through Clean, Rebuild, and missing generated output while preserving response-file, Pack, Windows catalog ordering, and error semantics.
  • Add focused cross-platform regression coverage.

Performance

  • HOBL matched warm whole-solution evidence on x64: Windows mean 77.761883s -> 73.405682s, 5.6% faster; baseline/candidate ratio 1.059344, 95% CI 1.025741..1.093331.
  • WSL mean 51.938818s -> 51.887158s; ratio 1.000996, 95% CI 0.904533..1.084117, so no confirmed regression.
  • Cold results were single-pair and neutral, so no cold performance claim is made.
  • This is x64 evidence. ARM64 performance remains a separate hardware gate.

Validation

  • Windows focused regression and production Clean, Build, unchanged Build, Rebuild, and Pack smoke tests.
  • WSL-native focused test passed 1/1, plus production Clean, Build, unchanged Build, Pack, changed replacement value/input, long response file, and failure propagation coverage.
  • Generated and packaged content matched exactly: 314 Windows entries including the catalog and 313 Linux entries, with no remaining replacement tokens.
  • Formatting and diff checks passed, the branch is clean, and final independent review found no significant issues.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: dc0484d6-320c-4c18-9839-70a7b13332f3
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: dc0484d6-320c-4c18-9839-70a7b13332f3
Copilot AI balanced review requested due to automatic review settings August 15, 2026 07:57
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19413

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19413"

@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Makes ProjectTemplates replacement incremental while preserving generated and packaged outputs.

Changes:

  • Separates response-file preparation from replacement.
  • Adds stamp-based invalidation for changed inputs, missing outputs, Clean, and Rebuild.
  • Adds regression coverage for generation and packaging behavior.
Show a summary per file
File Description
src/Aspire.ProjectTemplates/Aspire.ProjectTemplates.csproj Implements incremental template replacement and invalidation.
tests/Infrastructure.Tests/ProjectTemplates/ProjectTemplatesIncrementalBuildTests.cs Tests replacement, rebuilding, cleaning, failure, and packaging scenarios.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +263 to +265
if (OperatingSystem.IsWindows())
{
Assert.Contains("aspire-templates.cat", packagedTemplates);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants