Skip to content

fix(workflows): validate persisted step result shapes - #4399

Open
WOLIKIMCHENG wants to merge 1 commit into
github:mainfrom
WOLIKIMCHENG:fix/runstate-step-results-shape
Open

fix(workflows): validate persisted step result shapes#4399
WOLIKIMCHENG wants to merge 1 commit into
github:mainfrom
WOLIKIMCHENG:fix/runstate-step-results-shape

Conversation

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor

Description

Validate persisted workflow step_results before status and resume consumers access them.

  • Require step_results to be a JSON object.
  • Reject non-object per-step result records.
  • Preserve valid records and the legacy empty default when the field is omitted.

Testing

  • Related RunState, status, resume, and list-runs tests: 93 passed
  • tests/test_workflows.py: 978 passed, 1 skipped
  • Ruff 0.15.0 check src tests
  • git diff --check
  • In-memory compile/import and pre-fix regression checks

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_results containers 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.

@lilisalinas936-design

lilisalinas936-design commented Sep 2, 2026 via email

Copy link
Copy Markdown

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.

4 participants