Skip to content

fix(monitors): say why Next refuses an invalid monitor - #1107

Open
krish-kant wants to merge 4 commits into
mainfrom
fix/sc435-monitor-wizard-errors
Open

krish-kant wants to merge 4 commits into
mainfrom
fix/sc435-monitor-wizard-errors

Conversation

@krish-kant

@krish-kant krish-kant commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Some monitor types validate fields that show no inline message: heartbeat interval and grace, the synthetic monitor's selected test, and MCP settings. When those failed, Next did nothing: no request and no message.

The form now passes an invalid handler to handleSubmit. It shows a "Validation Error" toast with the first validation message. Inline field messages are unchanged.

Test: monitor-form.invalid.spec.tsx submits a synthetic monitor with no test selected and expects the toast. It fails without the fix.

Summary by CodeRabbit

  • Bug Fixes
    • Monitor form validation errors now display a relevant message, with a clear fallback when no specific message is available.
    • Submitting without selecting a test now shows a validation message explaining that a test must be selected.

Heartbeat, synthetic and MCP rules attach errors to fields that render
no inline message, so Next did nothing. A failed submit now toasts the
first validation message.
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 27ab8a6 and 6c93709.

Files selected for processing: 2

  • app/src/components/monitors/monitor-form.invalid.spec.tsx
  • app/src/components/monitors/monitor-form.tsx

No actionable comments were generated in the recent review.

Walkthrough

The monitor form now displays a validation-error toast when submission fails. It uses the first validation message it finds, or a fallback prompt. A test verifies the message shown when no test is selected.

Changes: Monitor form validation

Layer / File(s) Summary
Invalid-submit feedback
app/src/components/monitors/monitor-form.tsx, app/src/components/monitors/monitor-form.invalid.spec.tsx
The form searches nested validation errors for the first string message and skips ref properties. On invalid submission, it displays that message in an error toast or uses a fallback prompt. The test checks the toast description when no test is selected.
Merge Risk: Minimal · previous review 27ab8

The monitor form now tells users why submission was blocked when validation fails. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(monitors): say why Next refuses an invalid monitor" matches the main change. The form now shows a "Validation Error" toast with the first validation message when submit fails on fields …
Description check Passed The description states the problem, which is that heartbeat interval and grace, the synthetic monitor's selected test, and MCP settings fail validation with no visible message. It explains the fix, wh…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(monitors): say why Next refuses an invalid monitor" matches the main change. The form now shows a "Validation Error" toast with the first validation message when submit fails on fields that have no inline message. The title is specific and concise, and it uses the conventional fix(scope) format. It does not name the affected field types, but that detail is not required.

Full details: Description check

Explanation

The description states the problem, which is that heartbeat interval and grace, the synthetic monitor's selected test, and MCP settings fail validation with no visible message. It explains the fix, which passes an invalid handler to handleSubmit and shows a Validation Error toast. It also names the test file and what it checks. The template sections 'Type of change', 'Risk and rollout', and the checklist are missing. The Summary has no issue link, and the Testing section has no exact commands or results. The description does not say whether the test was run and passed after the fix.

Resolution

Add the missing template sections so the description is complete. Mark the Type of change as Bug fix. Add the exact test command and its result, for example cd app && npm test -- monitor-form.invalid. Fill in Risk and rollout, using N/A if none applies. Complete the checklist, and link a closing issue if one exists.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7a2afd3 and 27ab8a6.

Files selected for processing: 2

  • app/src/components/monitors/monitor-form.invalid.spec.tsx
  • app/src/components/monitors/monitor-form.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Playwright screenshots

96 changed · 0 new · 0 failed vs main 7a2afd3

a viewer sees the masked url but no reveal copy or rotate and the api denies the reveal b23 39edef a viewer sees the masked url but no reveal copy or rotate and the api denies the reveal b23 7a0548 an editor sees the repeat until ack card disabled with ask a project admin critical editorpa bb0ef7 api totals and visible metric cards include exact seeded resources critical positive project e24541 archives a draft only after confirmation with persisted api state projectadminpage 8f9845 attaches a second status page from the incident and publishes the resolution to both critica 258f63

Open visual review (222 screenshots) · CI run

Updated for commit 6c93709.

The first version also toasted errors already shown under their field,
doubling the text (two E2E screenshot specs matched it twice). The
toast now runs after the error render and only when no inline message
is visible.
@krish-kant

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

This branch has not been deployed

No deployments
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.

1 participant