Skip to content

azurevoodoo/RenovateMSBuildSDKPRFix

Repository files navigation

Renovate MSBuild SDK PR fix — sample scenarios

Minimal fixtures to verify the nuget manager handles MSBuild SDK dependencies without a regex customManagers workaround.

Each folder exercises one extraction path. All use outdated SDK versions that Renovate should propose upgrading.

Scenarios

Folder What it tests
01-sqlproj-sdk-element <Sdk Name="..." Version="..." /> in .sqlproj (SSDT)
02-csproj-sdk-element <Sdk Name="..." Version="..." /> in .csproj
03-csproj-project-sdk-attribute <Project Sdk="name/version">
04-csproj-import-sdk <Import Sdk="..." Version="..." />
05-global-json-msbuild-sdks global.jsonmsbuild-sdks
06-package-reference-regression Sdk + PackageReference in the same file (Sdk uses hybrid semver; PackageReference unchanged)

Upstream fix (summary)

MSBuild SDK Version values are exact pins, but default NuGet versioning treats bare versions as minimum ranges (>=), so preview pins like 0.1.19-preview resolve to the latest release and skip updates.

The fix:

  • Adds .sqlproj to default nuget managerFilePatterns
  • Applies applyMsbuildSdkVersioning() at extract time: strict semver when the pin is valid semver, otherwise semver-coerced for non-standard NuGet version strings (e.g. four-segment revisions)

Test with Renovate

Local fork (recommended)

From a Renovate checkout that includes the MSBuild SDK fix:

pnpm start -- azurevoodoo/RenovateMSBuildSDKPRFix --dry-run=full --git-author="Your Name <you@users.noreply.github.com>"

Live run (creates/updates PRs):

pnpm start -- azurevoodoo/RenovateMSBuildSDKPRFix --pr-concurrent-limit=0 --pr-hourly-limit=0 --git-author="Your Name <you@users.noreply.github.com>"

Expected (with fix)

  • 7 nuget files matched → 6 package files, 7 dependencies
  • msbuild-sdk deps show versioning: semver for the pins in this repo (all valid semver)
  • Non-empty updates for outdated SDKs (e.g. Microsoft.Build.Sql 0.1.x-preview2.2.0, Microsoft.Build.NoTargets 3.4.03.7.134)
  • 2 PR branches: renovate/microsoft.build.sql-2.x, renovate/microsoft.build.notargets-3.x
  • PackageReference in 06 still uses nuget versioning at lookup (no versioning on extract)

Without the fix

  • Sdk deps get versioning: nuget, currentVersion resolves to latest, and updates: [] for preview pins like 0.1.19-preview
  • .sqlproj files are not scanned unless nuget.managerFilePatterns is configured

Verified PRs

Example PRs created from a forked Renovate build against this repo:

  • PR #1Microsoft.Build.NoTargets 3.4.0 → 3.7.134 (scenarios 02–04)
  • PR #2Microsoft.Build.Sql 0.1.x-preview → 2.2.0 (scenarios 01, 05, 06)

Packages used

  • Microsoft.Build.Sql — SSDT SQL projects; old 0.1.x-preview versions vs current 2.x on nuget.org
  • Microsoft.Build.NoTargets — SDK-style projects; 3.4.0 is intentionally old
  • Microsoft.Data.SqlClient — ordinary PackageReference in the regression scenario

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors