Skip to content

Add workflow YAML loader with $extends and ${{ }} expressions#316

Draft
em3s wants to merge 1 commit into
feat/step-dsl-313from
feat/workflow-dsl-310
Draft

Add workflow YAML loader with $extends and ${{ }} expressions#316
em3s wants to merge 1 commit into
feat/step-dsl-313from
feat/workflow-dsl-310

Conversation

@em3s
Copy link
Copy Markdown
Contributor

@em3s em3s commented May 10, 2026

Summary

Implements the parser layer of the workflow DSL (#310). YAML binds onto case classes via Jackson, with $extends deep-merge and ${{ ... }} expressions (env / presets / load) resolved at load time. needs.* and when: operator forms are preserved for runtime evaluation in a follow-up PR (EmbeddedRunner).

Stacked on #314 (Step DSL) — review/merge that first.

Changes

  • Workflow + JobSpec data classes (new kind / artifact / mainClass / args / submit / run / needs / when shape)
  • WorkflowLoader — YAML → resolved tree → Workflow
  • ExtendsResolver — deep merge, cycle protection, $ prefix as processor directive
  • Expressionenv.X, presets.X, needs.X.{result,outputs.Y}, load('path'); lenient mode for deferred resolution
  • Sample YAMLs and unit tests

How to Test

./gradlew :pipeline:test
./gradlew :pipeline:spotlessCheck

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: Claude Code (Opus 4.7, 1M context)

Implements the parser layer of the workflow DSL (#310). Workflow YAML
binds onto Workflow + JobSpec case classes via Jackson, with $extends
deep-merge and ${{ env / presets / load }} expressions resolved at
load time. needs.* expressions and 'when:' operator forms are deferred
to runtime (handled by the EmbeddedRunner in a follow-up PR).

- Workflow + JobSpec (kind / artifact / mainClass / args / submit /
  run / needs / when)
- WorkflowLoader: YAML -> raw map -> resolve presets -> resolve
  \$extends -> resolve expressions (lenient on needs) -> Jackson bind
- Expression evaluator: env / presets / needs / load
- ExtendsResolver: deep merge with cycle protection
- Tests + sample YAMLs (spark-pi.yaml, extends-via-load.yaml)

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Happy <[email protected]>
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels May 10, 2026
@em3s em3s marked this pull request as draft May 10, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant