refactor(api): normalize KPipe.avro/protobuf arg order to (topic, props, format)#201
Merged
Merged
Conversation
…ps, format) The static-mode KPipe.avro/protobuf overloads took (format, topic, props) while KPipe.custom and the SR-mode KPipe.avro(topic, props, resolver) both put the format/resolver last. The §17 capability table documents the canonical shape as (topic, props, format) — the static-mode overloads were the outliers. Normalize all static-mode entry points to put the format last: - KPipe.avro(String topic, Properties props, AvroFormat format) - KPipe.avro(Collection<String> topics, Properties props, AvroFormat format) - KPipe.protobuf(String topic, Properties props, ProtobufFormat format) - KPipe.protobuf(Collection<String> topics, Properties props, ProtobufFormat format) - MultiBuilder.avro(String topic, AvroFormat format, configurator) - MultiBuilder.protobuf(String topic, ProtobufFormat format, configurator) Hard-rename + migrate all callers in the same PR per the no-deprecation policy. No @deprecated overloads kept for back-compat.
Owner
Author
|
@copilot please review |
Copilot stopped work on behalf of
eschizoid due to an error
June 19, 2026 23:30
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #201 +/- ##
============================================
- Coverage 77.82% 77.74% -0.08%
+ Complexity 732 722 -10
============================================
Files 68 66 -2
Lines 2800 2795 -5
Branches 346 348 +2
============================================
- Hits 2179 2173 -6
Misses 462 462
- Partials 159 160 +1 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Normalize the static-mode
KPipe.avro/KPipe.protobufoverloads (and the correspondingMultiBuilderper-format methods) so the format argument comes last, matching the established shape ofKPipe.custom(topic, props, format)andKPipe.avro(topic, props, resolver). The §17 capability table already documents(topic, props, format)as the canonical shape — the static-mode Avro/Protobuf overloads were the outliers.The asymmetry (before)
KPipe.avro(AvroFormat format, String topic, Properties kafkaProps)— format firstKPipe.protobuf(ProtobufFormat format, String topic, Properties kafkaProps)— format firstKPipe.custom(String topic, Properties kafkaProps, MessageFormat<T> format)— format last (canonical)KPipe.avro(String topic, Properties kafkaProps, SchemaResolver resolver)— resolver last (consistent withcustom)KPipe.json/bytes(String topic, Properties kafkaProps)— no format argThe fix
Hard-rename all six entry points (no
@Deprecatedoverloads kept) and migrate every caller in the same PR, per the no-deprecation policy.KPipe.avro(String topic, Properties kafkaProps, AvroFormat format)KPipe.avro(Collection<String> topics, Properties kafkaProps, AvroFormat format)KPipe.protobuf(String topic, Properties kafkaProps, ProtobufFormat format)KPipe.protobuf(Collection<String> topics, Properties kafkaProps, ProtobufFormat format)MultiBuilder.avro(String topic, AvroFormat format, Function<…> configurator)MultiBuilder.protobuf(String topic, ProtobufFormat format, Function<…> configurator)The SR-mode
KPipe.avro(topic, props, SchemaResolver),KPipe.json/bytes, andKPipe.customare unchanged — they already match the canonical shape.Pre-verification (caller enumeration before migration)
The
examples/schema-registry/.../App.java:38hit is the SR-mode(topic, props, resolver)overload — already canonical, not migrated.The Javadoc and code-comment mentions inside
lib/kpipe-api/src/main/java/io/github/eschizoid/kpipe/KPipe.javaandlib/kpipe-format-avro/src/main/java/io/github/eschizoid/kpipe/format/avro/AvroFormat.javareferenced the old shape verbatim — those were updated in-place.There are no
KPipe.avro/KPipe.protobufcallers inbenchmarks/.Migrated callers
Library
lib/kpipe-api/src/main/java/io/github/eschizoid/kpipe/KPipe.java— overload signatures + Javadoc + theregistryModeConsoleSinkUnsupportederror messagelib/kpipe-api/src/main/java/io/github/eschizoid/kpipe/MultiBuilder.java—avro/protobufroute method signatures + class-level Javadoc examplelib/kpipe-format-avro/src/main/java/io/github/eschizoid/kpipe/format/avro/AvroFormat.java— Javadoc reference to the oldKPipe.avro(...).skipBytes(5)patternTests
lib/kpipe-api/src/test/java/io/github/eschizoid/kpipe/ToConsoleDispatchTest.java—avroToConsoleDispatchesToAvroConsoleSink+protobufToConsoleDispatchesToProtobufConsoleSinkExamples
examples/avro/src/main/java/io/github/eschizoid/kpipe/App.javaexamples/avro/src/test/java/io/github/eschizoid/kpipe/AppIntegrationTest.javaexamples/protobuf/src/main/java/io/github/eschizoid/kpipe/App.javaexamples/protobuf/src/test/java/io/github/eschizoid/kpipe/AppIntegrationTest.javaexamples/schema-registry/src/test/java/io/github/eschizoid/kpipe/AppIntegrationTest.java(the static-mode call site)examples/demo/src/main/java/io/github/eschizoid/kpipe/demo/DemoApp.java(MultiBuilder.avro/.protobuf)Docs
README.md— equivalence note for the SR-shorthandNo-deprecation policy
Per the project's no-deprecation policy: no
@Deprecatedoverloads, no@deprecatedJavadoc, no shim layer. The rename and all caller migrations land in this one PR so users always have a working reference and the surface stays clean. Same playbook as the priorwithSequentialProcessing(boolean)removal.Test plan
./gradlew :lib:kpipe-api:test :examples:avro:compileJava :examples:protobuf:compileJava :benchmarks:compileJmhJava→ green (BUILD SUCCESSFUL in 2m 17s)./gradlew :examples:demo:compileJava→ green (DemoApp uses MultiBuilder.avro / .protobuf)./gradlew :examples:schema-registry:compileJava :examples:schema-registry:compileTestJava :examples:avro:compileTestJava :examples:protobuf:compileTestJava→ green(format, topic, …)call sites remaining.