feat(interface): expose workflow metadata models - #902
Conversation
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Fern preview: https://nvidia-preview-pr-902.docs.buildwithfern.com/nemo/datadesigner
|
Greptile SummaryAdds public Pydantic models for workflow metadata and validates metadata at workflow persistence boundaries while preserving compatible extension fields.
|
| Filename | Overview |
|---|---|
| packages/data-designer/src/data_designer/interface/workflow_metadata.py | Defines the public, status-discriminated Pydantic contract for workflow and stage metadata. |
| packages/data-designer/src/data_designer/interface/composite_workflow.py | Integrates metadata validation and extension preservation into workflow read, write, and resume paths. |
| packages/data-designer/src/data_designer/interface/init.py | Exposes the new metadata models through the package’s lazy public imports. |
| packages/data-designer/tests/interface/test_workflow_metadata.py | Tests public exports, status variants, serialization, legacy compatibility, extensions, and invalid metadata. |
| packages/data-designer/tests/interface/test_composite_workflow.py | Adds workflow integration coverage for metadata validation, legacy resume behavior, and extension preservation. |
Reviews (3): Last reviewed commit: "fix: tighten workflow metadata contracts" | Re-trigger Greptile
|
Thanks for putting this together, @andreatnvidia — the backward-compatibility work here is careful, and it shows. SummaryThis adds a public Pydantic contract ( One thing worth highlighting up front: I traced every required field on the new models back through FindingsWarnings — Worth addressing
Suggestions — Take it or leave it
Docs — new public API isn't documented anywhere
Structural Impact(graphify, 2.4s) Risk: HIGH (103 import direction violation(s))
Import Direction Violations (103)Legal direction: interface -> engine -> config
High-Connectivity Changes
Cross-Package Dependencies
Reviewer note on the HIGH rating — I believe it is a false positive, and did not weight it in the verdict. I checked the reported violations against the actual imports rather than taking the rating at face value:
Where the report is useful: LintingI was not able to run What Looks Good
VerdictNeeds changes — nothing here is a correctness bug in the current code, and the backward-compatibility work is solid. The items I'd like to see addressed before merge:
Everything under Suggestions is genuinely optional. Since I couldn't run This review was generated by an AI assistant. |
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Thanks for putting this together, @andreatnvidia! SummaryThis PR adds public, status-specific Pydantic models for FindingsWarnings — Worth addressing
Suggestions — Take it or leave it
What Looks Good
VerdictNeeds changes — Please make standalone stage validation status-aware and preserve extension fields when resuming This review was generated by an AI assistant. |
…rkflow-metadata-model
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Thanks, @nabinchha. I addressed both warnings in |
|
Thanks for the quick follow-up, @andreatnvidia! SummaryI re-reviewed the PR through FindingsWarnings — Worth addressing
Suggestions — Take it or leave it
What Looks Good
VerdictNeeds changes — The behavioral fixes are solid, but I recommend collapsing This review was generated by an AI assistant. |
📋 Summary
Adds a public Pydantic contract for
workflow-metadata.jsonso users and integrations can validate and serialize workflow state while retaining compatibility with existing metadata files.🔗 Related Issue
Closes #900
🔄 Changes
WorkflowMetadataand status-specific workflow stage metadata models fromdata_designer.interface.num_recordsvalues.🧪 Testing
make testpasses (not run; the change is scoped to the interface package).venv/bin/ruff check --fix ..venv/bin/ruff format ..venv/bin/pytest packages/data-designer/tests -q- 1141 passed, 1 skipped.venv/bin/pytest packages/data-designer/tests/interface/test_composite_workflow.py::test_composite_workflow_runs_linear_stages_with_disk_handoff -q- 1 passed.venv/bin/pytest packages/data-designer/tests/interface/test_composite_workflow.py::test_composite_workflow_resume_if_possible_delegates_matching_resumable_stage -q- 2 passed✅ Checklist
Description updated with AI