Problem
The API compatibility check (apiCompatibilityCheck in buildSrc/src/main/kotlin/charts.api-compatibility.gradle.kts) uses japicmp to diff JVM jars only against a baseline ref (.github/api-compatibility-baseline.txt). It cannot detect the removal of a Kotlin Multiplatform target (e.g. dropping the legacy js target in #511), even though a target removal is a breaking change for consumers on that target.
Current behavior
- Only JVM binary/source compatibility is verified.
- Removed targets (or API drift on wasmJs/iOS metadata/klibs) are invisible to CI.
- Breaking changes are surfaced only via release-note migration fragments, which are not enforced.
Proposed solutions
Option A (cheap, targeted): Compare the published target set per module (e.g. kotlin.targets or publication names) between the baseline ref and the current tree, and feed the existing breaking-change label gating in .github/workflows/api-compatibility.yml — fail when a target disappears without the label.
Option B (thorough, larger effort): Adopt the Kotlin binary-compatibility-validator plugin, which produces per-target .api dumps, detects removed targets (dump file disappears) and API drift on non-JVM targets. Overlaps with the existing japicmp setup and requires an api/*.api migration.
Recommendation
Option A is a proportionate safeguard for the current small, intentional target set; Option B is the long-term end-state if per-target API drift protection is wanted.
Acceptance criteria
Problem
The API compatibility check (
apiCompatibilityCheckinbuildSrc/src/main/kotlin/charts.api-compatibility.gradle.kts) uses japicmp to diff JVM jars only against a baseline ref (.github/api-compatibility-baseline.txt). It cannot detect the removal of a Kotlin Multiplatform target (e.g. dropping the legacyjstarget in #511), even though a target removal is a breaking change for consumers on that target.Current behavior
Proposed solutions
Option A (cheap, targeted): Compare the published target set per module (e.g.
kotlin.targetsor publication names) between the baseline ref and the current tree, and feed the existingbreaking-changelabel gating in.github/workflows/api-compatibility.yml— fail when a target disappears without the label.Option B (thorough, larger effort): Adopt the Kotlin
binary-compatibility-validatorplugin, which produces per-target.apidumps, detects removed targets (dump file disappears) and API drift on non-JVM targets. Overlaps with the existing japicmp setup and requires anapi/*.apimigration.Recommendation
Option A is a proportionate safeguard for the current small, intentional target set; Option B is the long-term end-state if per-target API drift protection is wanted.
Acceptance criteria
breaking-changelabel fails the API compatibility job.