Skip to content
Merged
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
15 changes: 12 additions & 3 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,38 @@ name: Validate PR
on:
workflow_dispatch:
pull_request:
branches: [main]
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
validate-pr:
runs-on: macos-latest
name: Validate PR
steps:
- uses: actions/checkout@v4

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

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Clean Build with Gradle
run: ./gradlew clean build

- name: Upload JUnit test results
if: always()
uses: actions/upload-artifact@v4
with:
name: junit-results
path: '**/build/test-results/test/*.xml'

- name: Disable Auto-Merge on Fail
if: failure()
run: gh pr merge --disable-auto "$PR_URL"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ public class ReadBuffer {
try {
return deserializeMessage(line)
} catch (e: Exception) {
logger.error(e) { "Failed to deserialize message from line: $line\nSkipping..." }
logger.error(e) { "Failed to deserialize message from line: $line\nAttempting to recover..." }
// if there is a non-JSON object prefix, try to parse from the first '{' onward.
val braceIndex = line.indexOf('{')
if (braceIndex != -1) {
val trimmed = line.substring(braceIndex)
try {
return deserializeMessage(trimmed)
} catch (ignored: Exception) {
logger.error(ignored) { "Deserialization failed for line: $line\nSkipping..." }
}
}
}

return null
Expand Down
5 changes: 5 additions & 0 deletions kotlin-sdk-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ plugins {
}

kotlin {
jvm {
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
sourceSets {
commonTest {
dependencies {
Expand Down
Loading