feat: add fallback for google maven (CM-1299) - #4275
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 407ff3d. Configure here.
There was a problem hiding this comment.
Pull request overview
This PR adjusts Maven enrichment routing in packages_worker so Google-related groupIds resolve against the correct registry and adds a Maven Central fallback when an alternative registry returns NOT_FOUND, preventing false maven_not_on_central classifications for artifacts like com.google.firebase:firebase-admin.
Changes:
- Route bare
com.google.androidto Google Maven (fixing the previous prefix mismatch). - Add a Maven Central retry path when an alternative-registry lookup returns
NOT_FOUND. - Update registry routing tests to reflect the new
com.google.androidbehavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| services/apps/packages_worker/src/maven/runMavenEnrichmentLoop.ts | Adds Central fallback after NOT_FOUND from an alternative registry. |
| services/apps/packages_worker/src/maven/registry.ts | Updates Google Maven routing for com.google.android and exports Central base URL + adds isAlternativeRegistry(). |
| services/apps/packages_worker/src/maven/tests/registry.test.ts | Updates expectation for bare com.google.android routing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org> Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>

Summary
Two fixes to the Maven enrichment registry routing introduced in CM-1299.
com.google.androidbare namespace was routed to Maven Central — the previous entry used prefixcom.google.android.(with trailing dot), which matched sub-namespaces likecom.google.android.gmsbut not the bare groupIdcom.google.android. As a result, artifacts likecom.google.android:android(941 dependents),com.google.android:annotations(326), andcom.google.android:support-v4(146) were still being looked up on Maven Central, getting 404, and written asmaven_not_on_central.com.google.firebase:firebase-adminwas being lost after CM-1299 — the previous PR correctly routes allcom.google.firebase.*to Google Maven (where the Android Firebase SDKs live). However,firebase-adminis the server-side Java SDK, published on Maven Central, not Google Maven. With CM-1299 in place it was getting 404 from Google Maven and written asmaven_not_on_centralwith no way out. A Central fallback is now attempted when any alternative-registry namespace returns NOT_FOUND.Changes
registry.ts— remove trailing dot fromcom.google.android.prefix so the bare namespace also routes to Google Maven. ExportMAVEN_CENTRAL_BASE_URL(was module-private) and addisAlternativeRegistry()helper.runMavenEnrichmentLoop.ts— after a NOT_FOUND from a non-Central primary registry, retry on Maven Central before writingmaven_not_on_central. This covers any artifact whose namespace normally maps to an alternative registry but is itself published on Central.registry.test.ts— update the test that incorrectly assertedcom.google.android(bare) routes to Maven Central.Type of change
JIRA ticket
CM-1299
Note
Low Risk
Scoped to Maven packages_worker enrichment and registry URL resolution; no auth or data-model changes, with behavior covered by updated unit tests.
Overview
Fixes Maven registry routing so legacy
com.google.androidartifacts hit Google Maven (prefix boundary viafindEntry, without matchingcom.google.androidx), and adds a Maven Central retry when an alternative-registry lookup returns NOT_FOUND (e.g.com.google.firebase:firebase-admin).registryUrlon upserts now usesresolveRegistryPageUrlFromBaseso browse links match the repo that actually served metadata after a Central fallback. ExportsMAVEN_CENTRAL_BASE_URL, addsisAlternativeRegistry, and extends unit tests for routing and page URLs.Reviewed by Cursor Bugbot for commit f727f0a. Bugbot is set up for automated code reviews on this repo. Configure here.