From 3da63b74165cc5ad645f4ce247c95e7a88a2aff9 Mon Sep 17 00:00:00 2001 From: Abe Ratnofsky Date: Tue, 20 May 2025 19:06:14 -0400 Subject: [PATCH 1/9] Add working revapi configuration --- core/revapi.json | 23 +++++++++++++++++++++++ pom.xml | 27 ++++++++++----------------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/core/revapi.json b/core/revapi.json index 5aa46a3ccad..605a6093168 100644 --- a/core/revapi.json +++ b/core/revapi.json @@ -7386,6 +7386,29 @@ "old": "method com.datastax.oss.driver.api.core.type.reflect.GenericType> com.datastax.oss.driver.api.core.type.reflect.GenericType::vectorOf(java.lang.Class)", "new": "method com.datastax.oss.driver.api.core.type.reflect.GenericType> com.datastax.oss.driver.api.core.type.reflect.GenericType::vectorOf(java.lang.Class)", "justification": "JAVA-3143: Extend driver vector support to arbitrary subtypes and fix handling of variable length types (OSS C* 5.0)" + }, + { + "code": "java.class.nonPublicPartOfAPI", + "old": "class com.datastax.oss.driver.internal.core.config.typesafe.TypesafeDriverExecutionProfile.Base", + "justification": "ABE STRUGGLING WITH REVAPI" + }, + { + "code": "java.class.nonPublicPartOfAPI", + "old": "class com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer", + "justification": "ABE STRUGGLING WITH REVAPI" + }, + { + "code": "java.class.nonPublicPartOfAPI", + "old": "class org.apache.tinkerpop.shaded.jackson.databind.type.TypeParser.MyTokenizer", + "justification": "ABE STRUGGLING WITH REVAPI" + }, + { + "code": "java.class.externalClassExposedInAPI", + "justification": "PORTED FROM pom.xml" + }, + { + "code": "java.method.varargOverloadsOnlyDifferInVarargParameter", + "justification": "PORTED FROM pom.xml" } ] } diff --git a/pom.xml b/pom.xml index e5cfb58f94d..8f2723e0cf9 100644 --- a/pom.xml +++ b/pom.xml @@ -561,28 +561,27 @@ org.revapi revapi-maven-plugin - 0.10.5 + 0.15.1 false \d+\.\d+\.\d+ - - - - - java.class.externalClassExposedInAPI - - - - ${project.groupId}:${project.artifactId}:RELEASE + ${project.groupId}:${project.artifactId}:4.19.0 + + + ${project.groupId}:${project.artifactId}:4.19.0 + + + revapi.json + org.revapi revapi-java - 0.22.1 + 0.28.4 @@ -901,12 +900,6 @@ limitations under the License.]]> check - - - - revapi.json - - From c68534d774e87c27edf26030c919237256add609 Mon Sep 17 00:00:00 2001 From: Abe Ratnofsky Date: Tue, 20 May 2025 19:05:31 -0400 Subject: [PATCH 2/9] Compare against latest snapshot --- pom.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 8f2723e0cf9..f2a1eeaf749 100644 --- a/pom.xml +++ b/pom.xml @@ -567,12 +567,8 @@ \d+\.\d+\.\d+ - ${project.groupId}:${project.artifactId}:4.19.0 + ${project.groupId}:${project.artifactId}:RELEASE - - - ${project.groupId}:${project.artifactId}:4.19.0 - revapi.json From de80643907ae8033d41eb1a137cc2e82ef5f0164 Mon Sep 17 00:00:00 2001 From: Abe Ratnofsky Date: Tue, 20 May 2025 19:05:35 -0400 Subject: [PATCH 3/9] Fixup revapi config files --- core/revapi.json | 2 -- mapper-runtime/revapi.json | 6 ++---- query-builder/revapi.json | 9 +++++---- test-infra/revapi.json | 4 +--- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/core/revapi.json b/core/revapi.json index 605a6093168..d3e5f83a6b2 100644 --- a/core/revapi.json +++ b/core/revapi.json @@ -1,5 +1,3 @@ -// Configures Revapi (https://revapi.org/getting-started.html) to check API compatibility between -// successive driver versions. { "revapi": { "java": { diff --git a/mapper-runtime/revapi.json b/mapper-runtime/revapi.json index 18d26a7f7e9..3dc2ea21671 100644 --- a/mapper-runtime/revapi.json +++ b/mapper-runtime/revapi.json @@ -1,5 +1,3 @@ -// Configures Revapi (https://revapi.org/getting-started.html) to check API compatibility between -// successive driver versions. { "revapi": { "java": { @@ -11,7 +9,7 @@ "com\\.datastax\\.(oss|dse)\\.driver\\.internal(\\..+)?", "com\\.datastax\\.oss\\.driver\\.shaded(\\..+)?", "com\\.datastax\\.oss\\.simulacron(\\..+)?", - // Don't re-check sibling modules that this module depends on + "// Don't re-check sibling modules that this module depends on", "com\\.datastax\\.(oss|dse)\\.driver\\.api\\.core(\\..+)?", "com\\.datastax\\.(oss|dse)\\.driver\\.api\\.querybuilder(\\..+)?" ] @@ -22,7 +20,7 @@ { "regex": true, "code": "java.annotation.attributeValueChanged", - "old": "@interface com\.datastax\.oss\.driver\.api\.mapper\.annotations\..*", + "old": "@interface com\\.datastax\\.oss\\.driver\\.api\\.mapper\\.annotations\\..*", "annotationType": "java.lang.annotation.Retention", "attribute": "value", "oldValue": "java.lang.annotation.RetentionPolicy.CLASS", diff --git a/query-builder/revapi.json b/query-builder/revapi.json index c4d8aa27212..16b674d7fe5 100644 --- a/query-builder/revapi.json +++ b/query-builder/revapi.json @@ -1,5 +1,3 @@ -// Configures Revapi (https://revapi.org/getting-started.html) to check API compatibility between -// successive driver versions. { "revapi": { "java": { @@ -11,7 +9,7 @@ "com\\.datastax\\.(oss|dse)\\.driver\\.internal(\\..+)?", "com\\.datastax\\.oss\\.driver\\.shaded(\\..+)?", "org\\.assertj(\\..+)?", - // Don't re-check sibling modules that this module depends on + "// Don't re-check sibling modules that this module depends on", "com\\.datastax\\.(oss|dse)\\.driver\\.api\\.core(\\..+)?" ] } @@ -2782,8 +2780,11 @@ "code": "java.method.addedToInterface", "new": "method com.datastax.oss.driver.api.querybuilder.select.Select com.datastax.oss.driver.api.querybuilder.select.Select::orderByAnnOf(com.datastax.oss.driver.api.core.CqlIdentifier, com.datastax.oss.driver.api.core.data.CqlVector)", "justification": "JAVA-3118: Add support for vector data type in Schema Builder, QueryBuilder" + }, + { + "code": "java.method.varargOverloadsOnlyDifferInVarargParameter", + "justification": "ABE" } ] } } - diff --git a/test-infra/revapi.json b/test-infra/revapi.json index c75a98cb4af..293d9f4d142 100644 --- a/test-infra/revapi.json +++ b/test-infra/revapi.json @@ -1,5 +1,3 @@ -// Configures Revapi (https://revapi.org/getting-started.html) to check API compatibility between -// successive driver versions. { "revapi": { "java": { @@ -12,7 +10,7 @@ "com\\.datastax\\.oss\\.driver\\.shaded(\\..+)?", "com\\.datastax\\.oss\\.simulacron(\\..+)?", "org\\.assertj(\\..+)?", - // Don't re-check sibling modules that this module depends on + "// Don't re-check sibling modules that this module depends on", "com\\.datastax\\.(oss|dse)\\.driver\\.api\\.core(\\..+)?" ] } From b87a11242344a43c583044eb45f1da872d31ee12 Mon Sep 17 00:00:00 2001 From: Abe Ratnofsky Date: Tue, 20 May 2025 19:05:43 -0400 Subject: [PATCH 4/9] Add example of API-breaking change, to test revapi Example error: [ERROR] Failed to execute goal org.revapi:revapi-maven-plugin:0.15.1:check (default) on project java-driver-core: The following API problems caused the build to fail: [ERROR] java.field.enumConstantOrderChanged: field com.datastax.oss.driver.api.core.config.DefaultDriverOption.ADDRESS_TRANSLATOR_CLASS: The enum constant was defined on position 61 but is now on 62. The user code can break if it relies on the return value of the "ordinal()" method. https://revapi.org/revapi-java/differences.html#java.field.enumConstantOrderChanged ... --- .../oss/driver/api/core/config/DefaultDriverOption.java | 1 + .../oss/driver/api/core/config/TypedDriverOption.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java b/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java index 6ffd51d86ef..ddce201106b 100644 --- a/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java +++ b/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java @@ -30,6 +30,7 @@ public enum DefaultDriverOption implements DriverOption { * *

Value type: {@link java.util.List List}<{@link String}> */ + UHOH("uhoh"), CONTACT_POINTS("basic.contact-points"), /** * A name that uniquely identifies the driver instance. diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java b/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java index 93e2b468461..3d3a5c0fdc8 100644 --- a/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java +++ b/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java @@ -105,6 +105,10 @@ public String toString() { .toString(); } + /** The contact points to use for the initial connection to the cluster. */ + public static final TypedDriverOption UHOH = + new TypedDriverOption<>(DefaultDriverOption.UHOH, GenericType.STRING); + /** The contact points to use for the initial connection to the cluster. */ public static final TypedDriverOption> CONTACT_POINTS = new TypedDriverOption<>(DefaultDriverOption.CONTACT_POINTS, GenericType.listOf(String.class)); From 645920715f61e4a303912d9f3fbc863ec4cf9d41 Mon Sep 17 00:00:00 2001 From: Abe Ratnofsky Date: Tue, 20 May 2025 19:17:16 -0400 Subject: [PATCH 5/9] Revert "Add example of API-breaking change, to test revapi" This reverts commit b87a11242344a43c583044eb45f1da872d31ee12. --- .../oss/driver/api/core/config/DefaultDriverOption.java | 1 - .../oss/driver/api/core/config/TypedDriverOption.java | 4 ---- 2 files changed, 5 deletions(-) diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java b/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java index ddce201106b..6ffd51d86ef 100644 --- a/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java +++ b/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java @@ -30,7 +30,6 @@ public enum DefaultDriverOption implements DriverOption { * *

Value type: {@link java.util.List List}<{@link String}> */ - UHOH("uhoh"), CONTACT_POINTS("basic.contact-points"), /** * A name that uniquely identifies the driver instance. diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java b/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java index 3d3a5c0fdc8..93e2b468461 100644 --- a/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java +++ b/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java @@ -105,10 +105,6 @@ public String toString() { .toString(); } - /** The contact points to use for the initial connection to the cluster. */ - public static final TypedDriverOption UHOH = - new TypedDriverOption<>(DefaultDriverOption.UHOH, GenericType.STRING); - /** The contact points to use for the initial connection to the cluster. */ public static final TypedDriverOption> CONTACT_POINTS = new TypedDriverOption<>(DefaultDriverOption.CONTACT_POINTS, GenericType.listOf(String.class)); From 59befed728a3643a7b37e442aef56c9135383e45 Mon Sep 17 00:00:00 2001 From: Abe Ratnofsky Date: Tue, 20 May 2025 19:13:55 -0400 Subject: [PATCH 6/9] Improve documentation of revapi suppressions --- core/revapi.json | 10 +++++----- query-builder/revapi.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/revapi.json b/core/revapi.json index d3e5f83a6b2..f39c7d4a7c0 100644 --- a/core/revapi.json +++ b/core/revapi.json @@ -7388,25 +7388,25 @@ { "code": "java.class.nonPublicPartOfAPI", "old": "class com.datastax.oss.driver.internal.core.config.typesafe.TypesafeDriverExecutionProfile.Base", - "justification": "ABE STRUGGLING WITH REVAPI" + "justification": "CASSJAVA-102: Fix spurious complaints about optional dependencies" }, { "code": "java.class.nonPublicPartOfAPI", "old": "class com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer", - "justification": "ABE STRUGGLING WITH REVAPI" + "justification": "CASSJAVA-102: Fix spurious complaints about optional dependencies" }, { "code": "java.class.nonPublicPartOfAPI", "old": "class org.apache.tinkerpop.shaded.jackson.databind.type.TypeParser.MyTokenizer", - "justification": "ABE STRUGGLING WITH REVAPI" + "justification": "CASSJAVA-102: Fix spurious complaints about optional dependencies" }, { "code": "java.class.externalClassExposedInAPI", - "justification": "PORTED FROM pom.xml" + "justification": "CASSJAVA-102: Migrate revapi config into dedicated config files, ported from pom.xml" }, { "code": "java.method.varargOverloadsOnlyDifferInVarargParameter", - "justification": "PORTED FROM pom.xml" + "justification": "CASSJAVA-102: Migrate revapi config into dedicated config files, ported from pom.xml" } ] } diff --git a/query-builder/revapi.json b/query-builder/revapi.json index 16b674d7fe5..ed97379332c 100644 --- a/query-builder/revapi.json +++ b/query-builder/revapi.json @@ -2783,7 +2783,7 @@ }, { "code": "java.method.varargOverloadsOnlyDifferInVarargParameter", - "justification": "ABE" + "justification": "CASSJAVA-102: Suppress newly-supported varargs check" } ] } From 74e9b8988b3a73c4b9f71d1dcae6aa5895511686 Mon Sep 17 00:00:00 2001 From: Abe Ratnofsky Date: Tue, 20 May 2025 19:21:06 -0400 Subject: [PATCH 7/9] Note examples of errors when java.method.varargOverloadsOnlyDifferInVarargParameter is enabled [ERROR] Failed to execute goal org.revapi:revapi-maven-plugin:0.15.1:check (default) on project java-driver-query-builder: The following API problems caused the build to fail: [ERROR] java.method.varargOverloadsOnlyDifferInVarargParameter: method com.datastax.dse.driver.api.querybuilder.schema.AlterDseTableDropColumnEnd com.datastax.dse.driver.api.querybuilder.schema.AlterDseTableDropColumn::dropColumns(com.datastax.oss.driver.api.core.CqlIdentifier[]): Method only differs in the vararg type from some of its overloads: [method com.datastax.dse.driver.api.querybuilder.schema.AlterDseTableDropColumnEnd com.datastax.dse.driver.api.querybuilder.schema.AlterDseTableDropColumn::dropColumns(java.lang.String[])]. https://revapi.org/revapi-java/differences.html#java.method.varargOverloadsOnlyDifferInVarargParameter [ERROR] java.method.varargOverloadsOnlyDifferInVarargParameter: method com.datastax.dse.driver.api.querybuilder.schema.AlterDseTableDropColumnEnd com.datastax.dse.driver.api.querybuilder.schema.AlterDseTableDropColumn::dropColumns(java.lang.String[]): Method only differs in the vararg type from some of its overloads: [method com.datastax.dse.driver.api.querybuilder.schema.AlterDseTableDropColumnEnd com.datastax.dse.driver.api.querybuilder.schema.AlterDseTableDropColumn::dropColumns(com.datastax.oss.driver.api.core.CqlIdentifier[])]. https://revapi.org/revapi-java/differences.html#java.method.varargOverloadsOnlyDifferInVarargParameter [ERROR] java.method.varargOverloadsOnlyDifferInVarargParameter: method com.datastax.oss.driver.api.querybuilder.relation.MultiColumnRelationBuilder com.datastax.oss.driver.api.querybuilder.relation.OngoingWhereClause>::whereColumns(com.datastax.oss.driver.api.core.CqlIdentifier[]): Method only differs in the vararg type from some of its overloads: [method com.datastax.oss.driver.api.querybuilder.relation.MultiColumnRelationBuilder com.datastax.oss.driver.api.querybuilder.relation.OngoingWhereClause>::whereColumns(java.lang.String[])]. https://revapi.org/revapi-java/differences.html#java.method.varargOverloadsOnlyDifferInVarargParameter From 1fec38381254532e84edf791eb814ddfe557038b Mon Sep 17 00:00:00 2001 From: Abe Ratnofsky Date: Mon, 9 Jun 2025 14:49:37 -0700 Subject: [PATCH 8/9] Upgrade reference to Maven 3.8.8, depends on https://github.com/apache/cassandra-builds/pull/117 --- Jenkinsfile-datastax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-datastax b/Jenkinsfile-datastax index af1aab6e0f4..73b977bdf9f 100644 --- a/Jenkinsfile-datastax +++ b/Jenkinsfile-datastax @@ -27,7 +27,7 @@ def initializeEnvironment() { env.GITHUB_BRANCH_URL = "${GITHUB_PROJECT_URL}/tree/${env.BRANCH_NAME}" env.GITHUB_COMMIT_URL = "${GITHUB_PROJECT_URL}/commit/${env.GIT_COMMIT}" - env.MAVEN_HOME = "${env.HOME}/.mvn/apache-maven-3.6.3" + env.MAVEN_HOME = "${env.HOME}/.mvn/apache-maven-3.8.8" env.PATH = "${env.MAVEN_HOME}/bin:${env.PATH}" /* From 3920f2e7f2a1d8ac44c87b4edfa6f2e79a27b5c7 Mon Sep 17 00:00:00 2001 From: Abe Ratnofsky Date: Tue, 10 Jun 2025 15:18:39 -0700 Subject: [PATCH 9/9] Add maven-enforcer-plugin --- pom.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pom.xml b/pom.xml index f2a1eeaf749..2cfeb65e757 100644 --- a/pom.xml +++ b/pom.xml @@ -591,9 +591,33 @@ flatten-maven-plugin 1.2.1 + + org.apache.maven.plugins + maven-enforcer-plugin + 3.5.0 + + + maven-enforcer-plugin + + + enforce-maven + + enforce + + + + + + [3.8.1,) + + + + + + maven-compiler-plugin