Repository navigation
fix(workflows): contain step expression failures - #5635
qq2514568380 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The existing concurrency test expects ValueError to propagate, but the handler converts it into a failed StepResult, leaving the test expectation inconsistent with the implementation.
1 open issue
What changed in this PR
This PR addresses #5620 by containing step execution ValueErrors at Spec Kit’s shared workflow boundary, allowing existing failure handling to respect continue_on_error.
Changes:
- Converts
ValueErrorfromimpl.execute()into a failedStepResultwith a fixed message that excludes exception contents. - Adds regression cases for valid and invalid expressions, continuation behavior, and private-value persistence.
Review used source inspection only; tests were not run. AI-assisted review by GitHub Copilot (model: unknown, autonomous) for the review requester.
| File | Description |
|---|---|
tests/workflows/test_composition_execution.py |
Adds expression-failure, continuation, and privacy regression cases. |
src/specify_cli/workflows/_execution.py |
Converts step execution ValueErrors into failed results. |
Review effort: Balanced (adaptive)
There was a problem hiding this comment.
🔵 Needs a closer look
Human review is needed because the shared exception boundary changes ValueError recovery, continuation, and persisted retry behavior across registered steps, extensions, and nested or concurrent runs.
1 open issue
Review effort: Balanced (adaptive)
There was a problem hiding this comment.
🔵 Needs a closer look
The shared ValueError handling change affects continuation, concurrent fan-out, and persisted retry/resume behavior across all steps, requiring human review of the workflow-wide recovery policy.
1 open issue
Review effort: Balanced
|
Please address Copilot feedback and CI/CD errors |
| result = impl.execute(config, context) | ||
| try: | ||
| result = impl.execute(config, context) | ||
| except FromJsonError: |
| assert state.step_results["parse"]["output"]["value"] == {"value": 1} | ||
| else: | ||
| assert state.step_results["parse"]["error"] == "from_json: invalid JSON input" | ||
| assert "workflow_failed" not in _logged_events(state) |
|
Please address Copilot feedback |



Description
Closes #5620.
An invalid JSON value in a workflow expression now produces a failed step result. The existing continue_on_error and checkpoint handling can then process that failure. The saved message identifies the from_json filter without including the evaluated input. Other step and adapter exceptions retain their existing handling.
Testing
Regression cases cover valid and invalid JSON input, both continue_on_error settings, and propagation of an unrelated step ValueError.
Python syntax parsing and git diff --check passed. Local pytest and builds were not run. The new GitHub Actions runs require approval.