Fix HTTP status for policy-blocked release actions#9
Closed
cursor[bot] wants to merge 5 commits into
Closed
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com>
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
Sign up for free
to 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.
Summary
Return a non-2xx HTTP response when promote/rollback is blocked by policy, while preserving the existing audit record and outcome details.
Why
HTTP promote/rollback endpoints previously returned
200 OKfor policy-blocked actions because the shared operation layer records the failed decision and returns an outcome. SDK clients callraise_for_status(), so they treated a blocked promotion as success even though the promoted pointer did not change.Changes
409 Conflictfor policy-blocked promote/rollback outcomes with the serialized outcome indetail.Validation
uv sync --frozen --extra devuv run python -m ruff check src testsuv run python -m pytestuv run python scripts/generate_schemas.pythengit diff --exit-code schemas/(if models/schemas touched)cd web && npm ci && npm run build && cd .. && git diff --exit-code src/flightdeck/server/static/(ifweb/src/or deps changed)cd web && npx playwright install chromium && npm run test:e2e(ifweb/changed)uv run flightdeck-quickstart-verifyuv run flightdeck --helpWith pip / venv only, use
python -m …equivalents fromDEVELOPMENT.md.Schema / Storage Impact
Risk
Low. The operation layer and audit persistence are unchanged; only the HTTP status for an already-blocked action changes from success to conflict.
Review
@flightdeckdev/maintainerson the org repo). On a fork, GitHub may not auto-request; use Reviewers on the PR.AGENTS.md); linked issue or release note intent noted if helpful.Notes
Bug and impact: SDK/API callers could treat a policy-blocked promotion or rollback as successful because HTTP returned 200. Root cause: server routes serialized
ActionOutcomedirectly without translating failed policy results into a failure status. Fix: return 409 Conflict with the outcome payload for blocked actions.