Skip to content

feat(workflow-engine-app): propagate HTTP status code in AppCommand error results - #19958

Merged
danielskovli merged 1 commit into
mainfrom
feat/workflow-engine-appcommand-error-status
Aug 20, 2026
Merged

feat(workflow-engine-app): propagate HTTP status code in AppCommand error results#19958
danielskovli merged 1 commit into
mainfrom
feat/workflow-engine-appcommand-error-status

Conversation

@danielskovli

@danielskovli danielskovli commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

AppCommand now passes the callback response's status code into ExecutionResult.CriticalError/RetryableError, giving app-callback error history parity with WebhookCommand: every persisted ErrorEntry carries a machine-readable HttpStatusCode instead of embedding it only in the message text.

  • Both HTTP error-classification branches (4xx → critical, 5xx/408/418/429 → retryable) pass httpStatusCode; message strings are unchanged.
  • Non-HTTP paths are untouched and keep a null status code, including the invalid-JSON-on-2xx branch (now pinned by a test): only failure-classifying HTTP responses carry a code.
  • No wire-contract change (snapshot unchanged).

Second prerequisite of the failure-storm throttling design (#18481), whose detection refinements group failures by status code; stacked on #19957 (and the ADR in #19954).

Verification

  • Full workflow-engine-app suite: 76 passed, 0 failed, 0 skipped (incl. Testcontainers/WireMock integration).
  • Extended tests assert the code on both classifications across the status matrix, and null on the invalid-JSON branch.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Failed AppCommand callbacks now include the relevant HTTP status code in execution errors.
    • Retryable, non-retryable and server-error responses are reported more accurately.
    • Invalid JSON in otherwise successful responses no longer reports an incorrect HTTP status code.
  • Tests

    • Added coverage for HTTP status codes across callback success and failure scenarios.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 287fa1ef-8142-426a-8417-46bfe9bffd13

📥 Commits

Reviewing files that changed from the base of the PR and between 156a57e and b819601.

📒 Files selected for processing (2)
  • src/Runtime/workflow-engine-app/src/WorkflowEngine.App/Commands/AppCommand/AppCommand.cs
  • src/Runtime/workflow-engine-app/tests/WorkflowEngine.App.Tests/Commands/AppCommand/AppCommandExecutionTests.cs

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

AppCommand callback failures now include HTTP status codes in ExecutionResult values. Tests verify status codes for 500, retryable, and non-retryable responses. Tests also verify that invalid JSON in a successful 2xx response leaves HttpStatusCode unset.

Changes

AppCommand status propagation

Layer / File(s) Summary
Propagate and verify callback status codes
src/Runtime/workflow-engine-app/src/WorkflowEngine.App/Commands/AppCommand/AppCommand.cs, src/Runtime/workflow-engine-app/tests/WorkflowEngine.App.Tests/Commands/AppCommand/AppCommandExecutionTests.cs
Failed callbacks now preserve their numeric HTTP status codes in ExecutionResult. Tests cover 500, retryable, non-retryable, and invalid-JSON responses.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to b8196

The change records HTTP status codes for classified AppCommand callback failures while preserving existing messages and non-HTTP behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: propagating HTTP status codes in AppCommand error results.
Description check ✅ Passed The description explains the change, classifications, non-HTTP behaviour, testing, and verification results in sufficient detail.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/workflow-engine-appcommand-error-status

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the skip-releasenotes Issues that do not make sense to list in our release notes label Aug 13, 2026
@danielskovli
danielskovli marked this pull request as ready for review August 13, 2026 15:21
@danielskovli
danielskovli force-pushed the feat/workflow-engine-appcommand-error-status branch 4 times, most recently from 4b3fa74 to 75a3842 Compare August 20, 2026 09:32
Base automatically changed from feat/workflow-engine-retry-jitter to main August 20, 2026 09:54
@danielskovli
danielskovli requested a review from a team as a code owner August 20, 2026 09:54
…rror results

Makes app-callback error history machine-readable: the response status code
now lands in ErrorEntry.HttpStatusCode instead of only the message string,
matching WebhookCommand.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@danielskovli
danielskovli force-pushed the feat/workflow-engine-appcommand-error-status branch from 75a3842 to b819601 Compare August 20, 2026 09:54
@danielskovli danielskovli added the approve You approve this PR. Use when: - Small changes - Already agreed upon - Async review label Aug 20, 2026
@danielskovli
danielskovli merged commit b1944c5 into main Aug 20, 2026
6 checks passed
@danielskovli
danielskovli deleted the feat/workflow-engine-appcommand-error-status branch August 20, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approve You approve this PR. Use when: - Small changes - Already agreed upon - Async review skip-releasenotes Issues that do not make sense to list in our release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant