[ci] Route Maven traffic through dotnet-public-maven - #1517
[ci] Route Maven traffic through dotnet-public-maven#1517jonathanpeppers wants to merge 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s CI behavior to route Maven/Gradle dependency resolution through the dotnet-public-maven Azure Artifacts mirror when RUNNINGONCI=true, while keeping local developer builds using the standard public repositories. It also updates tests and adds tooling to help seed/cached-mirror new artifacts safely.
Changes:
- Add Binderator-side Maven Central resolution logic that swaps Maven Central →
dotnet-public-mavenonly when running on CI, plus targeted unit coverage. - Route all four Gradle extension roots through the mirror in CI via
RUNNINGONCI. - Update Xamarin.Build.Download network-related tests to use a mirrored Gson 2.11.0 artifact and add a PowerShell helper to seed mirror artifacts.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| util/Xamarin.Build.Download/source/Xamarin.Build.Download.Tests/Test.cs | Switch Maven endpoints used by tests to a mirrored Gson artifact; adjust unsafe URL tests to use example.com. |
| util/Xamarin.AndroidBinderator/Xamarin.AndroidBinderator/Xamarin.AndroidBinderator.csproj | Expose Binderator internals to the test assembly. |
| util/Xamarin.AndroidBinderator/Xamarin.AndroidBinderator/MavenRepositoryResolver.cs | New helper to resolve Maven Central to the mirror only on CI. |
| util/Xamarin.AndroidBinderator/Xamarin.AndroidBinderator/MavenFactory2.cs | Route repository selection through MavenRepositoryResolver. |
| util/Xamarin.AndroidBinderator/Xamarin.AndroidBinderator/MavenFactory.cs | Route repository selection through MavenRepositoryResolver. |
| util/Xamarin.AndroidBinderator/Xamarin.AndroidBinderator.Tests/GenerationTests.cs | Add unit test verifying mirror routing behavior only for CI + Maven Central. |
| source/com.google.android.play/feature.delivery.extensions/build.gradle | Use the mirror repository when RUNNINGONCI=true, otherwise use google() + mavenCentral(). |
| source/com.google.android.play/core.extensions/build.gradle | Same mirror routing logic for CI. |
| source/com.google.android.play/asset.delivery.extensions/build.gradle | Same mirror routing logic for CI. |
| source/com.google.android.material/material.extensions/build.gradle | Same mirror routing logic for CI. |
| build/gradle/mirror-dependencies.ps1 | Add token-safe helper to seed/cache mirror artifacts via authenticated requests. |
| build/ci/build-and-test.yml | Set RUNNINGONCI=true for the main build step to enable mirror routing. |
Suppressed comments (5)
util/Xamarin.Build.Download/source/Xamarin.Build.Download.Tests/Test.cs:537
- This test now deduplicates the Gson mirror URL, but both items are still named
FacebookAndroid-4.17.0, which is confusing and makes future failures harder to interpret. Rename both item IDs to reflect the mirrored Gson artifact.
var itemUrl = DotNetPublicMavenGson;
source/com.google.android.play/feature.delivery.extensions/build.gradle:24
System.getenv('RUNNINGONCI') == 'true'is case-sensitive; use a null-safe, case-insensitive check so CI mirror routing isn’t dependent on the exact casing of the environment variable.
if (System.getenv('RUNNINGONCI') == 'true') {
source/com.google.android.play/core.extensions/build.gradle:24
System.getenv('RUNNINGONCI') == 'true'is case-sensitive; use a case-insensitive check so mirror routing is reliable across CI environments.
if (System.getenv('RUNNINGONCI') == 'true') {
source/com.google.android.play/asset.delivery.extensions/build.gradle:27
- This
RUNNINGONCIcheck is case-sensitive (== 'true'). Use a null-safe, case-insensitive comparison to avoid skipping mirror routing due to env var casing.
name = 'dotnet-public-maven'
source/com.google.android.material/material.extensions/build.gradle:24
System.getenv('RUNNINGONCI') == 'true'is case-sensitive; use a null-safe, case-insensitive check for consistent CI behavior.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| public void TestGetItemsToDownload () | ||
| { | ||
| var itemUrl = "https://search.maven.org/remotecontent?filepath=com/facebook/android/facebook-android-sdk/4.17.0/facebook-android-sdk-4.17.0.aar"; | ||
| var itemUrl = DotNetPublicMavenGson; |
There was a problem hiding this comment.
Fixed in 17cfaf7: the remaining item IDs now use Gson-2.11.0.
| mavenCentral() | ||
| if (System.getenv('RUNNINGONCI') == 'true') { | ||
| maven { | ||
| url = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-maven/maven/v1' |
There was a problem hiding this comment.
Fixed in 17cfaf7 with a null-safe, case-insensitive equalsIgnoreCase check in all Gradle roots.
| @@ -3,9 +3,15 @@ | |||
| buildscript { | |||
|
|
|||
There was a problem hiding this comment.
Fixed in 17cfaf7 with a null-safe, case-insensitive equalsIgnoreCase check in all Gradle roots.
Use a filesystem-safe repository name for Binderator caching and address review feedback. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 35292409-57b3-4628-bc99-7d55ecd71580
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 35292409-57b3-4628-bc99-7d55ecd71580
Summary
dotnet-public-mavenwhenRUNNINGONCI=true, while preserving local repository behaviorValidation
gradlew helpwithRUNNINGONCI=truegit diff --checkpasseddotnet-public-mavenNo current Maven artifacts require one-time seeding.