|
44 | 44 |
|
45 | 45 | <!-- |
46 | 46 | Dependabot anchors for the packages bundled by MSTest.Sdk (Microsoft.Playwright.MSTest.v4, |
47 | | - Aspire.Hosting.Testing). The Aspire entry doubles as the download that stages its nupkg for |
48 | | - test assets (see CopyNuGetPackagesForTestAssets below); the Playwright entry is the Dependabot |
49 | | - anchor only. These packages are baked into the shipped SDK templates (Sdk/Features/*.targets) |
50 | | - and are otherwise referenced only there (which Dependabot doesn't restore), so without a |
51 | | - graph-visible reference from a repo project their Central Package Management PackageVersion |
52 | | - entries in Directory.Packages.props are "orphans" that Dependabot ignores (it only updates |
53 | | - package versions that are actually referenced by a restored project). |
| 47 | + Aspire.Hosting.Testing). These are baked into the shipped SDK templates (Sdk/Features/*.targets) |
| 48 | + and are otherwise referenced only there (which Dependabot doesn't restore), so their Central |
| 49 | + Package Management PackageVersion entries in Directory.Packages.props are "orphans" that |
| 50 | + Dependabot ignores unless a project references them. |
54 | 51 |
|
55 | | - We use PackageDownload (NOT a PackageReference with ExcludeAssets="all") deliberately: |
56 | | - ExcludeAssets="all" removes the reference from the dependency graph Dependabot reads, so the |
57 | | - package stays invisible to it and never gets bumped (Aspire only kept updating because it ALSO |
58 | | - had this PackageDownload; the equivalent Playwright anchor with ExcludeAssets="all" silently did |
59 | | - nothing, see #9362). PackageDownload puts the package into the restore (so Dependabot proposes |
60 | | - bumps) without flowing any of its assets (compile/runtime/build, e.g. Playwright's browser |
61 | | - install) into this test project. The _ValidateBundledSdkFeatureVersions target in |
62 | | - Directory.Packages.props then guards the matching version properties (MicrosoftPlaywrightVersion, |
63 | | - AspireHostingTestingVersion) against drift after a bump. |
| 52 | + The PackageReference (with ExcludeAssets="all") is the Dependabot ANCHOR: Dependabot reads the |
| 53 | + PackageReference XML node to discover the dependency and bump its CPM PackageVersion. |
| 54 | + ExcludeAssets="all" only stops the package's assets (compile/runtime/build, e.g. Playwright's |
| 55 | + browser install) from flowing into this test project - it does NOT hide the reference from |
| 56 | + Dependabot. A PackageDownload does NOT work as the anchor: Dependabot does not read |
| 57 | + PackageDownload items at all (dependabot/dependabot-core#2502). Using PackageDownload as the |
| 58 | + anchor is exactly why Playwright silently stopped updating - see #9362 / #9452. |
| 59 | +
|
| 60 | + Dependabot only bumps the literal PackageVersion in Directory.Packages.props, not the matching |
| 61 | + *Version property the build consumes; the _ValidateBundledSdkFeatureVersions target in |
| 62 | + Directory.Build.targets fails the build if the two drift apart, so a maintainer reconciles the |
| 63 | + property in the Dependabot PR. |
64 | 64 | --> |
| 65 | + <ItemGroup> |
| 66 | + <PackageReference Include="Aspire.Hosting.Testing" ExcludeAssets="all" /> |
| 67 | + <PackageReference Include="Microsoft.Playwright.MSTest.v4" ExcludeAssets="all" /> |
| 68 | + </ItemGroup> |
| 69 | + |
| 70 | + <!-- Packages needed to stage nupkgs for the generated test assets (see |
| 71 | + CopyNuGetPackagesForTestAssets below) but that we don't want to reference. --> |
65 | 72 | <ItemGroup> |
66 | 73 | <PackageDownload Include="Aspire.Hosting.Testing" Version="[$(AspireHostingTestingVersion)]" /> |
67 | | - <PackageDownload Include="Microsoft.Playwright.MSTest.v4" Version="[$(MicrosoftPlaywrightVersion)]" /> |
68 | 74 | </ItemGroup> |
69 | 75 |
|
70 | 76 | <Target Name="CopyNuGetPackagesForTestAssets" BeforeTargets="BeforeBuild"> |
|
0 commit comments