Skip to content

CASSJAVA-102: Fix revapi surious complaints about optional dependencies #2042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: 4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile-datastax
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work out of the gate; I have to update the AMI def for the runner that executes this logic to include a new Jenkins version. This can probably stay as 3.8.8 is the current 3.8.x release as of this writing... I'm just saying it's not enough by itself.

I'll take care of adding the new version to the runner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of that - the definition of the AMI isn't in a place I can modify it (DS-internal)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR to make this change is now up

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The corresponding PR for the DataStax Jenkins runner has been merged and I'm working on building a new runner now. Assuming we merge this once we have an image on the ASF CI side that includes the proper version of Maven I think we'll be all set.

In short: there's no reason to take this out that I can see.

env.PATH = "${env.MAVEN_HOME}/bin:${env.PATH}"

/*
Expand Down
25 changes: 23 additions & 2 deletions core/revapi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Configures Revapi (https://revapi.org/getting-started.html) to check API compatibility between
// successive driver versions.
{
"revapi": {
"java": {
Expand Down Expand Up @@ -7386,6 +7384,29 @@
"old": "method <T extends java.lang.Number> com.datastax.oss.driver.api.core.type.reflect.GenericType<com.datastax.oss.driver.api.core.data.CqlVector<T>> com.datastax.oss.driver.api.core.type.reflect.GenericType<T>::vectorOf(java.lang.Class<T>)",
"new": "method <T> com.datastax.oss.driver.api.core.type.reflect.GenericType<com.datastax.oss.driver.api.core.data.CqlVector<T>> com.datastax.oss.driver.api.core.type.reflect.GenericType<T>::vectorOf(java.lang.Class<T>)",
"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": "CASSJAVA-102: Fix spurious complaints about optional dependencies"
},
{
"code": "java.class.nonPublicPartOfAPI",
"old": "class com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer",
"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": "CASSJAVA-102: Fix spurious complaints about optional dependencies"
},
{
"code": "java.class.externalClassExposedInAPI",
"justification": "CASSJAVA-102: Migrate revapi config into dedicated config files, ported from pom.xml"
},
{
"code": "java.method.varargOverloadsOnlyDifferInVarargParameter",
"justification": "CASSJAVA-102: Migrate revapi config into dedicated config files, ported from pom.xml"
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions mapper-runtime/revapi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Configures Revapi (https://revapi.org/getting-started.html) to check API compatibility between
// successive driver versions.
{
"revapi": {
"java": {
Expand All @@ -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(\\..+)?"
]
Expand All @@ -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",
Expand Down
45 changes: 29 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -561,28 +561,23 @@
<plugin>
<groupId>org.revapi</groupId>
<artifactId>revapi-maven-plugin</artifactId>
<version>0.10.5</version>
<version>0.15.1</version>
<configuration>
<outputNonIdentifyingDifferenceInfo>false</outputNonIdentifyingDifferenceInfo>
<versionFormat>\d+\.\d+\.\d+</versionFormat>
<analysisConfiguration>
<revapi.ignore>
<item>
<!-- We don't consider this a problem -->
<code>java.class.externalClassExposedInAPI</code>
</item>
</revapi.ignore>
</analysisConfiguration>
<oldArtifacts>
<!-- The previous release used DataStax groupId, remove this after the next release -->
<artifact>${project.groupId}:${project.artifactId}:RELEASE</artifact>
</oldArtifacts>
<analysisConfigurationFiles>
<file>revapi.json</file>
</analysisConfigurationFiles>
</configuration>
<dependencies>
<dependency>
<groupId>org.revapi</groupId>
<artifactId>revapi-java</artifactId>
<version>0.22.1</version>
<version>0.28.4</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -596,9 +591,33 @@
<artifactId>flatten-maven-plugin</artifactId>
<version>1.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<!-- revapi 0.15.1 requires Maven version 3.8.1 -->
<version>[3.8.1,)</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
Expand Down Expand Up @@ -901,12 +920,6 @@ limitations under the License.]]></inlineHeader>
<goals>
<goal>check</goal>
</goals>
<configuration>
<analysisConfigurationFiles>
<!-- Present at the root of each module that doesn't skip this goal -->
<analysisConfigurationFile>revapi.json</analysisConfigurationFile>
</analysisConfigurationFiles>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
9 changes: 5 additions & 4 deletions query-builder/revapi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Configures Revapi (https://revapi.org/getting-started.html) to check API compatibility between
// successive driver versions.
{
"revapi": {
"java": {
Expand All @@ -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(\\..+)?"
]
}
Expand Down Expand Up @@ -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": "CASSJAVA-102: Suppress newly-supported varargs check"
}
]
}
}

4 changes: 1 addition & 3 deletions test-infra/revapi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Configures Revapi (https://revapi.org/getting-started.html) to check API compatibility between
// successive driver versions.
{
"revapi": {
"java": {
Expand All @@ -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(\\..+)?"
]
}
Expand Down