fix(workflows): validate persisted step result shapes - #4399
Open
WOLIKIMCHENG wants to merge 1 commit into
Open
Conversation
Reject non-object step_results values and per-step records at the RunState load boundary. Preserve valid mappings and the legacy empty default when the field is omitted.
Contributor
There was a problem hiding this comment.
馃煝 Approval recommended
The focused validation is correct and comprehensively tested.
Pull request overview
Validates persisted workflow step results before status/resume processing.
Changes:
- Rejects malformed
step_resultscontainers and records. - Preserves valid records and legacy missing-field behavior.
- Adds regression tests for each case.
File summaries
| File | Description |
|---|---|
src/specify_cli/workflows/engine.py |
Validates persisted step-result shapes during loading. |
tests/test_workflows.py |
Covers valid, malformed, and legacy states. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Validate persisted workflow
step_resultsbefore status and resume consumers access them.step_resultsto be a JSON object.Testing
tests/test_workflows.py: 978 passed, 1 skippedcheck src testsgit diff --check