Skip to content

fix(amber): round-trip LogicalLink operator identities#5175

Open
officialasishkumar wants to merge 1 commit into
apache:mainfrom
officialasishkumar:fix/logical-link-roundtrip
Open

fix(amber): round-trip LogicalLink operator identities#5175
officialasishkumar wants to merge 1 commit into
apache:mainfrom
officialasishkumar:fix/logical-link-roundtrip

Conversation

@officialasishkumar
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

LogicalLink had an asymmetric Jackson contract: frontend-saved workflow JSON with string-shaped operator ids ("fromOpId": "op-A") deserialized correctly, but JSON emitted by the production objectMapper serialized OperatorIdentity as an object ("fromOpId": {"id": "op-A"}), which the only @JsonCreator path could not read back.

This PR changes the Jackson creator in both LogicalLink models to accept either shape:

  • raw string operator ids from saved workflow JSON
  • object-shaped operator ids emitted by objectMapper.writeValueAsString

The existing Scala string constructor is kept for direct callers, and the existing null/empty/self-loop validation in the Amber model continues to run through the primary constructor.

Any related issues, documentation, discussions?

Closes #5042.

How was this PR tested?

Validated locally with a temporary Postgres container loaded with the same DDL files used by CI for JOOQ generation.

JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 COURSIER_CACHE=/tmp/texera-coursier-cache /usr/lib/jvm/java-17-openjdk-amd64/bin/java -Dsbt.ivy.home=/tmp/texera-ivy-cache -Dsbt.boot.directory=/tmp/texera-sbt-boot -Dsbt.global.base=/tmp/texera-sbt-global -jar /tmp/sbt-launch-1.12.9.jar "WorkflowExecutionService/testOnly org.apache.texera.workflow.LogicalLinkSpec" "WorkflowCompilingService/testOnly org.apache.texera.service.resource.WorkflowCompilationResourceSpec"

Result: LogicalLinkSpec 18 passed, WorkflowCompilationResourceSpec 3 passed.

JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 COURSIER_CACHE=/tmp/texera-coursier-cache /usr/lib/jvm/java-17-openjdk-amd64/bin/java -Dsbt.ivy.home=/tmp/texera-ivy-cache -Dsbt.boot.directory=/tmp/texera-sbt-boot -Dsbt.global.base=/tmp/texera-sbt-global -jar /tmp/sbt-launch-1.12.9.jar scalafmtCheckAll

Result: passed.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: OpenAI Codex (GPT-5)

@github-actions github-actions Bot added engine fix platform Non-amber Scala service paths labels May 24, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 24, 2026

Codecov Report

❌ Patch coverage is 61.76471% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.66%. Comparing base (e7e5d4e) to head (a735ca8).

Files with missing lines Patch % Lines
...ache/texera/amber/compiler/model/LogicalLink.scala 58.82% 4 Missing and 3 partials ⚠️
...scala/org/apache/texera/workflow/LogicalLink.scala 64.70% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #5175   +/-   ##
=========================================
  Coverage     43.65%   43.66%           
  Complexity     2219     2219           
=========================================
  Files          1049     1049           
  Lines         40572    40606   +34     
  Branches       4324     4332    +8     
=========================================
+ Hits          17713    17731   +18     
- Misses        21767    21775    +8     
- Partials       1092     1100    +8     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø)
agent-service 33.76% <ø> (ø) Carriedforward from e7e5d4e
amber 44.05% <64.70%> (+<0.01%) ⬆️
computing-unit-managing-service 0.00% <ø> (ø)
config-service 0.00% <ø> (ø)
file-service 32.18% <ø> (ø)
frontend 35.15% <ø> (ø) Carriedforward from e7e5d4e
python 90.50% <ø> (ø) Carriedforward from e7e5d4e
workflow-compiling-service 56.37% <58.82%> (-0.45%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine fix platform Non-amber Scala service paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LogicalLink: writeValueAsString / readValue is not round-trippable for OperatorIdentity fields

2 participants