SEP-2024: Validate failure_reason against task-history status - #1526
Merged
Merged
Conversation
Co-authored-by: yyyyyyyan <24644216+yyyyyyyan@users.noreply.github.com>
Co-authored-by: yyyyyyyan <24644216+yyyyyyyan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] SEP-2024: Validate failure_reason against status on task-history create route
SEP-2024: Validate failure_reason against task-history status
Sep 15, 2026
yyyyyyyan
marked this pull request as ready for review
September 15, 2026 02:15
yyyyyyyan
requested review from
a team,
marcuscruz-percona,
nachodd and
peter-o-addo
as code owners
September 15, 2026 02:15
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the stated API contract and includes appropriate coverage and documentation.
Pull request overview
Adds task-history validation to prevent contradictory failure reasons.
Changes:
- Rejects failure reasons for statuses without operator summaries.
- Adds rejection coverage and structured 422 assertions.
- Updates OpenAPI documentation and changelog.
File summaries
| File | Description |
|---|---|
app/tasks/routes.py |
Adds status/reason validation. |
tests/app/tasks/test_routes.py |
Tests rejected status combinations. |
frontend/packages/api/specs/tasks.json |
Documents the new 422 response. |
changelog.d/SEP-2024.changed.md |
Records the behavior change. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
POST /history/accepted failure reasons for statuses that do not carry operator-facing failure details, allowing contradictory task-history records.Validation
failure_reasonwhenstatus.operator_summary()returnsNone.FAILED,LOST,STALE, andUNLAUNCHABLE.Coverage
SUCCESS,PENDING,RUNNING, andSTOPPEDrejection.API contract