Make GoogleV2 dependency test deterministic and offline - #12580
Open
jonathanpeppers wants to merge 5 commits into
Open
Make GoogleV2 dependency test deterministic and offline#12580jonathanpeppers wants to merge 5 commits into
jonathanpeppers wants to merge 5 commits into
Conversation
Use deterministic loopback repository metadata and synthetic archives for GoogleV2 coverage while retaining the Xamarin feed installation path. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes live Google repository network dependencies from the GoogleV2 variant of InstallAndroidDependenciesTest by introducing a deterministic loopback HTTP fixture (synthetic repository/add-ons XML + minimal ZIP archives), and adds a private MSBuild seam to inject the Google add-ons list source while keeping production defaults unchanged.
Changes:
- Adds a private
_AndroidGoogleAddonsListSource→ task parameter plumbing so tests can inject a deterministic add-ons list URL. - Updates
InstallAndroidDependenciesTestto use a local loopback server fixture for GoogleV2 (and reuses the configured local JDK), eliminating external egress. - Relaxes Release manifest download restrictions to allow loopback
http://(while still rejecting non-loopback HTTP).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Xamarin.Installer.Build.Tasks/Xamarin.Installer.Common.targets | Passes a private add-ons list source property into the installer MSBuild task. |
| src/Xamarin.Installer.Build.Tasks/Tasks/InstallAndroidDependencies.cs | Adds task parameter handling and forwards the optional Google add-ons list URL into AndroidSDKInstaller. |
| src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/Common/Helper.cs | Permits loopback HTTP for manifest downloads in Release builds to support the offline fixture. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs | Reworks GoogleV2 test to use an offline loopback fixture server and validates installation + request set. |
Reuse the existing manifest base for loopback add-ons metadata and remove the extra MSBuild task property. Keep the fixture server small and bounded. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2ba9e613-f7b5-4a9d-b647-f49c3a790f78
Avoid duplicating the versioned add-ons list filename when resolving loopback fixtures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2ba9e613-f7b5-4a9d-b647-f49c3a790f78
Keep all fixture injection in the test assembly and restore shipped installer behavior unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2ba9e613-f7b5-4a9d-b647-f49c3a790f78
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2ba9e613-f7b5-4a9d-b647-f49c3a790f78
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
AndroidSDKInstallerconstructor andIHelpers.DownloadToString()injection seamS360 / CFS motivation
S360 [SFI-ES4.2.4] Network Isolation reports recurring DefaultDeny traffic from the Linux MSBuild 2 and Windows MSBuild shards. The GoogleV2 case previously loaded
repository2-3.xmlfromdl-ssl.google.com, followed repository artifacts todl.google.com, and could trigger JDK download traffic.This removes those GoogleV2/JDK egress paths without suppressing telemetry, adding a network exception, mirroring Google's SDK, uploading Google binaries, or dropping GoogleV2 coverage. S360 closure will remain delayed by its seven-day telemetry window.
Fixture design and preserved coverage
The GoogleV2 case now uses non-routable
https://googlev2-fixture.test/identities. A testIHelpersimplementation serves only exact registered metadata URIs and throws for anything else. Archive URIs are likewise exact-matched to generated bytes and written to local temporary files; there is no network fallback.Coverage includes:
package.xmlfiles and expected SDK layoutsdkmanagerexecutionThe Xamarin parameter continues to exercise the
InstallAndroidDependenciesMSBuild task, real internal artifact installation, and the successful subsequent project build.Validation
dotnet-local.cmd build src\Xamarin.Android.Build.Tasks\Tests\Xamarin.Android.Build.Tests\Xamarin.Android.Build.Tests.csproj -nodeReuse:false -v:minimalbin\BuildRelease\net10.0\Xamarin.Android.Tools.BootstrapTasks.dlland Release JDK setup; CI provides those prepared prerequisitesdotnet-androidAzure DevOps pipeline withaz pipelines; internal DevDiv build IDs 11410 and 12278 are not visible indnceng-public