Repository navigation
Migrate conductor-client to Jackson 3 (tools.jackson) - #189
nthmost-orkes wants to merge 2 commits into
Conversation
210b4ed to
5f85698
Compare
|
Supersedes #169 (@bradyyie's Jackson 3 PR), which was built against the reverted Correction on follow-ups: I'd initially listed de-vendoring Remaining follow-ups on top of this (part of #187):
|
Bring the published client up to the serialization major the server moved to in conductor-oss/conductor#1573 (3.34.0). The client was still a Jackson 2 artifact, lagging the platform and dark-compiling the server's gRPC/HTTP e2e harness suites (conductor-oss/conductor#1751). - Gradle: import the tools.jackson:jackson-bom platform (3.1.7, same line the server resolves via the Spring Boot BOM) and declare tools.jackson.core databind/core + tools.jackson.module kotlin. Drop jackson-module-afterburner and jackson-datatype-jsr310 -- both folded into Jackson 3 core. Annotations stay on com.fasterxml.jackson.annotation (JSTEP-1: Jackson 3 keeps the 2.x annotations module; the BOM pins it). - ObjectMapperProvider rebuilt on the server's immutable JsonMapper.builder() template: WRITE_DATES_AS_TIMESTAMPS preserves the numeric date encoding JavaTimeModule produced, Kotlin module only. - Package move com.fasterxml.jackson.{databind,core} -> tools.jackson.* across main + test + groovy sources. JsonProcessingException -> JacksonException (unchecked in Jackson 3), matching the server. - Immutable-mapper fallout in tests: setVisibility/registerModule/configure on a built mapper moved into JsonMapper.builder() chains; JsonNode.fieldNames() -> propertyNames(), isContainerNode() -> isContainer(), deepCopy() cast; Jdk8Module dropped (built into core). 862/863 client tests pass; the one failure (WorkflowTestFrameworkTests) is a local port-8080 conflict in @BeforeAll, not a serialization change.
Rebasing onto main pulled in modules added after this branch was cut (conductor-client-ai, agent-examples, e2e) plus Gradle dependency locking (#184). Carrying them to Jackson 3 so the repo resolves a single Jackson major. - conductor-client-ai: internal JsonMapper singleton rebuilt on the immutable tools.jackson JsonMapper.builder() (ISO-8601 dates preserved -- this mapper intentionally keeps WRITE_DATES_AS_TIMESTAMPS off, unlike the client mapper). The two custom serializers move to ValueSerializer / SerializationContext (JsonSerializer / SerializerProvider are gone in Jackson 3); the delegating calls become ctxt.writeValue(gen, value). build.gradle switches its api-scoped Jackson coords to the tools.jackson BOM, dropping jsr310/jdk8. - agent-examples, e2e, and the client files added on main (FileClient, SseClient, OrkesAgentClient, TokenRefreshInterceptor, agent model tests): package move to tools.jackson. AnnotatedWorker.convertValue -- new on main -- uses the removed JsonNode.traverse(codec); rewired through om.treeAsTokens(tree) and catches JacksonException. - Regenerated the per-module runtimeClasspath gradle.lockfiles for the Jackson 3 graph. `./gradlew build -x test` passes with lock enforcement on.
5f85698 to
db7b12a
Compare
There was a problem hiding this comment.
Claude flagged a couple of issues on the this PR that I wanted to check, so I built a demo with CI evidence: PR #194
- Spring Boot 3 compatibility: in a Boot 3 app, Boot decides the
jackson-annotationsversion, and Boot 3.5.12 and older pick one too old for Jackson 3. The app crashes at startup. Proposal: document the Boot 3.5.13+ floor, add a clearer error message, and add a CI test on Boot 3.5.13 so a future Jackson bump that breaks Boot 3 fails our build. - Serialization changes for worker code: Jackson 3 changed several defaults, so the same worker code reads and writes different data than on SDK 6.x (enums,
Duration, some fields, Jackson 2JsonNodes). Proposal: a small fix inObjectMapperProviderthat restores the old behavior, plus upgrade notes for the one case only users can fix (Jackson 2 annotations like@JsonNamingon their own classes).
Rebuilds the published
conductor-client(and the other client modules) on Jackson 3, bringing them up to the serialization major the server moved to in conductor-oss/conductor#1573 (3.34.0). The client was still a Jackson 2 artifact (versions.jackson), lagging the platform by a major and dark-compiling the server's gRPC/HTTP end-to-end harness suites (conductor-oss/conductor#1751).This is the code-migration slice of the epic (#187), tasks 1-2.
What changed
tools.jackson:jackson-bomplatform (3.1.7 -- the line the server resolves via its Spring Boot 4.1 BOM) and declaretools.jackson.coredatabind/core plustools.jackson.modulekotlin in the rootsubprojectsblock. Dropjackson-module-afterburnerandjackson-datatype-jsr310(folded into Jackson 3 core) and thejackson-datatype-jdk8test dep. Annotations stay oncom.fasterxml.jackson.annotation-- per JSTEP-1 Jackson 3 keeps the 2.x annotations module, and the BOM pins the right 2.x build (2.21).JsonMapper.builder()template.WRITE_DATES_AS_TIMESTAMPSis enabled to preserve the numeric date encodingJavaTimeModuleproduced in Jackson 2.com.fasterxml.jackson.{databind,core}->tools.jackson.*across main, test, and groovy sources.JsonProcessingException->tools.jackson.core.JacksonException(unchecked in Jackson 3), matching the server.setVisibility/registerModule/configureon a built mapper moved intoJsonMapper.builder()chains (changeDefaultVisibility(vc -> vc.withVisibility(...))). Node-API renames:JsonNode.fieldNames()->propertyNames(),isContainerNode()->isContainer(),deepCopy()cast toObjectNode.JsonMappersingleton rebuilt on the immutable builder (ISO-8601 dates preserved -- this mapper intentionally keepsWRITE_DATES_AS_TIMESTAMPSoff, unlike the client mapper). The two custom serializers move toValueSerializer/SerializationContext(JsonSerializer/SerializerProviderare gone in Jackson 3); delegating calls becomectxt.writeValue(gen, value).build.gradleswitches its api-scoped Jackson coords to the BOM.agent-examplesande2eget the package move too.JsonNode.traverse(codec); rewired throughom.treeAsTokens(tree)and catchesJacksonException.runtimeClasspathlock for the Jackson 3 graph.Verification
./gradlew build -x test-- green across all modules with dependency-lock enforcement on (shadow fat JAR builds)../gradlew :conductor-client:test-- 985/986 pass, 4 skipped../gradlew :conductor-client-ai:test-- green (36 tests). The lone client failure isWorkflowTestFrameworkTests, which boots a real server on a hardcoded port 8080 in@BeforeAll; port 8080 was held by an unrelated process in the local sandbox, so the server never went healthy. The failure is in setup, before any serialization, and runs fine on CI (free port).Orkes parity
The Orkes Jackson surface lives in the vendored
io/orkes/conductor/client/*packages insideconductor-client, migrated here in lockstep. Source-of-truth for the layout:conductor/common/src/main/java/com/netflix/conductor/common/config/ObjectMapperProvider.java(the server's Jackson-3 builder template, minus the server-only proto module).OSS-side additions
None -- this mirrors the server's Jackson 3 migration.
Downstream impact
The
com.fasterxml.jackson->tools.jacksonpackage move means downstream consumers of the published client still on Jackson 2 will update their imports when they pick up the next release. Upgrade note:Follow-ups
Maven Central publishing for the
conductorossorg is unblocked (quota lifted 2026-11-23), so the release path is clear once this merges:conductor-clientrelease, bumprevConductorClientinconductor/test-harness/build.gradle, and delete the suite exclusions (closes Restore the SDK-driven test-harness suites excluded during the Jackson 3 migration conductor#1751).conductor-client-spring-boot4module to Boot 4.1.1.De-vendoring
conductor-commonis not viable and has been dropped from the plan. Investigated against the publishedorg.conductoross:conductor-common:3.34.0: 19 of the 58 vendored classes have no counterpart there (Orkes service-registry models, the SDKcommon.run.tasks.*typed-task POJOs,MetadataUtils), and the 39 shared-name classes are intentionally slimmed SDK variants (e.g.Taskis 376 lines here vs 1153 in the server'scommon), so swapping to the published jar would change the wire format and pull server-side concerns into the SDK. The split-package collision this epic flagged is instead addressed by relocating the client's classes toorg.conductoross.conductor.*-- a namespace move in the spirit of conductor-oss/conductor#752, tracked separately, not a dependency swap.Part of #187. Follows conductor-oss/conductor#1573.