chore(jpms): remove unused requires, promote API-exposed deps to transitive#206
Merged
Merged
Conversation
…sitive Part A — remove unused requires (verified by grep + clean compile): - kpipe-api: drop `requires kafka.clients` (no org.apache.kafka import in src/main) - kpipe-consumer: drop `requires java.net.http` (health server uses jdk.httpserver) Part B — promote requires to transitive where the public API exposes the required module's types: - kpipe-api: org.apache.avro, com.google.protobuf (KPipe.avro/protobuf return Stream<GenericRecord> / Stream<Message>) - kpipe-consumer: kafka.clients (Builder.withConsumer/withKafkaProducer/ withOffsetManagerProvider expose Kafka types) - kpipe-producer: kafka.clients (KPipeProducer.Builder.withProducer + send/ sendAsync expose Producer/ProducerRecord) - kpipe-metrics-otel: io.github.eschizoid.kpipe.metrics (OtelConsumerMetrics implements ConsumerMetrics) - kpipe-tracing-otel: io.github.eschizoid.kpipe.producer (OtelTracer implements Tracer) - kpipe-schema-registry-confluent: io.github.eschizoid.kpipe.core (CachedSchemaResolver/ConfluentSchemaResolver implement SchemaResolver) - kpipe-format-avro: org.apache.avro (AvroFormat(Schema) implements MessageFormat<GenericRecord>) - kpipe-format-protobuf: com.google.protobuf (ProtobufFormat(Descriptor) implements MessageFormat<Message>) Build-metadata only; no behavior change. Changes the downstream module graph: consumers of kpipe-api no longer need to manually `requires` the format modules' dependency packages.
Owner
Author
|
@copilot please review |
Copilot stopped work on behalf of
eschizoid due to an error
June 20, 2026 00:50
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #206 +/- ##
=========================================
Coverage 78.56% 78.56%
Complexity 749 749
=========================================
Files 66 66
Lines 2818 2818
Branches 359 359
=========================================
Hits 2214 2214
Misses 443 443
Partials 161 161 ☔ 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.
JPMS audit follow-up: tighten
module-info.javaacross the module graph. Build-metadata only — no behavior change. Module-graph changes affect downstream consumers, so each one was verified by grep + a full clean compile (compileJava+compileTestJavaacross all modules, re-run with--rerun-tasksto defeat caching). All passed.Part A — remove unused
requireskpipe-apirequires kafka.clientsgrep -rn "org.apache.kafka" lib/kpipe-api/src/main/java/→ no matches (exit 1)kpipe-consumerrequires java.net.httpgrep -rn "java.net.http" lib/kpipe-consumer/src/main/java/→ only match was themodule-info.javadeclaration itself; the health server usesjdk.httpserver/com.sun.net.httpserver, which stays declaredBoth removals confirmed safe: no audit-missed usage, and the clean compile across all modules still succeeds.
Part B — promote
requires→requires transitiveEach promotion was confirmed by locating the required module's type on a public/exported signature before promoting:
kpipe-apiorg.apache.avroKPipe.avro(...)returnsStream<GenericRecord>kpipe-apicom.google.protobufKPipe.protobuf(...)returnsStream<Message>kpipe-consumerkafka.clientsBuilder.withConsumer(Supplier<Consumer<K,byte[]>>),withKafkaProducer(Producer<K,byte[]>),withOffsetManagerProvider(Function<Consumer<K,byte[]>, …>)kpipe-producerkafka.clientsKPipeProducer.Builder.withProducer(Producer<K,V>),send(ProducerRecord),sendAsync(ProducerRecord)kpipe-metrics-otelio.github.eschizoid.kpipe.metricsOtelConsumerMetrics implements ConsumerMetrics(andOtelProducerMetrics implements ProducerMetrics)kpipe-tracing-otelio.github.eschizoid.kpipe.producerOtelTracer implements Tracer(producer.tracing.Tracer)kpipe-schema-registry-confluentio.github.eschizoid.kpipe.coreCachedSchemaResolver/ConfluentSchemaResolver implements SchemaResolverkpipe-format-avroorg.apache.avroAvroFormat(Schema)ctor,implements MessageFormat<GenericRecord>kpipe-format-protobufcom.google.protobufProtobufFormat(Descriptor)ctor,implements MessageFormat<Message>Deliberately NOT promoted (internal-only, audit-confirmed correct as non-transitive):
com.fasterxml.jackson.coreinkpipe-format-avro— only leaks transitively through Avro's encoder internals; not on KPipe's own public surface.com.google.protobuf.utilinkpipe-format-protobuf— internal-only (console-sink JSON formatting).Downstream module-graph impact
This changes the module graph for consumers of the facade. Because
kpipe-apinowrequires transitive org.apache.avro/com.google.protobuf, and the format modules re-export their dependency types, downstream consumers ofkpipe-apino longer need to manuallyrequires org.apache.avro/requires com.google.protobufin their ownmodule-info.javato nameGenericRecord/Messagefrom the facade return types. Likewise, consumers ofkpipe-consumer/kpipe-producerno longer need a manualrequires kafka.clientsto name the Kafka types those builders expose.Verification
./gradlew clean compileJava compileTestJavaacross all modules — BUILD SUCCESSFUL (re-run with--rerun-tasks).requiresremoval would break compilation; nothing did, so no removal was reverted.(Note:
./gradlew clean builditself fails in this CI worktree only because the SpotlessratchetFrom("origin/main")jgit step can't resolve the worktree gitdir indirection — unrelated to these changes;module-info.javaedits are not Spotless-formatted.)