Add reachability metadata for io.confluent:kafka-schema-serializer:8.3.0 - #8714
Add reachability metadata for io.confluent:kafka-schema-serializer:8.3.0#8714mvanhorn wants to merge 2 commits into
Conversation
Adds a new-library contribution for io.confluent:kafka-schema-serializer:8.3.0: metadata index and reachability-metadata.json covering the serializer config, subject/context name strategies, and schema-id serdes, a framework-list entry, and a Gradle test harness that exercises the serializers through a mock:// Schema Registry (no live Kafka/Schema Registry service required). Fixes oracle#8564 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QK73cX8EuqqwQEJUbycu6g
|
Hey @mvanhorn, thanks for the contribution! CI fails in |
Removed the `typeReached: AbstractKafkaSchemaSerDeConfig` condition from the seven strategy registrations. They are now active for direct reflective instantiation while all unrelated metadata remains unchanged. ### CODEX STATUS - **PASS:** JSON syntax validation with `jq` - **PASS:** `git diff --check` - **PASS:** Diff scope: one metadata file, 21 deletions - **ENV_BLOCKED:** Gradle validation, lint, and focused tests. The Gradle 9.1 wrapper distribution is not cached and network access cannot resolve `services.gradle.org`. The installed OpenJDK 21 also lacks `native-image`. - **NOTES:** No rebase or upstream-tree materialization attempted. Codex session ID: 019ffb91-e9a6-7211-81e4-1a3f03d3521f
|
Thanks for the precise diagnosis, that was exactly it. Removed the One file, 21 deletions, JSON validated. I could not run the Gradle validation or |
What does this PR do?
This adds GraalVM reachability metadata for
io.confluent:kafka-schema-serializer:8.3.0, resolving the new-library request in #8564. Today, native-image builds that integrate Kafka clients with Confluent Schema Registry fail unless the user hand-maintains reflection config, because the serializer infrastructure loads its configuration, its subject- and context-name strategies, and its schema-id serdes reflectively at runtime. Shipping the metadata here means those applications build natively out of the box.The reporter (jessecoddington) already runs this exact reflection configuration in production and posted it on the issue, so it serves as the verified basis for the entries rather than a guess. The metadata stays deliberately narrow: it registers only the classes that are reflectively reached and exercised by the test, and it uses conditional configuration (
condition.typeReached) so it does not bloat images. Concretely, it covers the abstract serde and config base classes, the subject-name strategies (topic, topic-record, record, and the reference strategies), the null context-name strategy, and the schema-id serializers and deserializers.The contribution mirrors the existing
metadata/org.apache.kafka/kafka-clientslayout: a per-artifact index, the versioned reachability metadata, a registration entry in the framework list (re-sorted by artifact per the contributing guide), and a Gradle test harness undertests/src. Following the maintainer (kimeta) human-intervention note on the issue, the harness talks to an in-memorymock://Schema Registry instead of a live Kafka or Schema Registry service, so it needs no external infrastructure.On testing: every new and changed JSON file parses and validates against the repository's own schemas (the library index, reachability metadata, and framework-list schemas). The harness test does an Avro serialize/deserialize round trip through the mock registry, which reaches the abstract serde, the config, and the schema-id serdes; it then serializes once per configured subject-name strategy and reflectively instantiates each subject- and context-name strategy through its public no-arg constructor, which is the same path Confluent uses to load them from config. That makes each metadata entry load-bearing under native image. The repository's library-scoped generation flow that produces
stats/is expected to run in CI to confirm native coverage.Contribution requires the Oracle CLA; the signing gate is handled downstream.
Code sections where the PR accesses files, network, docker or some external service
The test resolves the library from the Confluent Maven repository (scoped to the
io.confluentgroup) and otherwise talks only to an in-memorymock://Schema Registry, so there is no live network, Kafka broker, or Docker dependency.build.gradleKafkaSchemaSerializerTest.javaFixes #8564