fix(platform): gate automation tester on input validation#1792
Conversation
The Execute and Dry-run buttons in the automation test panel were only disabled while a run was in flight — you could click them with invalid JSON or with required start-node inputs left blank, and the run would only fail downstream. Gate both buttons on validation: the input must parse as JSON and every required field declared in the start node's inputSchema must be configured. A required field counts as unconfigured when it's absent, null, a blank string, or an empty collection; 0 and false are accepted. When blocked, an inline message explains why (invalid JSON, or the list of required fields still to fill). Because the pre-filled template seeds required strings as empty, a freshly-opened tester is correctly gated until the user fills them in. Extract getMissingRequiredFields as a pure, exported helper with unit coverage. Closes #1483
|
Warning Review limit reached
More reviews will be available in 55 minutes and 29 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. 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 |
What
In the automation test panel (Automation → tester, e.g. Conversation Sync), Execute and Dry run were only disabled while a run was already in flight. With no required configuration entered — or with malformed JSON — you could still click them; the run just failed downstream with a toast.
Reported in #1483.
Change
Gate both buttons on validity:
inputSchemamust be configured. A required field is treated as unconfigured when it's absent,null, a blank/whitespace string, or an empty array/object.0andfalseare accepted (indistinguishable from deliberate values).When blocked, an inline
role="alert"message explains why — either "Enter valid JSON to run this automation." or "Configure required field(s) before running: …". Since the pre-filled template seeds required strings as""and required arrays as[], a freshly-opened tester is correctly gated until the user fills them.The check is a new pure helper
getMissingRequiredFields(schema, value)so it's unit-testable in isolation.Testing
input-schema-template.test.ts(7 cases): no-required, non-object input, absent/null/blank/empty-array detection,0/falseaccepted, whitespace-only strings, empty required object, and template-is-gated.tsc --noEmitandoxlint --type-awareclean.Closes #1483