diff --git a/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts index 8a42404f765..0868713d6da 100644 --- a/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts @@ -1,5 +1,6 @@ import com.google.auto.value.AutoValue import japicmp.model.JApiChangeStatus +import japicmp.model.JApiClass import japicmp.model.JApiCompatibility import japicmp.model.JApiCompatibilityChange import japicmp.model.JApiMethod @@ -44,6 +45,21 @@ class AllowNewAbstractMethodOnAutovalueClasses : AbstractRecordingSeenMembers() } } +// TODO: remove after protobuf 3.22.0 upgrade +class Protobuf3_22_Exception : AbstractRecordingSeenMembers() { + override fun maybeAddViolation(member: JApiCompatibility): Violation? { + if ((member is JApiMethod && isGeneratedMessageV3Builder(member.getjApiClass())) || + member is JApiClass && isGeneratedMessageV3Builder(member)) { + return Violation.accept(member, "Methods moved to superlass") + } + return null + } + + fun isGeneratedMessageV3Builder(member: JApiClass): Boolean { + return member.superclass.newSuperclassName.get().equals("com.google.protobuf.GeneratedMessageV3\$Builder") + } +} + class SourceIncompatibleRule : AbstractRecordingSeenMembers() { override fun maybeAddViolation(member: JApiCompatibility): Violation? { if (!member.isSourceCompatible()) { @@ -123,6 +139,7 @@ if (!project.hasProperty("otel.release") && !project.name.startsWith("bom")) { addRule(JApiChangeStatus.UNCHANGED, UnchangedMemberRule::class.java) // Allow new abstract methods on autovalue addRule(AllowNewAbstractMethodOnAutovalueClasses::class.java) + addRule(Protobuf3_22_Exception::class.java) addRule(BinaryIncompatibleRule::class.java) // Disallow source incompatible changes, which are allowed by default for some reason addRule(SourceIncompatibleRule::class.java) diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index f2632f0fc19..e9cc1c44b47 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -14,7 +14,7 @@ rootProject.extra["versions"] = dependencyVersions val DEPENDENCY_BOMS = listOf( "com.fasterxml.jackson:jackson-bom:2.14.2", "com.google.guava:guava-bom:31.1-jre", - "com.google.protobuf:protobuf-bom:3.21.12", + "com.google.protobuf:protobuf-bom:3.22.0", "com.linecorp.armeria:armeria-bom:1.22.1", "com.squareup.okhttp3:okhttp-bom:4.10.0", "com.squareup.okio:okio-bom:3.3.0", // applies to transitive dependencies of okhttp diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-jaeger-remote-sampler.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-jaeger-remote-sampler.txt index df26146497b..0730f6d6691 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-jaeger-remote-sampler.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-jaeger-remote-sampler.txt @@ -1,2 +1,67 @@ Comparing source compatibility of against -No changes. \ No newline at end of file +*** MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$OperationSamplingStrategy (compatible) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + --- REMOVED METHOD: PUBLIC(-) FINAL(-) com.google.protobuf.UnknownFieldSet getUnknownFields() +***! MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$OperationSamplingStrategy$Builder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$OperationSamplingStrategy$Builder addRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$OperationSamplingStrategy$Builder clearField(com.google.protobuf.Descriptors$FieldDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$OperationSamplingStrategy$Builder clearOneof(com.google.protobuf.Descriptors$OneofDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$OperationSamplingStrategy$Builder clone() + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$OperationSamplingStrategy$Builder setField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$OperationSamplingStrategy$Builder setRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, int, java.lang.Object) +*** MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$PerOperationSamplingStrategies (compatible) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + --- REMOVED METHOD: PUBLIC(-) FINAL(-) com.google.protobuf.UnknownFieldSet getUnknownFields() +***! MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$PerOperationSamplingStrategies$Builder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$PerOperationSamplingStrategies$Builder addRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$PerOperationSamplingStrategies$Builder clearField(com.google.protobuf.Descriptors$FieldDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$PerOperationSamplingStrategies$Builder clearOneof(com.google.protobuf.Descriptors$OneofDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$PerOperationSamplingStrategies$Builder clone() + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$PerOperationSamplingStrategies$Builder setField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$PerOperationSamplingStrategies$Builder setRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, int, java.lang.Object) +*** MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$ProbabilisticSamplingStrategy (compatible) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + --- REMOVED METHOD: PUBLIC(-) FINAL(-) com.google.protobuf.UnknownFieldSet getUnknownFields() +***! MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$ProbabilisticSamplingStrategy$Builder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$ProbabilisticSamplingStrategy$Builder addRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$ProbabilisticSamplingStrategy$Builder clearField(com.google.protobuf.Descriptors$FieldDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$ProbabilisticSamplingStrategy$Builder clearOneof(com.google.protobuf.Descriptors$OneofDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$ProbabilisticSamplingStrategy$Builder clone() + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$ProbabilisticSamplingStrategy$Builder setField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$ProbabilisticSamplingStrategy$Builder setRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, int, java.lang.Object) +*** MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$RateLimitingSamplingStrategy (compatible) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + --- REMOVED METHOD: PUBLIC(-) FINAL(-) com.google.protobuf.UnknownFieldSet getUnknownFields() +***! MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$RateLimitingSamplingStrategy$Builder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$RateLimitingSamplingStrategy$Builder addRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$RateLimitingSamplingStrategy$Builder clearField(com.google.protobuf.Descriptors$FieldDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$RateLimitingSamplingStrategy$Builder clearOneof(com.google.protobuf.Descriptors$OneofDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$RateLimitingSamplingStrategy$Builder clone() + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$RateLimitingSamplingStrategy$Builder setField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$RateLimitingSamplingStrategy$Builder setRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, int, java.lang.Object) +*** MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyParameters (compatible) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + --- REMOVED METHOD: PUBLIC(-) FINAL(-) com.google.protobuf.UnknownFieldSet getUnknownFields() +***! MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyParameters$Builder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyParameters$Builder addRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyParameters$Builder clearField(com.google.protobuf.Descriptors$FieldDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyParameters$Builder clearOneof(com.google.protobuf.Descriptors$OneofDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyParameters$Builder clone() + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyParameters$Builder setField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyParameters$Builder setRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, int, java.lang.Object) +*** MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyResponse (compatible) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + --- REMOVED METHOD: PUBLIC(-) FINAL(-) com.google.protobuf.UnknownFieldSet getUnknownFields() +***! MODIFIED CLASS: PUBLIC STATIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyResponse$Builder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyResponse$Builder addRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyResponse$Builder clearField(com.google.protobuf.Descriptors$FieldDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyResponse$Builder clearOneof(com.google.protobuf.Descriptors$OneofDescriptor) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyResponse$Builder clone() + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyResponse$Builder setField(com.google.protobuf.Descriptors$FieldDescriptor, java.lang.Object) + ---! REMOVED METHOD: PUBLIC(-) io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling$SamplingStrategyResponse$Builder setRepeatedField(com.google.protobuf.Descriptors$FieldDescriptor, int, java.lang.Object) diff --git a/sdk-extensions/jaeger-remote-sampler/build.gradle.kts b/sdk-extensions/jaeger-remote-sampler/build.gradle.kts index d722859ae92..326cedb4952 100644 --- a/sdk-extensions/jaeger-remote-sampler/build.gradle.kts +++ b/sdk-extensions/jaeger-remote-sampler/build.gradle.kts @@ -25,7 +25,8 @@ dependencies { testImplementation(project(":sdk:testing")) testImplementation(project(":sdk-extensions:autoconfigure")) - testImplementation("com.google.protobuf:protobuf-java-util") + testImplementation("com.google.guava:guava:31.1-jre") + testImplementation("com.google.protobuf:protobuf-java") testImplementation("com.linecorp.armeria:armeria-junit5") testImplementation("com.linecorp.armeria:armeria-grpc-protocol") testImplementation("org.testcontainers:junit-jupiter") @@ -37,8 +38,7 @@ testing { dependencies { implementation(project(":sdk:testing")) implementation(project(":exporters:common")) - - implementation("com.google.protobuf:protobuf-java-util") + implementation("com.google.protobuf:protobuf-java") implementation("com.linecorp.armeria:armeria-junit5") implementation("com.linecorp.armeria:armeria-grpc-protocol") implementation("org.testcontainers:junit-jupiter")