fix(flatpak): improve mirror URL strategy for offline builds#5558
Merged
Conversation
- Route Google artifacts (androidx.*, com.google.*, com.android.*) to dl.google.com as primary to avoid Maven Central rate-limiting - Route Gradle plugin markers to plugins.gradle.org as primary - Add Maven Central fallback mirrors for JitPack artifacts (fixes 404 for com.github.* packages that migrated to Maven Central, e.g. clikt) - Add repo1.maven.org and maven.aliyun.com as full Maven Central mirrors for geographic diversity and resilience - Remove configurable snapshotRepoUrl param (hardcode to central.sonatype.com; old s01.oss.sonatype.org kept as mirror) - Remove redundant snapshot mirror that duplicated the primary URL Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Motivation
Austin's Flatpak build (vidplace7/org.meshtastic.desktop) is failing with 404s on JitPack for artifacts like
com.github.ajalt.clikt:clikt-core-jvmthat have migrated to Maven Central. Additionally, the previous mirror strategy hammered Maven Central with requests for Google-hosted artifacts (which always 404 there), triggering rate-limiting that then cascades into false 404s.Approach
Reworked the
GenerateFlatpakSourcesTaskmirror URL logic to route each artifact type to the repo most likely to host it as the primary, with broad fallbacks:androidx.*,com.google.*,com.android.*) ->dl.google.comprimary (no rate-limiting)*.gradle.plugin,org.gradle.*) ->plugins.gradle.orgprimarycom.github.*) ->jitpack.ioprimary, Maven Central as fallback (fixes clikt 404)repo.maven.apache.orgprimaryrepo1.maven.org, GCP mirror, and AliyunAlso simplified the plugin by removing the configurable
snapshotRepoUrlparameter -- it's now hardcoded tocentral.sonatype.com/repository/maven-snapshotswiths01.oss.sonatype.orgas a mirror.Key changes
GenerateFlatpakSourcesTask.kt-- mirror routing logic rewriteFlatpakExtension.kt-- removedsnapshotRepoUrlpropertyFlatpakPlugin.kt-- removedsnapshotRepoUrlwiringREADME.md-- updated DSL exampleNotes for reviewers
This directly addresses vid's feedback that Google doesn't rate-limit while Maven Central does, so Google artifacts should hit
dl.google.comfirst rather than burning through Maven Central's rate budget on doomed requests.