Skip to content

[ci] Route Maven traffic through dotnet-public-maven - #1517

Open
jonathanpeppers wants to merge 3 commits into
mainfrom
jonathanpeppers-fix-maven-cfsclean
Open

[ci] Route Maven traffic through dotnet-public-maven#1517
jonathanpeppers wants to merge 3 commits into
mainfrom
jonathanpeppers-fix-maven-cfsclean

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Summary

  • route Binderator Maven Central requests through dotnet-public-maven when RUNNINGONCI=true, while preserving local repository behavior
  • route all four Gradle extension builds through the mirror in CI
  • update Xamarin.Build.Download network tests to use the anonymously cached Gson 2.11.0 mirror artifact instead of public Maven endpoints
  • add an authenticated, token-safe helper for seeding future Gradle dependency graphs or explicit Maven coordinates

Validation

  • focused Binderator mirror-routing tests passed
  • focused Xamarin.Build.Download Maven-related tests passed
  • all four Gradle roots passed gradlew help with RUNNINGONCI=true
  • pipeline YAML and mirror PowerShell syntax validated
  • git diff --check passed
  • all 126 configured Maven Central POMs, Android Gradle Plugin 8.12.0, and the four extension root POMs return HTTP 200 anonymously from dotnet-public-maven

No current Maven artifacts require one-time seeding.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 12, 2026 21:59

Copilot AI left a comment

Copy link
Copy Markdown

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 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-maven only 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 RUNNINGONCI check 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;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 17cfaf7: the remaining item IDs now use Gson-2.11.0.

Comment thread source/com.google.android.play/feature.delivery.extensions/build.gradle Outdated
Comment thread source/com.google.android.play/core.extensions/build.gradle Outdated
mavenCentral()
if (System.getenv('RUNNINGONCI') == 'true') {
maven {
url = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-maven/maven/v1'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 17cfaf7 with a null-safe, case-insensitive equalsIgnoreCase check in all Gradle roots.

@@ -3,9 +3,15 @@
buildscript {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

2 participants