Skip to content

Conversation

@LoopedBard3
Copy link
Member

@LoopedBard3 LoopedBard3 commented Dec 2, 2025

Automate MAUI workload dependency management

Eliminates manual Version.Details.xml maintenance and NuGet maintenance for MAUI scenarios by
downloading dependency configuration directly from upstream dotnet/maui
repository. This ensures zero-maintenance automation - MAUI version updates
no longer require changes to the performance repository.

Changes:

  • Added MauiNuGetConfigContext: Context manager that temporarily merges
    MAUI's package feeds into repo NuGet.config during build operations,
    with automatic cleanup on exit
  • Refactored generate_maui_rollback_dict(): Now downloads MAUI's
    Version.Details.xml directly from GitHub instead of reading local file
  • Updated all 7 MAUI scenario pre.py files (mauiandroid, mauiios,
    mauiblazorandroid, mauiblazorios, mauiblazordesktop,
    mauisamplecontentandroid, mauidesktop) to use context manager approach
  • Added download_maui_nuget_config() helper to fetch upstream NuGet.config

Test run: https://dev.azure.com/dnceng/internal/_build/results?buildId=2853821&view=results

This currently works for our net10 tfm (main branch version) builds of maui android. Older frameworks are untested.
The change I am most unsure of is the update to the rollbacks band versioning as it is unclear if not having the Mapping_comments to set the bands will cause failure.

Follow-up:

  • iOS Maui builds are still broken due to some earlier failure unrelated to Maui.
  • It would be nice to have a way to run for specific Maui commits rather than just the latest on whatever branch. This would need to be piped through from the yaml for the jobs but doesn't seem like it would be that hard to add.

This should fix:
#5055

@LoopedBard3 LoopedBard3 requested a review from Copilot December 2, 2025 20:06
@LoopedBard3 LoopedBard3 self-assigned this Dec 2, 2025
@LoopedBard3 LoopedBard3 added the bug Something isn't working label Dec 2, 2025
Copilot finished reviewing on behalf of LoopedBard3 December 2, 2025 20:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR automates MAUI workload dependency management by downloading configuration files directly from the dotnet/maui repository, eliminating the need for manual Version.Details.xml maintenance in the performance repository. The changes enable zero-maintenance automation for MAUI version updates.

Key Changes:

  • Introduced MauiNuGetConfigContext context manager to temporarily merge MAUI's package feeds into the repo's NuGet.config during build operations
  • Refactored generate_maui_rollback_dict() to download MAUI's Version.Details.xml directly from GitHub instead of reading from local repository
  • Updated all 7 MAUI scenario pre.py files to use the new context manager approach for NuGet.config management

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/scenarios/shared/mauisharedpython.py Core automation logic: added context manager for NuGet config merging, refactored rollback dictionary generation to download from MAUI upstream, added sync function for Version.Details.xml
src/scenarios/mauiandroid/pre.py Updated to use MauiNuGetConfigContext for temporary NuGet.config merging during build
src/scenarios/mauiblazorandroid/pre.py Updated to use MauiNuGetConfigContext for temporary NuGet.config merging during build
src/scenarios/mauiblazordesktop/pre.py Updated to use MauiNuGetConfigContext for temporary NuGet.config merging during build
src/scenarios/mauiblazorios/pre.py Updated to use MauiNuGetConfigContext for temporary NuGet.config merging during build
src/scenarios/mauidesktop/pre.py Updated to use MauiNuGetConfigContext for temporary NuGet.config merging during build
src/scenarios/mauiios/pre.py Updated to use MauiNuGetConfigContext for temporary NuGet.config merging during build
src/scenarios/mauisamplecontentandroid/pre.py Updated to use MauiNuGetConfigContext for temporary NuGet.config merging during build
eng/Version.Details.xml Removed all MAUI workload dependencies as they are now fetched dynamically from upstream
Comments suppressed due to low confidence (7)

src/scenarios/mauiios/pre.py:9

  • Import of 'download_maui_nuget_config' is not used.
from shared.mauisharedpython import remove_aab_files, install_latest_maui, download_maui_nuget_config

src/scenarios/mauisamplecontentandroid/pre.py:8

  • Import of 'download_maui_nuget_config' is not used.
from shared.mauisharedpython import remove_aab_files, install_latest_maui, download_maui_nuget_config

src/scenarios/mauiblazordesktop/pre.py:12

  • Import of 'download_maui_nuget_config' is not used.
from shared.mauisharedpython import install_latest_maui, download_maui_nuget_config

src/scenarios/mauiblazorandroid/pre.py:8

  • Import of 'download_maui_nuget_config' is not used.
from shared.mauisharedpython import remove_aab_files, install_latest_maui, download_maui_nuget_config

src/scenarios/mauiblazorios/pre.py:8

  • Import of 'download_maui_nuget_config' is not used.
from shared.mauisharedpython import remove_aab_files, install_latest_maui, download_maui_nuget_config

src/scenarios/mauidesktop/pre.py:11

  • Import of 'download_maui_nuget_config' is not used.
from shared.mauisharedpython import install_latest_maui, download_maui_nuget_config

src/scenarios/mauiandroid/pre.py:8

  • Import of 'download_maui_nuget_config' is not used.
from shared.mauisharedpython import remove_aab_files, install_latest_maui, download_maui_nuget_config

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +323 to +324
Find the repo's NuGet.config by walking up from the current directory.
This works for both local (c:/Users/.../performance) and pipeline (D:/a/1/s/performance/CorrelationStaging/payload/performance) scenarios.
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring formatting is inconsistent with the rest of the file. This file uses 4-space indentation for docstring content (see extract_latest_dotnet_feed_from_nuget_config at line 238 and download_maui_nuget_config at line 281). Consider adding 4 spaces of indentation to align with the existing style.

Suggested change
Find the repo's NuGet.config by walking up from the current directory.
This works for both local (c:/Users/.../performance) and pipeline (D:/a/1/s/performance/CorrelationStaging/payload/performance) scenarios.
Find the repo's NuGet.config by walking up from the current directory.
This works for both local (c:/Users/.../performance) and pipeline (D:/a/1/s/performance/CorrelationStaging/payload/performance) scenarios.

Copilot uses AI. Check for mistakes.
@LoopedBard3 LoopedBard3 marked this pull request as ready for review December 2, 2025 20:45
Comment on lines +177 to +178
url = f'https://raw.githubusercontent.com/dotnet/maui/{target_framework_wo_platform}/NuGet.config'
getLogger().info(f"Downloading MAUI NuGet.config from {url}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PureWeen @rmarinho is the branch name on dotnet/maui changing?

This maps $(TargetFramework) == branch. Does it matter if they use dotnet/maui/main vs net10.0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward as well, is the net11 work going to be done on main or a new branch?

Copy link
Member

@matouskozak matouskozak Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rmarinho which branch of dotnet/maui we should be using here (main vs net11/net10) so that we always have the latest nuget.config? (for context, we are building maui apps with the latest versions of .NET SDK, iOS/Android workloads + MAUI)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main will stay net10.0 until net11.0 goes GA
all net11.0 development will stay on net11.0

Because of the high volume of SR work that MAUI does compared to other repositories and the need to keep community members productive.

We keep main as always workable with public bits

@LoopedBard3 LoopedBard3 changed the title Update Maui runs to get NuGet.cconfig and Version.Details.xml from maui repo Update Maui runs to get NuGet.config and Version.Details.xml from maui repo Dec 2, 2025
Copy link
Member

@matouskozak matouskozak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks. I would just wait for confirmation from MAUI team what branch should we keep targetting main vs net11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants