Skip to content

feat: add fallback for google maven (CM-1299) - #4275

Merged
ulemons merged 2 commits into
mainfrom
feat/google-maven-fallback
Jun 29, 2026
Merged

feat: add fallback for google maven (CM-1299)#4275
ulemons merged 2 commits into
mainfrom
feat/google-maven-fallback

Conversation

@ulemons

@ulemons ulemons commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Two fixes to the Maven enrichment registry routing introduced in CM-1299.

  1. com.google.android bare namespace was routed to Maven Central — the previous entry used prefix com.google.android. (with trailing dot), which matched sub-namespaces like com.google.android.gms but not the bare groupId com.google.android. As a result, artifacts like com.google.android:android (941 dependents), com.google.android:annotations (326), and com.google.android:support-v4 (146) were still being looked up on Maven Central, getting 404, and written as maven_not_on_central.

  2. com.google.firebase:firebase-admin was being lost after CM-1299 — the previous PR correctly routes all com.google.firebase.* to Google Maven (where the Android Firebase SDKs live). However, firebase-admin is 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 as maven_not_on_central with no way out. A Central fallback is now attempted when any alternative-registry namespace returns NOT_FOUND.

Changes

  • registry.ts — remove trailing dot from com.google.android. prefix so the bare namespace also routes to Google Maven. Export MAVEN_CENTRAL_BASE_URL (was module-private) and add isAlternativeRegistry() helper.
  • runMavenEnrichmentLoop.ts — after a NOT_FOUND from a non-Central primary registry, retry on Maven Central before writing maven_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 asserted com.google.android (bare) routes to Maven Central.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

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.android artifacts hit Google Maven (prefix boundary via findEntry, without matching com.google.androidx), and adds a Maven Central retry when an alternative-registry lookup returns NOT_FOUND (e.g. com.google.firebase:firebase-admin).

registryUrl on upserts now uses resolveRegistryPageUrlFromBase so browse links match the repo that actually served metadata after a Central fallback. Exports MAVEN_CENTRAL_BASE_URL, adds isAlternativeRegistry, 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.

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons self-assigned this Jun 29, 2026
Copilot AI review requested due to automatic review settings June 29, 2026 14:20
@ulemons ulemons added the Bug Created by Linear-GitHub Sync label Jun 29, 2026

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

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

Comment thread services/apps/packages_worker/src/maven/runMavenEnrichmentLoop.ts
Comment thread services/apps/packages_worker/src/maven/runMavenEnrichmentLoop.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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.android to 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.android behavior.

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.

Comment thread services/apps/packages_worker/src/maven/registry.ts
Comment thread services/apps/packages_worker/src/maven/runMavenEnrichmentLoop.ts
Comment thread services/apps/packages_worker/src/maven/__tests__/registry.test.ts
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons
ulemons merged commit c8d1b5e into main Jun 29, 2026
16 checks passed
@ulemons
ulemons deleted the feat/google-maven-fallback branch June 29, 2026 15:08
skwowet pushed a commit that referenced this pull request Jul 3, 2026
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants