Finalize Revapi setup: * Switched off by default with only gremlin-core having it active * Explicitly sets the severity of problems to fail the build with to "potentiallyBreaking". * The parent pom only includes common setup. * Other setup (like what packages to include in a check and what changes to ignore because they are intentional) is externalized into per-module configuration files.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1e09cce2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1e09cce2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1e09cce2 Branch: refs/heads/TINKERPOP-1443 Commit: 1e09cce24fb965d91746742af748958482d0414d Parents: 31d815e Author: Lukas Krejci <lkre...@redhat.com> Authored: Mon Nov 28 23:28:06 2016 +0100 Committer: Stephen Mallette <sp...@genoprime.com> Committed: Wed Feb 15 06:45:05 2017 -0500 ---------------------------------------------------------------------- gremlin-core/api-changes.json | 28 ++++++++++++++++++++++++ gremlin-core/api-contents.json | 22 +++++++++++++++++++ gremlin-core/pom.xml | 3 +++ gremlin-groovy-test/pom.xml | 3 --- gremlin-python/pom.xml | 1 - gremlin-test/pom.xml | 3 --- pom.xml | 43 ++++++++++++++++++++++++++----------- 7 files changed, 84 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1e09cce2/gremlin-core/api-changes.json ---------------------------------------------------------------------- diff --git a/gremlin-core/api-changes.json b/gremlin-core/api-changes.json new file mode 100644 index 0000000..95b8038 --- /dev/null +++ b/gremlin-core/api-changes.json @@ -0,0 +1,28 @@ +// Example: +// { +// "3.3.0": { +// "revapi": { +// "ignore": [ +// { +// "code": "java.method.addedToInterface", +// "new": "method void org.apache.tinkerpop.gremlin.structure.Graph::solveWorldHunger()", +// "justification": "Gremlin became sentient and self-aware. This is what it/she/he did first." +// } +// ] +// } +// }, +// "3.3.1": { +// "revapi": { +// "ignore": [ +// { +// "code": "java.method.removed", +// "old": "method void org.apache.tinkerpop.gremlin.structure.Graph::solveWorldHunger()", +// "justification": "Gremlin has a strange sense of humour." +// } +// ] +// } +// }, +// ... +// } +{ +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1e09cce2/gremlin-core/api-contents.json ---------------------------------------------------------------------- diff --git a/gremlin-core/api-contents.json b/gremlin-core/api-contents.json new file mode 100644 index 0000000..aca7f54 --- /dev/null +++ b/gremlin-core/api-contents.json @@ -0,0 +1,22 @@ +{ + "revapi": { + "java": { + "filter": { + "packages": { + "regex": true, + //gremlin-shaded includes a lot of stuff from 3rd party libraries that break their API between + //versions. Let's just not consider them part of Tinkerpop API. --> + "exclude": ["org\\.apache\\.tinkerpop\\.shaded(\\..+)?"], + "include": [ + //Be aware that the definitions below do NOT include the subpackages... + "org\\.apache\\.tinkerpop\\.gremlin\\.structure", + "org\\.apache\\.tinkerpop\\.gremlin\\.structure\\.io", + "org\\.apache\\.tinkerpop\\.gremlin\\.process\\.computer", + "org\\.apache\\.tinkerpop\\.gremlin\\.process\\.traversal", + "org\\.apache\\.tinkerpop\\.gremlin\\.process\\.traversal.dsl.graph" + ] + } + } + } + } +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1e09cce2/gremlin-core/pom.xml ---------------------------------------------------------------------- diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml index 91a4055..c2a6b76 100644 --- a/gremlin-core/pom.xml +++ b/gremlin-core/pom.xml @@ -24,6 +24,9 @@ limitations under the License. </parent> <artifactId>gremlin-core</artifactId> <name>Apache TinkerPop :: Gremlin Core</name> + <properties> + <revapi.skip>false</revapi.skip> + </properties> <dependencies> <dependency> <groupId>org.apache.tinkerpop</groupId> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1e09cce2/gremlin-groovy-test/pom.xml ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/pom.xml b/gremlin-groovy-test/pom.xml index fb98c00..853b59f 100644 --- a/gremlin-groovy-test/pom.xml +++ b/gremlin-groovy-test/pom.xml @@ -25,9 +25,6 @@ limitations under the License. </parent> <artifactId>gremlin-groovy-test</artifactId> <name>Apache TinkerPop :: Gremlin Groovy Test</name> - <properties> - <revapi.skip>true</revapi.skip> - </properties> <dependencies> <dependency> <groupId>org.apache.tinkerpop</groupId> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1e09cce2/gremlin-python/pom.xml ---------------------------------------------------------------------- diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml index ad408ac..8935dfc 100644 --- a/gremlin-python/pom.xml +++ b/gremlin-python/pom.xml @@ -75,7 +75,6 @@ <maven.test.skip>false</maven.test.skip> <skipTests>${maven.test.skip}</skipTests> <gremlin.server.dir>${project.parent.basedir}/gremlin-server</gremlin.server.dir> - <revapi.skip>true</revapi.skip> </properties> <build> <directory>${basedir}/target</directory> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1e09cce2/gremlin-test/pom.xml ---------------------------------------------------------------------- diff --git a/gremlin-test/pom.xml b/gremlin-test/pom.xml index 6c8fdd2..f316188 100644 --- a/gremlin-test/pom.xml +++ b/gremlin-test/pom.xml @@ -25,9 +25,6 @@ limitations under the License. </parent> <artifactId>gremlin-test</artifactId> <name>Apache TinkerPop :: Gremlin Test</name> - <properties> - <revapi.skip>true</revapi.skip> - </properties> <dependencies> <dependency> <groupId>org.apache.tinkerpop</groupId> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1e09cce2/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 993737f..cef32b7 100644 --- a/pom.xml +++ b/pom.xml @@ -160,6 +160,9 @@ limitations under the License. <log4j-silent.properties>file:target/test-classes/log4j-silent.properties</log4j-silent.properties> <muteTestLogs>false</muteTestLogs> + + <!-- By default API checks are not run. Modules can opt in by setting this property to false in their poms. --> + <revapi.skip>true</revapi.skip> </properties> <build> <directory>${basedir}/target</directory> @@ -326,6 +329,20 @@ limitations under the License. </dependency> </dependencies> </plugin> + <!-- Needed to figure out the version components when reading revapi API check config below --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>parse-version</id> + <goals> + <goal>parse-version</goal> + </goals> + <phase>validate</phase> + </execution> + </executions> + </plugin> <plugin> <groupId>org.revapi</groupId> <artifactId>revapi-maven-plugin</artifactId> @@ -338,21 +355,11 @@ limitations under the License. </dependency> </dependencies> <configuration> - + <skip>${revapi.skip}</skip> + <failSeverity>potentiallyBreaking</failSeverity> <analysisConfiguration><![CDATA[ { "revapi": { - "java": { - "filter": { - //gremlin-shaded includes a lot of stuff from 3rd party libraries that break their API between - //versions. Let's just not consider them part of Tinkerpop API. --> - "packages": { - "regex": true, - "exclude": ["org\\.apache\\.tinkerpop\\.shaded(\\..+)?"], - "include": ["org\\.apache\\.tinkerpop(\\..+)?"] - } - } - }, "semver": { "ignore": { "enabled": true, @@ -367,6 +374,18 @@ limitations under the License. } } ]]></analysisConfiguration> + <analysisConfigurationFiles> + <configurationFile> + <path>${project.basedir}/api-changes.json</path> + <roots> + <root>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</root> + </roots> + </configurationFile> + <configurationFile> + <path>${project.basedir}/api-contents.json</path> + </configurationFile> + </analysisConfigurationFiles> + <failOnMissingConfigurationFiles>false</failOnMissingConfigurationFiles> </configuration> <executions> <execution>