Skip to content

refactor(kotlin): decouple bundled basic catalog IDs from repository paths (#2700) - #4149

Merged
josemontespg merged 1 commit into
mainfrom
kotlin-decouple-basic-catalog-ids
Nov 16, 2026
Merged

josemontespg merged 1 commit into
mainfrom
kotlin-decouple-basic-catalog-ids

Conversation

@josemontespg

@josemontespg josemontespg commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

BundledCatalogProvider in kotlin/agent_sdk_legacy now loads basic catalog schemas from explicit classpath resource paths and resolves fallback catalogId values from an explicit per-version ID map instead of deriving both from repository file paths.

Previously, BundledCatalogProvider sliced "specification/v0_9/" and "specification/v0_9_1/" prefixes off BasicCatalog.BASIC_CATALOG_PATHS to find the bundled classpath resource and concatenated BASE_SCHEMA_URL with the repository path when catalogId was absent. Moving the v0.9 and v0.9.1 catalog files out of specification/ would have broken resource lookup and changed the fallback IDs. This change also bundles the v0.9.1 specification and basic catalog assets in Gradle so A2uiVersion.VERSION_0_9_1 loads from package resources like VERSION_0_8 and VERSION_0_9.

Fixes #2700

Changes

  • Separate BasicCatalog.BASIC_CATALOG_IDS and BASIC_CATALOG_RESOURCE_PATHS from BasicCatalog.BASIC_CATALOG_PATHS in BasicCatalogProvider.kt.
  • Copy the v0_9_1 protocol schemas and basic catalog into com/google/a2ui/assets/0.9.1 in kotlin/agent_sdk_legacy/build.gradle.kts.
  • Add CatalogTest cases covering bundled catalog loading across 0.8, 0.9, and 0.9.1 and fallback catalogId injection.
  • Trigger .github/workflows/kotlin_agent_sdk_build_and_test.yml when files under catalogs/ change.

Verification

  • Ran ./gradlew ktfmtCheck test in kotlin/agent_sdk_legacy.
  • Ran ./scripts/fix_format.sh --check and ./scripts/fix_licenses.py --check.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors BundledCatalogProvider to load A2UI specifications using structured resource paths and canonical IDs rather than hardcoded string manipulations, and updates the build configuration to include v0_9_1 assets. However, there is a copy-paste error in BasicCatalog.BASIC_CATALOG_IDS where VERSION_0_9_1 incorrectly maps to the v0_9 path, which is also incorrectly asserted in the new unit tests.

@josemontespg
josemontespg added this pull request to stack #4151 November 10, 2026 23:32
@josemontespg josemontespg changed the title refactor(kotlin): decouple bundled basic catalog IDs from repository paths refactor(kotlin): decouple bundled basic catalog IDs from repository paths (#2700) Nov 14, 2026
@josemontespg
josemontespg force-pushed the kotlin-decouple-basic-catalog-ids branch from fae1d8f to fed0264 Compare November 14, 2026 00:38
@josemontespg
josemontespg marked this pull request as ready for review November 16, 2026 18:55

@gspencergoog gspencergoog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This PR decouples bundled basic catalog resource loading and fallback catalog ID resolution in kotlin/agent_sdk_legacy from repository file paths, bundles the v0.9.1 specification and basic catalog schemas in Gradle, and adds the catalogs/** trigger to the Kotlin SDK CI workflow ahead of stack PR #4150. The implementation preserves binary and source compatibility for BundledCatalogProvider and BasicCatalog, matches the published v0.9.1 schema $id/catalogId, and passes all 34 executed CI checks. One low-severity test improvement is noted in CatalogTest.kt to cover all A2uiVersion values in the fallback ID injection test.

🤖 Agent-generated

@josemontespg
josemontespg force-pushed the kotlin-decouple-basic-catalog-ids branch from fed0264 to 2eb3ca3 Compare November 16, 2026 23:14
@josemontespg
josemontespg force-pushed the kotlin-decouple-basic-catalog-ids branch from 2eb3ca3 to d180eb2 Compare November 16, 2026 23:26
@josemontespg
josemontespg merged commit 1cbef31 into main Nov 16, 2026
49 checks passed
@josemontespg
josemontespg deleted the kotlin-decouple-basic-catalog-ids branch November 16, 2026 23:40
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.

Move v0.9 / v0.9.1 basic catalogs from specification/ to catalogs/

2 participants