Skip to content

fix: add typeguards for deployment window date rendering#1050

Merged
adityachoudhari26 merged 2 commits intomainfrom
deploy-window-typeguards
Apr 23, 2026
Merged

fix: add typeguards for deployment window date rendering#1050
adityachoudhari26 merged 2 commits intomainfrom
deploy-window-typeguards

Conversation

@adityachoudhari26
Copy link
Copy Markdown
Member

fixes #1025

Copilot AI review requested due to automatic review settings April 23, 2026 17:08
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@adityachoudhari26 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 41 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 315a54df-29d6-43db-8faa-6660f5b42cf3

📥 Commits

Reviewing files that changed from the base of the PR and between a487ff6 and 76ce996.

📒 Files selected for processing (1)
  • apps/web/app/routes/ws/deployments/_components/environmentversiondecisions/rule-results/DeploymentWindowDetail.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deploy-window-typeguards

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 parseWindowDetails to return null unless required date/duration fields are present and parseable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 43 to 51
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;
@adityachoudhari26 adityachoudhari26 merged commit 60ff787 into main Apr 23, 2026
7 checks passed
@adityachoudhari26 adityachoudhari26 deleted the deploy-window-typeguards branch April 23, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to load environment dialog page in deployments view

2 participants