fix: CLI now rejects invalid enum option values before contacting Unity#1880
Conversation
convertValue passed string options straight through even when the tool schema declared an enum, so a typo'd --capture-mode or similar flag would forward an invalid value to Unity and show up as an Editor Console error instead of a CLI-side argument error. Match enum values case-insensitively, mirroring the C# side's CaseInsensitiveStringEnumConverter, and reject anything outside the list with the valid values included in the error.
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
a13ac61
into
feature/pause-point-feedback-round3-integration
Summary
--capture-mode bogus) are now rejected by the CLI itself, instead of being forwarded to Unity and showing up as an Editor Console error.User Impact
Changes
convertValuenow routesstring-typed options through a newconvertStringValue, which checks the value againstproperty.Enumcase-insensitively and returns a descriptive argument error (including the valid value list) on mismatch. Options without a declared enum pass through unchanged.Verification
sh scripts/check-go-cli.sh: all packages pass, 0 lint issues.go test(newtool_params_test.go): 4/4 new tests pass.dist/darwin-arm64/uloop screenshot --capture-mode bogusagainst the running Unity Editor now returns a CLI-sideINVALID_ARGUMENTerror listingwindow, renderingas valid values, anddist/darwin-arm64/uloop get-logs --log-type errorimmediately after showsTotalCount: 0— confirming no new Console error was produced in Unity.This PR targets the
feature/pause-point-feedback-round3-integrationbranch, notmain/v3-beta, so repository CI workflows (filtered to[main, v3-beta]) will not fire here — that is expected. Verification above is local/manual for this PR; full CI runs on the final integration PR intov3-beta.