-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial setup of revapi to get API change reports. Still ways to go in tuning it; but would like to have it included in master now to make coming PR's simpler to apply/manage. This adds a profile to run api check - it is not currently activated by default but should be in the future when we have the defaults tuned in to not generate unwarranted noise. Also `revapi.skip` is default true, meaning even when the profile is active no api check will be done on a module unless it defines `revapi.skip=true` in its properties. Thus for now to even have it run you need enable the api-check profile *and* the property. i.e. `mvn -Papi-check -Drevapi.skip=false` If you want to run it for everything (ignoring revapi.skip do the following:: `mvn -Papi-check -Drevapi.skip=false -DskipTests verify` If you want to see it detect changes in dependencies that quarkus exposes/uses add `-Drevapi.checkdeps=true` When run you should get a `target/revapi-results/` in every module that are included in the check. That folder will have a `.json` and `.adoc` file capturing detected API changes/issues. If you want to tweak the format of the `.adoc` file you can change that in revapi/**/*.ftl and do a `mvn install` to have changes picked up.
- Loading branch information
1 parent
0b534d1
commit dc650d3
Showing
5 changed files
with
255 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jboss</groupId> | ||
<artifactId>jboss-parent</artifactId> | ||
<version>36</version> | ||
</parent> | ||
|
||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-revapi-config</artifactId> | ||
<name>Quarkus revapi configuration</name> | ||
<version>999-SNAPSHOT</version> | ||
<description>Contains the configuration of the Revapi API checker and the list of the API changes | ||
in the Quarkus APIs. | ||
</description> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<format.skip>true</format.skip> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<!-- | ||
This is not deployed into a Maven repository. It is merely installed into the local Maven repository | ||
during a local build. | ||
--> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
49 changes: 49 additions & 0 deletions
49
independent-projects/revapi/src/main/resources/META-INF/revapi.ftl
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<#ftl strip_whitespace=true> | ||
<#if reports?has_content> | ||
# API Change analysis Results | ||
|
||
The summary of the API changes between artifacts <#list analysis.oldApi.archives as archive>`${archive.name}`<#sep>, </#list> and | ||
<#list analysis.newApi.archives as archive>`${archive.name}`<#sep>, </#list> | ||
|
||
[cols="1,1,1,1,1", options="header"] | ||
.Changes | ||
|=== | ||
|Code | ||
|Element | ||
|Classification | ||
|Description | ||
|Justification | ||
|
||
<#list reports as report> | ||
|
||
<#list report.differences as diff> | ||
|
||
|${diff.code} | ||
|<#if report.newElement??>*${report.newElement}*</#if> | ||
<#if report.oldElement??>*${report.oldElement}*</#if> | ||
<#if diff.attachments['exampleUseChainInNewApi']??> | ||
Example use chain in new api: | ||
<#list diff.attachments['exampleUseChainInNewApi']?split(" <- ") as e> | ||
<-${e} | ||
</#list> | ||
</#if> | ||
<#if diff.attachments['exampleUseChainInOldApi']?? && diff.attachments['exampleUseChainInNewApi']! != diff.attachments['exampleUseChainInOldApi']> | ||
Example use chain in old api: | ||
<#list diff.attachments['exampleUseChainInOldApi']?split(" <- ") as e> | ||
<-${e} | ||
</#list> | ||
</#if> | ||
<#list diff.attachments?keys as key> | ||
<#if !['newArchive', 'newArchiveRole', 'oldArchive', 'oldArchiveRole','package','classQualifiedName','classSimpleName','elementKind','exception','methodName','exampleUseChainInNewApi','exampleUseChainInOldApi','fieldName']?seq_contains(key)> | ||
${key} = ${diff.attachments[key]} | ||
</#if> | ||
</#list> | ||
|<#list diff.classification?keys as compat><#if diff.classification?api.get(compat) != "NON_BREAKING"> ${compat?capitalize}: ${diff.classification?api.get(compat)?capitalize?replace("_","")}${'\n'}</#if></#list> | ||
|${diff.description} | ||
|${diff.justification!""} | ||
</#list> | ||
</#list> | ||
|=== | ||
</#if> |
31 changes: 31 additions & 0 deletions
31
independent-projects/revapi/src/main/resources/revapi/revapi-configuration.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<!-- The basic configuration for Revapi API checks in all modules that have API checks enabled. --> | ||
<analysisConfiguration> | ||
<revapi.java> | ||
<missing-classes> | ||
<behavior>error</behavior> | ||
<ignoreMissingAnnotations>true</ignoreMissingAnnotations> | ||
</missing-classes> | ||
<filter> | ||
<packages> | ||
<regex>true</regex> | ||
<exclude><item>javax\..*</item></exclude> | ||
</packages> | ||
</filter> | ||
</revapi.java> | ||
<!-- <revapi.reporter.text id="stdout"> | ||
<output>out</output> | ||
<template>revapi.ftl</template> | ||
</revapi.reporter.text> --> | ||
<revapi.reporter.text> | ||
<minSeverity>NON_BREAKING</minSeverity> | ||
<output>${project.build.directory}/revapi-results/revapi-breakages.adoc</output> | ||
<template>revapi.ftl</template> | ||
</revapi.reporter.text> | ||
<revapi.reporter.json> | ||
<minSeverity>NON_BREAKING</minSeverity> | ||
<output>${project.build.directory}/revapi-results/revapi-breakages.json</output> | ||
<indent>true</indent> | ||
<keepEmptyFile>true</keepEmptyFile> | ||
</revapi.reporter.json> | ||
</analysisConfiguration> |
This file contains 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