Repository navigation
Invalidate generated source cache on MSBuild task updates - #10082
Conversation
Include the MSBuild task assembly content hash in both generated-source cache keys so package updates regenerate stale entry point and extension files. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16fa9e8a-ead7-4ccd-b30e-12b4c96dfd43
There was a problem hiding this comment.
Pull request overview
Fixes stale generated sources after MSBuild task updates by incorporating the task assembly hash into generation caches.
Changes:
- Hashes the MSBuild task assembly for both source-generation caches.
- Adds acceptance coverage for regeneration and subsequent incremental builds.
- Avoids hashing when generation is disabled.
Show a summary per file
| File | Description |
|---|---|
Microsoft.Testing.Platform.MSBuild.targets |
Adds task assembly hash to cache inputs. |
MSBuildTests.GenerateEntryPoint.cs |
Tests regeneration after an in-place task update. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Medium
This comment has been minimized.
This comment has been minimized.
Evaluate source-generation flags before guarding file hashing, and keep each generator's calculation path independent. Cover self-registration-only task updates. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16fa9e8a-ead7-4ccd-b30e-12b4c96dfd43
🧪 Test quality grade — PR #10082
This advisory comment was generated automatically. Grades are heuristic Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
|
IMHO could be solved with just <_GenerateTestingPlatformEntryPointInputsCacheToHash Include="$(MicrosoftTestingPlatformMSBuildTaskFolder)" />and <_GenerateSelfRegisteredExtensionsInputsCacheToHash Include="$(MicrosoftTestingPlatformMSBuildTaskFolder)" />no need for hashing. Restore put different versions in different version-spamped directories. |
|
Thanks for the suggestion. Using the versioned folder would fix the reported NuGet upgrade scenario, but The DLL is only ~165 KiB and hashing it costs roughly 0.5 ms, once per relevant project build. We therefore prefer the content hash because it provides reliable invalidation without relying on package-layout or timestamp assumptions. |
|
/backport to rel/4.3 |
|
Started backporting to rel/4.3: https://github.com/microsoft/testfx/actions/runs/29831541299 |
in #10082 (backport to rel/4.3) (#10111) Co-authored-by: Amaury Levé <[email protected]>
Fixes #10056.
Summary
Microsoft.Testing.Platform.MSBuild.dllcontent hash in entry-point and self-registered-extension cache keysValidation
GeneratedSourcesAreRegeneratedWhenMSBuildTaskChanges