Skip to content

feat(template): payload validation#851

Merged
dieppa merged 1 commit intomasterfrom
feat/template_payload_validation
Feb 27, 2026
Merged

feat(template): payload validation#851
dieppa merged 1 commit intomasterfrom
feat/template_payload_validation

Conversation

@dieppa
Copy link
Member

@dieppa dieppa commented Feb 27, 2026

Template payload types (APPLY and ROLLBACK) are now required to implement
the TemplatePayload interface, which provides a validate() method called
at pipeline load time — before any change executes.

Public API:

  • TemplatePayload interface with validate() returning validation errors
  • TemplatePayloadValidationError for field-level and general error reporting
  • TemplateString wrapper for String-based payloads (e.g. raw SQL)
  • ChangeTemplate and AbstractChangeTemplate now enforce
    APPLY/ROLLBACK extends TemplatePayload bounds

Internal type alignment:

  • AbstractTemplateLoadedChange, SimpleTemplateLoadedChange, and
    MultiStepTemplateLoadedChange propagate TemplatePayload bounds,
    enabling direct validate() calls without instanceof checks or casts
  • AbstractTemplateExecutableTask and its subclasses propagate bounds,
    removing explicit (TemplatePayload) casts on setApplyPayload/setRollbackPayload
  • TemplateLoadedTaskBuilder remains the sole raw-type boundary where
    runtime reflection constructs the typed hierarchy
  • FileUtil extended with scalar-to-wrapper conversion for SnakeYAML
    deserialization of TemplateString from plain YAML strings

@dieppa dieppa merged commit 8d22d1d into master Feb 27, 2026
4 checks passed
@dieppa dieppa deleted the feat/template_payload_validation branch February 27, 2026 11:03
dieppa added a commit that referenced this pull request Feb 27, 2026
…#851)

Template payload types (**APPLY** and **ROLLBACK**) are now required to implement
the TemplatePayload interface, which provides a validate() method called
at pipeline load time — before any change executes.

Public API:
- **TemplatePayload** interface with validate() returning validation errors
- **TemplatePayloadValidationError** for field-level and general error reporting
- **TemplateString** wrapper for String-based payloads (e.g. raw SQL)
- **ChangeTemplate** and **AbstractChangeTemplate** now enforce
**APPLY**/**ROLLBACK** extends TemplatePayload bounds

Internal type alignment:
- **AbstractTemplateLoadedChange**, **SimpleTemplateLoadedChange**,
and **MultiStepTemplateLoadedChange** propagate **TemplatePayload** bounds,enabling
direct validate() calls without instanceof checks or casts
- **AbstractTemplateExecutableTask** and its subclasses propagate bounds,
removing explicit (**TemplatePayload**) casts on **setApplyPayload**/**setRollbackPayload**
- **TemplateLoadedTaskBuilder** remains the sole raw-type boundary where
runtime reflection constructs the typed hierarchy
- FileUtil extended with scalar-to-wrapper conversion for SnakeYAML
deserialization of TemplateString from plain YAML strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant