Skip to content

Align AI.ML sample version with WindowsAppSDK.ML wrapper - #677

Open
v-goradojcic wants to merge 1 commit into
mainfrom
user/v-goradojcic/align-aiml-version-with-ml-wrapper
Open

v-goradojcic wants to merge 1 commit into
mainfrom
user/v-goradojcic/align-aiml-version-with-ml-wrapper

Conversation

@v-goradojcic

Copy link
Copy Markdown
Contributor

Problem

UpdateVersions.ps1 updates package versions when the Samples are validated against an experimental WindowsAppSDK build, but Microsoft.Windows.AI.MachineLearning is not currently updated.

The managed WindowsML samples therefore keep their committed public baseline version (2.3.42) even when the resolved Microsoft.WindowsAppSDK.ML wrapper declares a higher AI.ML minimum.

This causes NU1605 during Aggregator BuildSampleApps.

Fix

Use the already-resolved Microsoft.WindowsAppSDK.ML package version from the existing package-version harvest, locate that exact wrapper nuspec, read its Microsoft.Windows.AI.MachineLearning dependency lower bound, and use that value when rewriting the Samples package versions for validation.

The committed Samples version remains unchanged for normal/public use.

Validation

  • Tested against the real Microsoft.WindowsAppSDK.ML 2.5.62-dev nuspec.
  • Current transport rewrites AI.ML 2.3.42 -> 2.5.62-dev.
  • Post-windows-ml-fix metadata [2.5.77-rc, 3.0.0) rewrites to 2.5.77-rc.
  • Wrapper-without-AI.ML and wrapper-absent scenarios leave the committed pin untouched.
  • Unrelated package versions remain unchanged.
  • PowerShell parses cleanly.

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates UpdateVersions.ps1 so managed WindowsML samples pin Microsoft.Windows.AI.MachineLearning to the minimum required by the resolved Microsoft.WindowsAppSDK.ML wrapper during validation builds, preventing NU1605 while keeping the committed public baseline unchanged for normal use.

Changes:

  • Read the resolved Microsoft.WindowsAppSDK.ML wrapper .nuspec to determine the Microsoft.Windows.AI.MachineLearning dependency lower bound.
  • Override the harvested AI.ML version used for sample version rewriting with that floor when available.
  • Add logging and error handling for nuspec parsing.
File Description
UpdateVersions.ps1 Derives AI.ML minimum version from the resolved ML wrapper nuspec and uses it when rewriting sample package versions for validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread UpdateVersions.ps1
$mlWrapperNuspec = Join-Path $mlWrapperFolder "$mlWrapperId.nuspec"
if (Test-Path $mlWrapperNuspec) {
try {
[xml]$mlWrapperXml = Get-Content -Path $mlWrapperNuspec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants