- Notifications
You must be signed in to change notification settings - Fork576
UN-2584 [FIX] Corrected HTTP status codes for workflow execution status API#1256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Draft
muhammad-ali-e wants to merge4 commits intomainChoose a base branch fromUN-2309-avoid-422-response-for-in-progress
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
Contributor
chandrasekharan-zipstack left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Changes LGTM - however
- Won't this break existing clients that rely on the existing (flawed) logic? Ideally we should version the API deployments to aid with such changes however since we don't have it in place I'm wondering how we can carry this out cleanly
- We might have to update accordingly in our
python-clientand the API deployments batch run script if required
Contributor
coderabbitaibot commentedJul 12, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Summary by CodeRabbit
##Summary by CodeRabbit***Bug Fixes*** Improved handling of deployment execution statuses with clearer and more accurate HTTP responses for acknowledged, completed, executing, pending, and error states.***Refactor*** Clarified and streamlined the logic for determining response statuses based on execution state.##WalkthroughThe control flow in the`get` method of the`DeploymentExecution` API view was refactored to more explicitly handle various execution statuses. The response status codes and messages were adjusted based on the execution state, with clearer branching and an early return for acknowledged results. Enum usage was updated for status checks. A new helper method was added to modularize response data filtering based on request flags and global settings.##Changes| File(s)| Change Summary||-------------------------------|--------------------------------------------------------------------------------------------------------------------------|| backend/api_v2/api_deployment_views.py| Refactored`get` method to restructure response status logic, added early return for acknowledged results, replaced enum import, and introduced`_filter_response_data` helper method for conditional response data filtering.|##Sequence Diagram(s)```mermaidsequenceDiagram participant Client participant API_View participant ExecutionStatus Client->>API_View: GET /deployment-execution API_View->>ExecutionStatus: Check execution status alt Result already acknowledged API_View-->>Client: HTTP 406 (Not Acceptable) with message else Execution completed API_View-->>Client: HTTP 200 with result (filtered as needed) else Executing or Pending API_View-->>Client: HTTP 200 with current status (filtered as needed) else Other statuses (stopped, error, etc.) API_View-->>Client: HTTP 422 (Unprocessable Entity) with error info end |
…us APIFixed PENDING and EXECUTING states to return 200 OK instead of 422,resolving API integration issues where clients expected 200 OK forvalid in-progress states per documentation.🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Sign up for freeto 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.



Uh oh!
There was an error while loading.Please reload this page.
What
200 OKinstead of422 Unprocessable EntityWhy
422status codes for valid in-progress states (PENDING/EXECUTING)200 OKfor successful status checks per API documentationHow
backend/api_v2/api_deployment_views.pyto return proper HTTP status codes:PENDING,EXECUTING→200 OK(was 422 before)COMPLETED→200 OK(no change)ERROR,STOPPED→422 Unprocessable Entity(no change)Result already acknowledged→406 Not Acceptable(no change)getmethod with improved structure and documentation_filter_response_datamethodCan this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
Database Migrations
Env Config
Relevant Docs
Related Issues or PRs
Dependencies Versions
Notes on Testing
Screenshots
N/A - Backend API change
Checklist
I have read and understood theContribution Guidelines.
🤖 Generated withClaude Code
Co-Authored-By: Claudenoreply@anthropic.com