Repository navigation
refactor(kotlin): decouple bundled basic catalog IDs from repository paths (#2700) - #4149
Conversation
There was a problem hiding this comment.
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.
fae1d8f to
fed0264
Compare
gspencergoog
left a comment
There was a problem hiding this comment.
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
fed0264 to
2eb3ca3
Compare
2eb3ca3 to
d180eb2
Compare
Summary
BundledCatalogProviderinkotlin/agent_sdk_legacynow loads basic catalog schemas from explicit classpath resource paths and resolves fallbackcatalogIdvalues from an explicit per-version ID map instead of deriving both from repository file paths.Previously,
BundledCatalogProvidersliced"specification/v0_9/"and"specification/v0_9_1/"prefixes offBasicCatalog.BASIC_CATALOG_PATHSto find the bundled classpath resource and concatenatedBASE_SCHEMA_URLwith the repository path whencatalogIdwas absent. Moving the v0.9 and v0.9.1 catalog files out ofspecification/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 soA2uiVersion.VERSION_0_9_1loads from package resources likeVERSION_0_8andVERSION_0_9.Fixes #2700
Changes
BasicCatalog.BASIC_CATALOG_IDSandBASIC_CATALOG_RESOURCE_PATHSfromBasicCatalog.BASIC_CATALOG_PATHSinBasicCatalogProvider.kt.v0_9_1protocol schemas and basic catalog intocom/google/a2ui/assets/0.9.1inkotlin/agent_sdk_legacy/build.gradle.kts.CatalogTestcases covering bundled catalog loading across0.8,0.9, and0.9.1and fallbackcatalogIdinjection..github/workflows/kotlin_agent_sdk_build_and_test.ymlwhen files undercatalogs/change.Verification
./gradlew ktfmtCheck testinkotlin/agent_sdk_legacy../scripts/fix_format.sh --checkand./scripts/fix_licenses.py --check.