Skip to content

fix(workflows): contain step expression failures - #5635

Open
qq2514568380 wants to merge 3 commits into
github:mainfrom
qq2514568380:fix/5620-workflow-expression-errors
Open

qq2514568380 wants to merge 3 commits into
github:mainfrom
qq2514568380:fix/5620-workflow-expression-errors

Conversation

@qq2514568380

@qq2514568380 qq2514568380 commented Nov 30, 2026 •

Copy link
Copy Markdown

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.

@qq2514568380
qq2514568380 requested a review from mnriem as a code owner November 30, 2026 14:43
Copilot AI adaptive review requested due to automatic review settings November 30, 2026 14:43

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.

🟡 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 ValueError from impl.execute() into a failed StepResult with 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)

Comment thread src/specify_cli/workflows/_execution.py Resolved
Copilot AI adaptive review requested due to automatic review settings December 1, 2026 08:07

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.

🔵 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)

@mnriem mnriem added the triage-must-have Verdict: high-value, important work for Spec Kit — do first label Dec 1, 2026
@mnriem
mnriem requested a balanced review from Copilot December 1, 2026 21:20

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.

🔵 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

@mnriem

mnriem commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback and CI/CD errors

Copilot AI balanced review requested due to automatic review settings December 4, 2026 02:06

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.

🟡 Changes recommended

Non-JSON expression errors still escape the handler and abort workflows despite continue_on_error being enabled.

2 open issues
1 resolved since last review

Review effort: Balanced

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)
@mnriem

mnriem commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-must-have Verdict: high-value, important work for Spec Kit — do first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Expression evaluation errors abort the workflow run instead of failing the step

3 participants