Repository navigation
fix: reject over-length intake issue names with 400 - #9940
pablohashescobar wants to merge 1 commit into
Conversation
- POST /api/v1/.../intake-issues/ passed the name straight to Issue.objects.create, so a name over 255 chars raised a Postgres DataError and returned HTTP 500. - Validate against the Issue.name max_length before creating and return a 400 with a clear error message. - Add contract tests for names just over and exactly at the limit. - Reformat the on_results lambda in the list endpoint.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe intake POST endpoint rejects issue names that exceed the model’s maximum length with HTTP 400. Contract tests verify that a 256-character name is rejected without creating an issue and that a 255-character name is accepted. ChangesIntake issue name validation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change adds the requested name-length rejection while preserving the 255-character boundary. No concrete merge-blocking regression was found; normal test checks should still run. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The validation matches the model constraint and is covered by appropriate boundary tests.
Review effort: Balanced
Findings: None
What changed in this PR
Adds model-aligned validation to prevent over-length intake issue names from causing HTTP 500 errors.
Changes:
- Rejects names exceeding the model limit with HTTP 400.
- Adds regression and boundary tests.
- Reformats the intake list serializer lambda.
| File | Description |
|---|---|
apps/api/plane/api/views/intake.py |
Validates intake issue name length before creation. |
apps/api/plane/tests/contract/api/test_intake_name_length.py |
Tests 255- and 256-character names. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
POST /api/v1/workspaces/<slug>/projects/<id>/intake-issues/passed the issue name straight toIssue.objects.create. A name over 255 characters made Postgres raiseDataError: value too long for type character varying(255), which surfaced as an HTTP 500.Issue._meta.get_field("name").max_lengthand returns a 400 withName must be at most 255 characters. The limit is read from the model, so it won't drift from the column.on_resultslambda in the list endpoint (no behavior change).Type of Change
Screenshots and Media (if applicable)
Test Scenarios
pytest plane/tests/contract/api/test_intake_name_length.pyviadocker-compose-test.yml.References
No work item.
🤖 Generated with Claude Code
Summary by CodeRabbit