Skip to content
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
53 changes: 53 additions & 0 deletions .github/workflows/breaking.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: breaking
on:
pull_request:

jobs:
broken-changes:
concurrency:
group: broken-changes-${{ github.ref }}
cancel-in-progress: true
if: (!contains(github.event.pull_request.labels.*.name, 'broken changes'))
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'temurin'
cache: 'maven'

- name: Build
run: mvn -DskipTests -ntp install

- name: Check broken API changes
run: set -o pipefail && mvn org.revapi:revapi-maven-plugin:report-aggregate -DskipTests -ntp

- name: Generate backward compatibility report
run: |
cat changes.txt
touch report.txt

if [ -s changes.txt ]; then
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
echo "Backward compatibility check report" >> report.txt
echo "======" >> report.txt
cat changes.txt >> report.txt
else
echo "CHANGES_DETECTED=false" >> $GITHUB_ENV
fi

# Skip comment for forks - GITHUB_TOKEN doesn't have write permissions for external PRs
- name: Comment Report
if: always() && github.event.pull_request.head.repo.full_name == github.repository && env.CHANGES_DETECTED == 'true'
uses: marocchino/sticky-pull-request-comment@v2
with:
path: report.txt
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: diff
16 changes: 16 additions & 0 deletions config/revapi-report-template.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<#if reports?has_content>
```
<#list analysis.oldApi.archives as archive>${archive.name}<#sep>, </#list>
<#list analysis.newApi.archives as archive>${archive.name}<#sep>, </#list>
```

<#list reports as report>
>***Old: ${report.oldElement!"<none>"}***
>***New: ${report.newElement!"<none>"}***
<#list report.differences as diff>
> ${diff.code}<#if diff.description??>: ${diff.description}</#if>
</#list>

</#list>
---
</#if>
37 changes: 37 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<testcontainers.version>2.0.3</testcontainers.version>
<!-- last version with JDK8 compability -->
<apache.arrow.version>17.0.0</apache.arrow.version>
<maven-revapi-plugin.version>0.15.1</maven-revapi-plugin.version>
</properties>

<licenses>
Expand Down Expand Up @@ -184,6 +185,42 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.revapi</groupId>
<artifactId>revapi-maven-plugin</artifactId>
<version>${maven-revapi-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.revapi</groupId>
<artifactId>revapi-java</artifactId>
<version>0.28.4</version>
</dependency>
<dependency>
<groupId>org.revapi</groupId>
<artifactId>revapi-reporter-text</artifactId>
<version>${maven-revapi-plugin.version}</version>
</dependency>
</dependencies>
<configuration>
<analysisConfiguration>
<revapi.filter>
<archives>
<include>
<item>tech.ydb.*</item>
</include>
</archives>
</revapi.filter>
<revapi.reporter.text>
<minSeverity>BREAKING</minSeverity>
<minCriticality>documented</minCriticality>
<output>changes.txt</output>
<template>/config/revapi-report-template.ftl</template>
<append>true</append>
<keepEmptyFile>true</keepEmptyFile>
</revapi.reporter.text>
</analysisConfiguration>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
Loading