Skip to content

fix(sdk-updater): hold first-party groups to the manifest's Uno major - #2297

Open
choksi2212 wants to merge 1 commit into
unoplatform:mainfrom
choksi2212:fix/sdk-updater-major-gate
Open

choksi2212 wants to merge 1 commit into
unoplatform:mainfrom
choksi2212:fix/sdk-updater-major-gate

Conversation

@choksi2212

Copy link
Copy Markdown
Contributor

Closes #2291

Problem

The compatibility gate cannot tell that a first-party package has moved to the next Uno major:

  1. IsCompatibleWithUnoWinUI reads the Uno.WinUI dependency from the candidate's nuspec, but NuGet dependency versions are floors - a package that moves to 7.0 keeps its old floor for a while (e.g. Uno.WinUI.Markup 7.0.0-dev.5 still declares Uno.WinUI 6.7.0-dev.41, so it validates clean against a 6.8 SDK).
  2. Uno.Fonts.*, Uno.Resizetizer, Uno.Settings.DevServer and Uno.UI.App.Mcp have nuspecs with no Uno dependency at all (Uno.UI.App.Mcp 2.0.0-dev.5 depends only on SkiaSharp), so the trailing unconditional AddResult(..., true) marks them valid.
  3. The first dependency group decides for the whole package (HasBeenChecked after the first AddResult), and in the transitive branch a dependency that was already recorded invalid is skipped instead of failing the group.
  4. GetVersionAsync only applies the minor+1 bound when the Uno.Sdk line is stable, so on a prerelease line there is no upper bound at all.

Repro (run today, against unmodified main @ 4929d52, local manifest seeded to the 6.8 SDK's own versions, feeds live)

NBGV_SemVer2=6.8.0-dev.9999 dotnet run -c Release --project tools/Uno.Sdk.Updater -- --exclude-file .github/sdk-update-exclude.json

resolves Core 6.8.0-dev.193 and then reports:

Updated Group 'Resizetizer' to version '2.0.0-dev.14'.
Updated Group 'settings' to version '2.0.0-dev.14'.
Updated Group 'UnoFonts' to version '2.10.0-dev.9'.
Updated Group 'AppMcp' to version '2.0.0-dev.5'.

All Uno 7.0-era packages paired with a 6.8 Uno.WinUI, which uno-updater.yml would auto-merge unattended.

Fix

Selection-time major ceiling for first-party groups (Program.cs): a group whose packages are all Uno.*-prefixed is held to the major already pinned in packages.json, reusing the existing majorUpgradeDisabledGroups mechanism. First-party groups keep taking servicing updates within their pinned major; moving one to the next Uno major becomes a deliberate manifest change (which is exactly what the manual freeze in #2240 works around today). On stable lines this is a no-op - the minor+1 bound already caps majors there.

Honest nuspec gate (NuGetClient.cs): a package is only compatible if every dependency group is (previously the first group's verdict won), and a transitive dependency that was already checked and found incompatible now fails the group instead of being skipped.

Verification

All against the live nuget.org + Uno private feeds, unmodified main @ 4929d52 vs this branch, same 6.8-era seed (Uno.Sdk.Private 6.8.0-dev.193 manifest):

group main (bug) this PR
Resizetizer 1.13.0-dev.17 -> 2.0.0-dev.14 1.13.0-dev.17 -> 1.13.0-dev.21
settings 1.13.0-dev.7 -> 2.0.0-dev.14 1.13.0-dev.7 -> 1.14.0-dev.9
AppMcp 1.3.0-dev.98 -> 2.0.0-dev.5 1.3.0-dev.98 -> 1.4.0-dev.5
UnoFonts 2.9.4 -> 2.10.0-dev.9 2.9.4 -> 2.10.0-dev.9 (minor bump within major 2, correctly still allowed)

Regression check on the main line (7.0 window, real packages.json): the update sets produced by main and by this PR are identical - hotdesign 1.24.0-dev.38, Extensions 8.0.0-dev.59, AppMcp 2.0.0-dev.5, WinAppSdkBuildToolsWinApp 0.7.1 - so within-major updates of first-party groups (including preview-to-preview bumps) are unaffected.

Both runs complete with exit 0 and finish the full update (packages.json/ReadMe/props/targets written).

The updater's compatibility gate cannot tell that a first-party package
moved to the next Uno major: NuGet dependency versions are floors, so a
7.0 package keeps validating against a 6.8 Uno.WinUI for a while, and
several first-party packages (Uno.Fonts.*, Uno.Resizetizer,
Uno.Settings.DevServer, Uno.UI.App.Mcp) declare no Uno dependency at
all, so nothing is checked for them. On a prerelease Uno.Sdk line the
minor+1 bound is skipped too, leaving no upper bound at all.

On a 6.8 Uno.Sdk line the updater today moves Resizetizer to 2.0,
settings to 2.0 and AppMcp to 2.0 - all Uno 7.0-era packages that
uno-updater.yml would auto-merge unattended.

Hold first-party groups (packages all prefixed Uno.) to the major
already pinned in packages.json, reusing the existing
majorUpgradeDisabledGroups mechanism, so they keep taking servicing
updates and a major move becomes a deliberate manifest change. On
stable lines this is a no-op: the minor+1 bound already caps majors.

Also make the nuspec gate honest while it runs: a package is only
compatible if every dependency group is, instead of letting the first
group decide for the whole package, and a transitive dependency that was
already checked and found incompatible now fails the group instead of
being skipped.

Closes unoplatform#2291
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@choksi2212

Copy link
Copy Markdown
Contributor Author

Gentle nudge on this one too - a week without review activity. The gate is behavior-preserving for first-party packages within the manifest's major (verified against live feeds on a 6.8 seed: no major-jumps on Resizetizer/settings/AppMcp/UnoFonts, 7.0-window byte-identical). Note the CLA check shows unsigned - if that's just awaiting a signature I'll get it sorted.

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

This branch has not been deployed

No deployments
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.

[Bug] Uno.Sdk updater can't detect first-party packages that moved to the next Uno major

2 participants