Skip to content

Commit 109e810

Browse files
authored
build(api): add japicmp binary-compatibility gate vs v1.6.5 (E1) (#84)
Tracks the public surface against the last published release on every pull request so an unintended binary break is caught before merge — the foundation Track E of the v1.6.6 Maven Central debut depends on. Changes: - pom.xml: new `japicmp` profile carrying japicmp-maven-plugin and a profile-local JitPack repository (downstream consumers do NOT inherit it). Pinned versions in properties: japicmp.version=0.23.1, japicmp.baseline=v1.6.5. The plugin binds its cmp goal to the verify phase, so `mvn -P japicmp verify` runs the diff after building the jar. - .github/workflows/ci.yml: new `binary-compat` job, PR-only, runs `mvnw -DskipTests -P japicmp verify -pl .` after the guards job and uploads the report directory as an artifact. - CHANGELOG.md: opens a `## v1.6.6 — Planned` entry with a Build subsection documenting the gate, its phased policy (binary breaks fail the build, source breaks reported only), and the local invocation. Policy: - breakBuildOnBinaryIncompatibleModifications=true - breakBuildOnSourceIncompatibleModifications=false (phased; will tighten) - onlyModified=true; reports HTML/MD/XML/diff under target/japicmp/ Local verification: `mvnw -P japicmp verify -pl .` against develop returns `No changes. Semantic versioning suggestion: 0.0.1` — develop is bit-identical to v1.6.5 at the jar level, as expected fresh after the release. The next public-surface PR will exercise the gate end-to-end.
1 parent b80fa5d commit 109e810

3 files changed

Lines changed: 120 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,41 @@ jobs:
118118
path: examples/target/generated-pdfs/**
119119
if-no-files-found: error
120120

121+
binary-compat:
122+
name: Binary Compatibility (japicmp vs v1.6.5)
123+
if: github.event_name == 'pull_request'
124+
needs: architecture-and-documentation-guards
125+
runs-on: ubuntu-latest
126+
env:
127+
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
128+
129+
steps:
130+
- name: Check out repository
131+
uses: actions/checkout@v6
132+
133+
- name: Set up Temurin JDK 17
134+
uses: actions/setup-java@v5
135+
with:
136+
distribution: temurin
137+
java-version: '17'
138+
cache: maven
139+
140+
- name: Compare public API against baseline
141+
# The `japicmp` profile pulls the v1.6.5 jar from JitPack and
142+
# diffs it against the freshly-built artifact. Fails the job on
143+
# any binary-incompatible modification to the public surface.
144+
# Source-incompatible changes are reported only (phased policy).
145+
# See Track E1 in the v1.6.5→1.7 readiness taskboard.
146+
run: ./mvnw -B -ntp -DskipTests -P japicmp verify -pl .
147+
148+
- name: Upload japicmp report
149+
if: always()
150+
uses: actions/upload-artifact@v7
151+
with:
152+
name: japicmp-report-${{ github.run_id }}
153+
path: target/japicmp/**
154+
if-no-files-found: ignore
155+
121156
perf-smoke:
122157
name: Performance Smoke Check
123158
if: github.event_name == 'pull_request'

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@
33
All notable changes to GraphCompose are documented here. Versions
44
follow semantic versioning; release dates are ISO 8601.
55

6+
## v1.6.6 — Planned
7+
8+
First Maven Central release. Adds publishable sources/javadoc jars,
9+
GPG-signed artifacts, a binary-compatibility gate against v1.6.5, and
10+
the metadata Maven Central requires. Zero breaking changes; users on
11+
JitPack continue to resolve through the existing coordinates.
12+
13+
### Build
14+
15+
- **Binary-compatibility gate against v1.6.5** (`japicmp` profile,
16+
Track E1). The new `binary-compat` CI job builds the artifact on every
17+
pull request and diffs it against `com.github.DemchaAV:GraphCompose:v1.6.5`
18+
pulled from JitPack. Binary-incompatible modifications to the public
19+
surface fail the build; source-incompatible changes are reported only
20+
(phased policy, will tighten after the 1.6.6 cut). Run locally with
21+
`./mvnw -DskipTests -P japicmp verify -pl .`; HTML/MD/XML reports
22+
land in `target/japicmp/`. JitPack repository is scoped to the
23+
`japicmp` profile, so downstream consumers do not inherit it.
24+
625
## v1.6.5 — 2026-05-30
726

827
### Templates v2

pom.xml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@
6868
<maven.compiler.plugin.version>3.15.0</maven.compiler.plugin.version>
6969
<maven.javadoc.plugin.version>3.12.0</maven.javadoc.plugin.version>
7070
<maven.surefire.plugin.version>3.5.5</maven.surefire.plugin.version>
71+
72+
<!-- Binary compatibility baseline (japicmp profile) -->
73+
<japicmp.version>0.23.1</japicmp.version>
74+
<japicmp.baseline>v1.6.5</japicmp.baseline>
7175
</properties>
7276

7377
<dependencyManagement>
@@ -355,4 +359,66 @@
355359
</plugin>
356360
</plugins>
357361
</build>
362+
363+
<profiles>
364+
<!--
365+
Binary-compatibility baseline against the last published
366+
release. Activated with `-P japicmp`. Resolves the baseline
367+
artifact from JitPack (kept profile-local so consumers do
368+
NOT inherit a JitPack repository). Fails the build on any
369+
binary-incompatible modification to the public surface;
370+
source-incompatible changes are reported but do not fail
371+
(yet) so the team can phase the policy in. Tracked in the
372+
v1.6.6 stabilization (Track E1).
373+
-->
374+
<profile>
375+
<id>japicmp</id>
376+
<repositories>
377+
<repository>
378+
<id>jitpack.io</id>
379+
<url>https://jitpack.io</url>
380+
</repository>
381+
</repositories>
382+
<build>
383+
<plugins>
384+
<plugin>
385+
<groupId>com.github.siom79.japicmp</groupId>
386+
<artifactId>japicmp-maven-plugin</artifactId>
387+
<version>${japicmp.version}</version>
388+
<executions>
389+
<execution>
390+
<id>japicmp-against-baseline</id>
391+
<phase>verify</phase>
392+
<goals>
393+
<goal>cmp</goal>
394+
</goals>
395+
</execution>
396+
</executions>
397+
<configuration>
398+
<oldVersion>
399+
<dependency>
400+
<groupId>com.github.DemchaAV</groupId>
401+
<artifactId>GraphCompose</artifactId>
402+
<version>${japicmp.baseline}</version>
403+
</dependency>
404+
</oldVersion>
405+
<newVersion>
406+
<file>
407+
<path>${project.build.directory}/${project.build.finalName}.jar</path>
408+
</file>
409+
</newVersion>
410+
<parameter>
411+
<onlyModified>true</onlyModified>
412+
<breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
413+
<breakBuildOnSourceIncompatibleModifications>false</breakBuildOnSourceIncompatibleModifications>
414+
<includeSynthetic>false</includeSynthetic>
415+
<reportOnlyFilename>true</reportOnlyFilename>
416+
<skipPomModules>true</skipPomModules>
417+
</parameter>
418+
</configuration>
419+
</plugin>
420+
</plugins>
421+
</build>
422+
</profile>
423+
</profiles>
358424
</project>

0 commit comments

Comments
 (0)