Skip to content

Commit

Permalink
Add binary-compatibility-validator (#244)
Browse files Browse the repository at this point in the history
* save current api dump
* add running build on CI
  • Loading branch information
whyoleg authored Mar 2, 2024
1 parent 88e6928 commit e5e292b
Show file tree
Hide file tree
Showing 14 changed files with 961 additions and 5 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-gradle
- name: Run tests
timeout-minutes: 30
timeout-minutes: 15
uses: gradle/gradle-build-action@v2
with:
arguments: |
Expand All @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-gradle
- name: Run tests
timeout-minutes: 30
timeout-minutes: 15
uses: gradle/gradle-build-action@v2
with:
arguments: |
Expand Down Expand Up @@ -100,3 +100,24 @@ jobs:
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: test-reports/**/TEST-*.xml

build-project:
name: Build project on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-gradle
- name: Build project without running tests
uses: gradle/gradle-build-action@v2
with:
arguments: |
build
publishToMavenLocal
--scan
--info
--continue
-Pskip.test
11 changes: 11 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ buildscript {

plugins {
id("build-parameters")
// for now BCV uses `allProjects` internally, so we can't apply it just to specific subprojects
alias(libs.plugins.kotlinx.bcv)
}

apiValidation {
ignoredProjects.addAll(
listOf(
"rsocket-test",
"rsocket-transport-tests"
)
)
}

plugins.withType<YarnPlugin> {
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
kotlinx-atomicfu = "0.20.2"
kotlinx-coroutines = "1.6.4" #1.7.0 needs ktor with 1.7.0...
kotlinx-benchmark = "0.4.8"
kotlinx-bcv = "0.13.1"

ktor = "2.3.0"

Expand Down Expand Up @@ -43,3 +44,4 @@ build-kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugi

[plugins]
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark" }
kotlinx-bcv = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinx-bcv" }
4 changes: 1 addition & 3 deletions gradle/plugins/build-parameters/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ buildParameters {
enableValidation.set(false)
string("version")
string("versionSuffix")
string("useKotlin") {
fromEnvironment("KOTLIN_VERSION_OVERRIDE")
}
string("useKotlin")

string("githubUsername")
string("githubPassword")
Expand Down
818 changes: 818 additions & 0 deletions rsocket-core/api/rsocket-core.api

Large diffs are not rendered by default.

Empty file.
29 changes: 29 additions & 0 deletions rsocket-ktor/rsocket-ktor-client/api/rsocket-ktor-client.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
public final class io/rsocket/kotlin/ktor/client/BuildersKt {
public static final fun rSocket (Lio/ktor/client/HttpClient;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun rSocket (Lio/ktor/client/HttpClient;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun rSocket (Lio/ktor/client/HttpClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun rSocket$default (Lio/ktor/client/HttpClient;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun rSocket$default (Lio/ktor/client/HttpClient;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public final class io/rsocket/kotlin/ktor/client/RSocketSupport {
public static final field Plugin Lio/rsocket/kotlin/ktor/client/RSocketSupport$Plugin;
public synthetic fun <init> (Lio/rsocket/kotlin/core/RSocketConnector;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
}

public final class io/rsocket/kotlin/ktor/client/RSocketSupport$Config {
public final fun connector (Lkotlin/jvm/functions/Function1;)V
public final fun getBufferPool ()Lio/ktor/utils/io/pool/ObjectPool;
public final fun getConnector ()Lio/rsocket/kotlin/core/RSocketConnector;
public final fun setBufferPool (Lio/ktor/utils/io/pool/ObjectPool;)V
public final fun setConnector (Lio/rsocket/kotlin/core/RSocketConnector;)V
}

public final class io/rsocket/kotlin/ktor/client/RSocketSupport$Plugin : io/ktor/client/plugins/HttpClientPlugin {
public fun getKey ()Lio/ktor/util/AttributeKey;
public fun install (Lio/rsocket/kotlin/ktor/client/RSocketSupport;Lio/ktor/client/HttpClient;)V
public synthetic fun install (Ljava/lang/Object;Lio/ktor/client/HttpClient;)V
public fun prepare (Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/ktor/client/RSocketSupport;
public synthetic fun prepare (Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
}

24 changes: 24 additions & 0 deletions rsocket-ktor/rsocket-ktor-server/api/rsocket-ktor-server.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
public final class io/rsocket/kotlin/ktor/server/RSocketSupport {
public static final field Feature Lio/rsocket/kotlin/ktor/server/RSocketSupport$Feature;
public synthetic fun <init> (Lio/rsocket/kotlin/core/RSocketServer;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
}

public final class io/rsocket/kotlin/ktor/server/RSocketSupport$Config {
public final fun getBufferPool ()Lio/ktor/utils/io/pool/ObjectPool;
public final fun getServer ()Lio/rsocket/kotlin/core/RSocketServer;
public final fun server (Lkotlin/jvm/functions/Function1;)V
public final fun setBufferPool (Lio/ktor/utils/io/pool/ObjectPool;)V
public final fun setServer (Lio/rsocket/kotlin/core/RSocketServer;)V
}

public final class io/rsocket/kotlin/ktor/server/RSocketSupport$Feature : io/ktor/server/application/BaseApplicationPlugin {
public fun getKey ()Lio/ktor/util/AttributeKey;
public fun install (Lio/ktor/server/application/Application;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/ktor/server/RSocketSupport;
public synthetic fun install (Lio/ktor/util/pipeline/Pipeline;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
}

public final class io/rsocket/kotlin/ktor/server/RoutingKt {
public static final fun rSocket (Lio/ktor/server/routing/Route;Ljava/lang/String;Ljava/lang/String;Lio/rsocket/kotlin/ConnectionAcceptor;)V
public static synthetic fun rSocket$default (Lio/ktor/server/routing/Route;Ljava/lang/String;Ljava/lang/String;Lio/rsocket/kotlin/ConnectionAcceptor;ILjava/lang/Object;)V
}

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
public final class io/rsocket/kotlin/transport/ktor/tcp/TcpClientTransportKt {
public static final fun TcpClientTransport (Lio/ktor/network/sockets/InetSocketAddress;Lkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/transport/ClientTransport;
public static final fun TcpClientTransport (Ljava/lang/String;ILkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/transport/ClientTransport;
public static synthetic fun TcpClientTransport$default (Lio/ktor/network/sockets/InetSocketAddress;Lkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ClientTransport;
public static synthetic fun TcpClientTransport$default (Ljava/lang/String;ILkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ClientTransport;
}

public final class io/rsocket/kotlin/transport/ktor/tcp/TcpServer {
public final fun getHandlerJob ()Lkotlinx/coroutines/Job;
public final fun getServerSocket ()Lkotlinx/coroutines/Deferred;
}

public final class io/rsocket/kotlin/transport/ktor/tcp/TcpServerTransportKt {
public static final fun TcpServerTransport (Lio/ktor/network/sockets/InetSocketAddress;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/transport/ServerTransport;
public static final fun TcpServerTransport (Ljava/lang/String;ILio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/transport/ServerTransport;
public static synthetic fun TcpServerTransport$default (Lio/ktor/network/sockets/InetSocketAddress;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ServerTransport;
public static synthetic fun TcpServerTransport$default (Ljava/lang/String;ILio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ServerTransport;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
public final class io/rsocket/kotlin/transport/ktor/websocket/client/WebSocketClientTransportKt {
public static final fun WebSocketClientTransport (Lio/ktor/client/engine/HttpClientEngineFactory;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;ZLkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/transport/ClientTransport;
public static final fun WebSocketClientTransport (Lio/ktor/client/engine/HttpClientEngineFactory;Ljava/lang/String;ZLkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/transport/ClientTransport;
public static final fun WebSocketClientTransport (Lio/ktor/client/engine/HttpClientEngineFactory;Lkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/transport/ClientTransport;
public static synthetic fun WebSocketClientTransport$default (Lio/ktor/client/engine/HttpClientEngineFactory;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;ZLkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ClientTransport;
public static synthetic fun WebSocketClientTransport$default (Lio/ktor/client/engine/HttpClientEngineFactory;Ljava/lang/String;ZLkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ClientTransport;
public static synthetic fun WebSocketClientTransport$default (Lio/ktor/client/engine/HttpClientEngineFactory;Lkotlin/coroutines/CoroutineContext;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ClientTransport;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public final class io/rsocket/kotlin/transport/ktor/websocket/server/WebSocketServerTransportKt {
public static final fun WebSocketServerTransport (Lio/ktor/server/engine/ApplicationEngineFactory;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/transport/ServerTransport;
public static final fun WebSocketServerTransport (Lio/ktor/server/engine/ApplicationEngineFactory;[Lio/ktor/server/engine/EngineConnectorConfig;Ljava/lang/String;Ljava/lang/String;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lio/rsocket/kotlin/transport/ServerTransport;
public static synthetic fun WebSocketServerTransport$default (Lio/ktor/server/engine/ApplicationEngineFactory;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ServerTransport;
public static synthetic fun WebSocketServerTransport$default (Lio/ktor/server/engine/ApplicationEngineFactory;[Lio/ktor/server/engine/EngineConnectorConfig;Ljava/lang/String;Ljava/lang/String;Lio/ktor/utils/io/pool/ObjectPool;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ServerTransport;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public final class io/rsocket/kotlin/transport/ktor/websocket/WebSocketConnection : io/rsocket/kotlin/Connection, kotlinx/coroutines/CoroutineScope {
public fun <init> (Lio/ktor/websocket/WebSocketSession;Lio/ktor/utils/io/pool/ObjectPool;)V
public fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext;
public fun getPool ()Lio/ktor/utils/io/pool/ObjectPool;
public fun receive (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun send (Lio/ktor/utils/io/core/ByteReadPacket;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

10 changes: 10 additions & 0 deletions rsocket-transport-local/api/rsocket-transport-local.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
public final class io/rsocket/kotlin/transport/local/LocalServer : io/rsocket/kotlin/transport/ClientTransport {
public fun connect (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext;
}

public final class io/rsocket/kotlin/transport/local/LocalServerKt {
public static final fun LocalServerTransport (Lio/ktor/utils/io/pool/ObjectPool;)Lio/rsocket/kotlin/transport/ServerTransport;
public static synthetic fun LocalServerTransport$default (Lio/ktor/utils/io/pool/ObjectPool;ILjava/lang/Object;)Lio/rsocket/kotlin/transport/ServerTransport;
}

0 comments on commit e5e292b

Please sign in to comment.