Refactor query validation bad request errors (#936)#1179
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a private helper Query Validation Refactor
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (4 passed)
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. Comment |
qingfeng312
left a comment
There was a problem hiding this comment.
Looks good.
The change is a small, behavior-preserving refactor: the repeated HTTPException(status_code=400, detail=...) branches are centralized behind _raise_bad_query_param, while each query-validation path keeps the same status code and detail strings. The PR is limited to app/query_validation.py, and the full quality workflow is green.
Evidence: GitHub Actions run 28345759957, job 83968629778, successful.
yanyishuai
left a comment
There was a problem hiding this comment.
Review packet (Bounty #933)
- Reviewed PR: #1179
- Head commit:
2c5ba9b5b90514010c8ae30b583738b0769bb53f - Scope inspected: query-parameter validation / bad-request error shaping for public API routes
- Verdict: Focused refactor with clear error envelopes for invalid query input. CI quality gate passes on current head. The change improves agent-facing debuggability without altering successful-path behavior.
- Notes: Overlaps thematically with other validation-hardening PRs in the queue; maintainers should ensure merge order avoids duplicate error-message drift. No treasury/payout surface touched.
Bounty #933
Summary
HTTPException(status_code=400, detail=...)blocks inapp/query_validation.pyBounty: #936
Verification
python3 -m pytest tests/test_query_validation.pypython3 -m ruff check app/query_validation.py tests/test_query_validation.pypython3 -m ruff format --check app/query_validation.py tests/test_query_validation.pySummary by CodeRabbit