Skip to content
Draft
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
100 changes: 100 additions & 0 deletions .github/workflows/boot3-compat-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Demo for PR #189 (Jackson 3). In a Spring Boot 3 app, Boot's BOM picks the
# jackson-annotations and Kotlin versions, while the SDK picks the Jackson 3 engine.
# When the engine needs newer ones than Boot supplies, the app fails with NoClassDefFoundError.
name: Boot 3 compatibility demo

on:
push:
branches:
- demo/boot3-jackson-annotations

jobs:
boot3-compat:
name: Boot ${{ matrix.boot }} + Jackson ${{ matrix.jackson || '3.1.7 (PR default)' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- boot: '3.5.12'
jackson: ''
expect: fail
why: 'annotations 2.19 < 2.21 needed by Jackson 3.1.7, so the app fails to start'
- boot: '3.5.13'
jackson: ''
expect: pass
why: 'annotations 2.21 is what Jackson 3.1.7 needs'
- boot: '3.5.16'
jackson: '3.2.3'
expect: fail
why: 'Kotlin 1.9 forced by Boot (first of two blockers; annotations 2.21 < 2.22 is the second)'
env:
COMPAT_ARGS: -PcompatBootVersion=${{ matrix.boot }} ${{ matrix.jackson && format('-PcompatJacksonVersion={0}', matrix.jackson) || '' }}

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Zulu JDK 21
uses: actions/setup-java@v5
with:
distribution: "zulu"
java-version: "21"

- name: Show resolved versions
id: versions
run: |
resolved() {
local out
out=$(./gradlew -q :conductor-client-spring:dependencyInsight \
--configuration bootCompatTestRuntimeClasspath --dependency "$1" $COMPAT_ARGS)
echo "$out" | awk 'NR==1 {print $1}' | awk -F: '{print $NF}'
}
annotations=$(resolved com.fasterxml.jackson.core:jackson-annotations)
engine=$(resolved tools.jackson.core:jackson-databind)
kotlin=$(resolved org.jetbrains.kotlin:kotlin-stdlib)
echo "jackson-annotations=$annotations jackson-databind=$engine kotlin-stdlib=$kotlin"
{
echo "annotations=$annotations"
echo "engine=$engine"
echo "kotlin=$kotlin"
} >> "$GITHUB_OUTPUT"

- name: Run Boot 3 compatibility tests
id: tests
run: ./gradlew :conductor-client-spring:bootCompatTest $COMPAT_ARGS

- name: Summary
if: always()
env:
BOOT: ${{ matrix.boot }}
EXPECT: ${{ matrix.expect }}
WHY: ${{ matrix.why }}
OUTCOME: ${{ steps.tests.outcome }}
ANNOTATIONS: ${{ steps.versions.outputs.annotations }}
ENGINE: ${{ steps.versions.outputs.engine }}
KOTLIN: ${{ steps.versions.outputs.kotlin }}
run: |
actual=$([ "$OUTCOME" = success ] && echo pass || echo fail)
verdict=$([ "$actual" = "$EXPECT" ] && echo "as predicted" || echo "UNEXPECTED")
results=conductor-client-spring/build/test-results/bootCompatTest/
errors=$(grep -rhoE 'NoClassDefFoundError: [A-Za-z0-9/_$]+' "$results" 2>/dev/null \
| sort -u | paste -sd ',' - || true)
sdk_message=$(grep -rhoE 'Conductor SDK could not start Jackson[^<&"]*' "$results" 2>/dev/null \
| sort -u | head -1 || true)
{
echo "### Boot $BOOT: $actual ($verdict)"
echo
echo "| Boot | Jackson engine | jackson-annotations | Kotlin | Expected | Actual | Error |"
echo "|---|---|---|---|---|---|---|"
echo "| $BOOT | $ENGINE | $ANNOTATIONS | $KOTLIN | $EXPECT | $actual | ${errors:-none} |"
echo
echo "Why: $WHY"
if [ -n "$sdk_message" ]; then
echo
echo "What the user sees:"
echo
echo "> $sdk_message"
fi
} >> "$GITHUB_STEP_SUMMARY"
cat "$GITHUB_STEP_SUMMARY"
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
# Demo only: shows bootCompatTest running in the normal build. Remove before merging.
- demo/boot3-jackson-annotations
pull_request:
branches:
- main
Expand Down Expand Up @@ -148,7 +150,7 @@ jobs:
if: always()
uses: mikepenz/action-junit-report@v6
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
report_paths: '**/build/test-results/{test,bootCompatTest}/TEST-*.xml'

- name: Check Tests Status
if: steps.tests.outcome == 'failure'
Expand Down
108 changes: 108 additions & 0 deletions .github/workflows/worker-compat-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Demo for PR #189 (Jackson 3), issues 2 and 3: the same worker tests in four setups. Each test
# asserts the SDK 6.0.2 (Jackson 2) behavior, so a red test is a change a worker author would see.
# 1. SDK 6.0.2 -> baseline
# 2. PR #189 as submitted (db7b12a) -> what users get today from the PR
# 3. PR + SDK fixes (this branch) -> what the SDK alone can restore
# 4. PR + SDK fixes + migrated user code -> after users add Jackson 3 annotations
name: Worker compatibility demo

on:
push:
branches:
- demo/boot3-jackson-annotations

jobs:
worker-compat:
name: ${{ matrix.label }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- label: 1. SDK 6.0.2 (released, Jackson 2)
sdk: '6.0.2'
sdk_source: none
user_code: jackson2
expect_pass: 8
- label: 2. PR 189 as submitted (Jackson 3)
sdk: '0.0.0-pr189-asis'
sdk_source: db7b12ae0bb6764b0f023eabebf3a34444fb9e48
user_code: jackson2
expect_pass: 0
- label: 3. PR 189 + SDK fixes
sdk: '0.0.0-pr189-fixed'
sdk_source: this-branch
user_code: jackson2
expect_pass: 6
- label: 4. PR 189 + SDK fixes + migrated user code
sdk: '0.0.0-pr189-fixed'
sdk_source: this-branch
user_code: migrated
expect_pass: 8
env:
DEMO_M2: ${{ github.workspace }}/build/demo-m2

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Checkout the PR as submitted
if: matrix.sdk_source != 'none' && matrix.sdk_source != 'this-branch'
uses: actions/checkout@v6
with:
ref: ${{ matrix.sdk_source }}
path: sdk-src

- name: Set up Zulu JDK 21
uses: actions/setup-java@v5
with:
distribution: "zulu"
java-version: "21"

- name: Publish the SDK under test to a local Maven repo
if: matrix.sdk_source != 'none'
run: |
dir=$([ "${{ matrix.sdk_source }}" = this-branch ] && echo . || echo sdk-src)
cd "$dir"
./gradlew :conductor-client:publishToMavenLocal -Pversion=${{ matrix.sdk }} -Dmaven.repo.local="$DEMO_M2"

- name: Run worker tests
id: tests
run: >
./gradlew -p demo/worker-compat test
-PsdkVersion=${{ matrix.sdk }}
-PuserCode=${{ matrix.user_code }}
-Dmaven.repo.local="$DEMO_M2"

- name: Summary
if: always()
env:
LABEL: ${{ matrix.label }}
USER_CODE: ${{ matrix.user_code }}
EXPECT_PASS: ${{ matrix.expect_pass }}
run: |
python3 - <<'EOF' >> "$GITHUB_STEP_SUMMARY"
import glob, os, xml.etree.ElementTree as ET
rows = []
for path in glob.glob('demo/worker-compat/build/test-results/test/*.xml'):
for case in ET.parse(path).getroot().iter('testcase'):
failure = case.find('failure')
detail = ''
if failure is not None:
detail = ' '.join((failure.get('message') or '').split())[:160]
detail = detail.replace('|', '\\|')
rows.append((case.get('name'), failure is None, detail))
rows.sort()
passed = sum(1 for _, ok, _ in rows if ok)
expected = int(os.environ['EXPECT_PASS'])
verdict = 'as predicted' if passed == expected else f'UNEXPECTED, predicted {expected}'
print(f"### {os.environ['LABEL']}: {passed}/{len(rows)} pass ({verdict})")
print()
print(f"User code: `src/userCode/{os.environ['USER_CODE']}`")
print()
print("| Behavior (as in SDK 6.0.2) | Result | What happened instead |")
print("|---|---|---|")
for name, ok, detail in rows:
print(f"| {name} | {'✅' if ok else '❌'} | {detail} |")
EOF
cat "$GITHUB_STEP_SUMMARY"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ For worker patterns, workflow definitions, and testing, continue with the [core
| Task remains `SCHEDULED` | A worker is polling the exact task type and has enough threads. |
| Authentication failure | `CONDUCTOR_AUTH_KEY` and `CONDUCTOR_AUTH_SECRET` are set for the target server. |
| AI agent cannot call a model | The server—not only the client process—has a configured LLM provider and model. |
| `Conductor SDK could not start Jackson` at startup | On Spring Boot 3, use 3.5.13+ or set `jackson-bom.version` to 2.21.x; see [older Spring Boot 3 versions](conductor-client-spring/README.md#older-spring-boot-3-versions). |

## Support and project policies

Expand Down
20 changes: 19 additions & 1 deletion conductor-client-spring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Spring Boot 3 auto-configuration for the Conductor core client, workflow SDK, and Java workers.

**Prerequisites:** Java 21+, Spring Boot 3, and a running [OSS or Orkes Conductor server](../docs/connection-authentication.md). For Spring Boot 4, use [the Boot 4 module](../conductor-client-spring-boot4/README.md).
**Prerequisites:** Java 21+, Spring Boot 3.5.13+ (see [Older Spring Boot 3 versions](#older-spring-boot-3-versions)), and a running [OSS or Orkes Conductor server](../docs/connection-authentication.md). For Spring Boot 4, use [the Boot 4 module](../conductor-client-spring-boot4/README.md).

## Install

Expand All @@ -20,6 +20,24 @@ implementation 'org.conductoross:conductor-client-spring:<VERSION>'
</dependency>
```

### Older Spring Boot 3 versions

The SDK uses Jackson 3, which needs `com.fasterxml.jackson.core:jackson-annotations` 2.21 or later. Spring Boot's dependency management picks that version for your app, and Spring Boot 3.5.12 and earlier pick an older one. The app then fails at startup with `Conductor SDK could not start Jackson: missing class com/fasterxml/jackson/annotation/...`.

Upgrade to Spring Boot 3.5.13 or later, or override Boot's Jackson version:

```xml
<!-- Maven, with spring-boot-starter-parent -->
<properties>
<jackson-bom.version>2.21.4</jackson-bom.version>
</properties>
```

```groovy
// Gradle, with the io.spring.dependency-management plugin
ext['jackson-bom.version'] = '2.21.4'
```

## Configure

```properties
Expand Down
42 changes: 42 additions & 0 deletions conductor-client-spring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,45 @@ java {
test {
useJUnitPlatform()
}

// Runs the starter on the dependency versions a real Spring Boot app resolves.
// enforcedPlatform makes Boot's BOM win, like spring-boot-starter-parent does,
// so jackson-annotations comes from Boot rather than from our Jackson 3 BOM.
// -PcompatBootVersion=3.5.12 Boot BOM to resolve against
// -PcompatJacksonVersion=3.2.3 optional: force a different Jackson 3 engine
def compatBoot = findProperty('compatBootVersion') ?: '3.5.13'
def compatJackson = findProperty('compatJacksonVersion')

testing {
suites {
bootCompatTest(JvmTestSuite) {
useJUnitJupiter()
dependencies {
implementation project()
implementation enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${compatBoot}")
implementation 'org.springframework.boot:spring-boot-starter-test'
if (compatJackson) {
['tools.jackson.core:jackson-databind',
'tools.jackson.core:jackson-core',
'tools.jackson.module:jackson-module-kotlin'].each { coord ->
implementation(coord) { version { strictly compatJackson } }
}
}
}
targets.all {
testTask.configure {
// Fresh JVM per test class so each one reports the root
// NoClassDefFoundError, not "Could not initialize class".
forkEvery = 1
testLogging {
events 'passed', 'failed'
exceptionFormat 'full'
}
}
}
}
}
}

// Run the suite (on the default, oldest supported Boot 3) in every build.
tasks.named('check') { dependsOn testing.suites.bootCompatTest }
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2026 Conductor Authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.netflix.conductor.client.spring.compat;

import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;

import com.netflix.conductor.client.http.ConductorClient;
import com.netflix.conductor.client.spring.ConductorClientAutoConfiguration;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Does a Boot app using the starter start up? ConductorClient builds its Jackson
* mapper in its constructor, so an incompatible jackson-annotations jar fails here.
*/
class Boot3StartupTest {

@Test
void applicationContextStarts() {
new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ConductorClientAutoConfiguration.class))
.withPropertyValues("conductor.client.base-path=http://localhost:8080/api")
.run(context -> {
assertThat(context).hasNotFailed();
assertThat(context).hasSingleBean(ConductorClient.class);
});
}
}
Loading
Loading