Repository navigation
fix: validate work item date ranges on partial updates - #9947
GODOSTROYER wants to merge 1 commit into
Conversation
|
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 (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughBoth issue serializers now validate supplied date changes against the effective start and target dates, including existing values omitted from partial updates. Unit and contract tests cover invalid and valid date updates. ChangesIssue date validation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The date-validation change is ready to merge after normal checks. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The change rejects invalid date ranges without expanding access or authority. Existing authorization and work-item ownership remain unchanged, and rejected requests do not enter the save path. No material security risk introduced or worsened by this change was identified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
Description
Updating only one work-item date could bypass the existing date-range validation in both the public API and the API used by the web app. The validators compared dates only when both were present in the request.
For a work item with
start_date=2026-01-10andtarget_date=2026-01-20:Previously, this saved an inverted date range. It now returns HTTP 400 with
{"non_field_errors":["Start date cannot exceed target date"]}and leaves the work item unchanged. Updating onlytarget_dateto2026-01-09is rejected in the same way. The app's/api/workspaces/{slug}/projects/{project_id}/issues/{id}/endpoint follows the same rule.Both validators now use the saved value for an omitted date. Explicit
nullstill clears a date, equal dates remain valid, and updates containing neither date retain their existing behavior.Type of Change
Screenshots and Media (if applicable)
Not applicable; backend request validation.
Test Scenarios
makemigrations --check --dry-runpass. The exact CI Ruff command passes on a disposable source snapshot, and copyright checks pass for all changed Python files.Focused regression command, from
apps/apiwith the repository's test services configured:References
No linked issue. The reproduction above and the regression tests describe the defect; no matching issue or existing fix was found during triage.
Summary by CodeRabbit