Download version-pinned NuGet.config for MAUI workload install#5261
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes MAUI workload installs more deterministic by pinning upstream NuGet.config downloads (maui/android/macios) to the exact git commit that produced the workload’s manifest package, instead of downloading configs from branch HEAD.
Changes:
- Added NuGet feed probing to download a manifest package
.nuspecand extract<repository commit="...">for commit-pinnedNuGet.configURLs. - Refactored “latest manifest package” selection into a shared helper and reused it for both workload install and commit discovery.
- Updated
MauiNuGetConfigContextto attempt commit discovery and fall back to branch HEAD behavior on failure.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
matouskozak
force-pushed
the
matouskozak-versioned-nuget-config-download
branch
from
July 14, 2026 14:23
fb8de5e to
0b1c22d
Compare
matouskozak
force-pushed
the
matouskozak-versioned-nuget-config-download
branch
from
July 14, 2026 14:49
9fb5fb9 to
bd2182e
Compare
matouskozak
force-pushed
the
matouskozak-versioned-nuget-config-download
branch
from
July 14, 2026 15:39
7b51ead to
bd2182e
Compare
matouskozak
force-pushed
the
matouskozak-versioned-nuget-config-download
branch
from
July 14, 2026 15:40
bd2182e to
d3512b6
Compare
matouskozak
force-pushed
the
matouskozak-versioned-nuget-config-download
branch
from
July 14, 2026 16:23
d3512b6 to
e9832d2
Compare
matouskozak
force-pushed
the
matouskozak-versioned-nuget-config-download
branch
from
July 14, 2026 16:23
e9832d2 to
8ed039f
Compare
matouskozak
force-pushed
the
matouskozak-versioned-nuget-config-download
branch
2 times, most recently
from
July 14, 2026 16:33
0412706 to
8acde7c
Compare
LoopedBard3
previously approved these changes
Jul 14, 2026
Open
3 tasks
kotlarmilos
reviewed
Jul 15, 2026
Instead of downloading NuGet.config from branch HEAD of upstream repos (dotnet/maui, dotnet/android, dotnet/macios), extract the commit SHA from the NuGet package .nuspec metadata and download from the exact commit that produced the workload package. Also refactors install_latest_maui to use the shared _find_latest_manifest_package helper, and caches resolved manifest packages so they aren't re-queried during workload install. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0dd7300a-1024-4ddc-a780-d0a9e0eee1e1
matouskozak
force-pushed
the
matouskozak-versioned-nuget-config-download
branch
from
July 15, 2026 10:26
8acde7c to
ae893d6
Compare
kotlarmilos
self-requested a review
July 15, 2026 11:16
kotlarmilos
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Instead of downloading the latest
NuGet.configfrom branch HEAD of upstream repos (dotnet/maui,dotnet/android,dotnet/macios), extract the commit SHA from the NuGet package.nuspecmetadata and download from the exact commit that produced the workload package.Problem
MauiNuGetConfigContextdownloadsNuGet.configfiles from upstream repos using branch HEAD. If the upstream repo has moved ahead since the workload package was published, theNuGet.configmay reference feeds that don't match the packages being installed.Solution
NuGet packages embed
<repository type="git" url="..." commit="..." />in their.nuspecmetadata. We use this to:.nuspecfrom the NuGet flat container API<repository>elementNuGet.configfrom that commit instead of branch HEADNew functions
_find_latest_manifest_package— shared filtering logic (extracted frominstall_latest_maui)_get_nuget_flat_container_base— gets flat container URL from NuGet V3 service index_get_commit_sha_from_nuspec— downloads.nuspec, parses<repository>element_discover_repo_commits— orchestrates per-repo commit SHA discoveryModified functions
_get_repo_nuget_config_url/download_repo_nuget_config— accept optionalcommit_shaparameterMauiNuGetConfigContext.__enter__— calls_discover_repo_commitsbefore downloading configsinstall_latest_maui— refactored to use shared_find_latest_manifest_packagehelperFallback
Any failure in commit discovery silently falls back to the current branch-HEAD behavior. All failures are logged as warnings, never fatal.
Validation
Tested on https://dev.azure.com/dnceng/internal/_build/results?buildId=3022990&view=results— commit SHAs are correctly discovered and used for NuGet.config downloads.