fix: add typeguards for deployment window date rendering#1050
fix: add typeguards for deployment window date rendering#1050adityachoudhari26 merged 2 commits intomainfrom
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 41 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #1025 by hardening the deployments environment dialog UI against invalid/missing deployment window date fields coming from policy evaluation details, preventing runtime crashes during date rendering.
Changes:
- Added a date-string validation helper for deployment window rendering.
- Tightened
parseWindowDetailsto returnnullunless required date/duration fields are present and parseable.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function parseWindowDetails( | ||
| window: DeploymentWindow, | ||
| ): DeploymentWindowProperties | null { | ||
| const details = window.details as Partial<DeploymentWindowProperties>; | ||
| if (details.rrule == null || details.window_type == null) return null; | ||
| if (typeof details.duration_minutes !== "number") return null; | ||
| if (!isValidDateString(details.next_window_start)) return null; | ||
| if (!isValidDateString(details.next_window_end)) return null; | ||
| return details as DeploymentWindowProperties; |
fixes #1025