Repository navigation
Cli: Handle nested array schema for AI help - #35424
Conversation
📝 WalkthroughWalkthroughAdds a recursive ChangesRecursive JSON Schema Help Rendering
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
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.
🧹 Nitpick comments (1)
code/core/src/cli/ai/mcp/run-tool.test.ts (1)
802-857: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider adding a
oneOftest case or clarifying the test name.The test is named "describes anyOf/oneOf union variants in help" but only exercises
anyOf. While both use the same code path (schema.anyOf ?? schema.oneOf), a dedicatedoneOfassertion would guard against future divergence.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@code/core/src/cli/ai/mcp/run-tool.test.ts` around lines 802 - 857, The test name suggests coverage for both anyOf and oneOf, but the current case only exercises anyOf in runAiToolHelp. Update the test in run-tool.test.ts by either renaming it to reflect anyOf-only behavior or, preferably, add a separate oneOf assertion that also validates the same union-variant help output path through runAiToolHelp and loadStorybookAiMetadata. Keep the existing snapshot-style expectations aligned with the union variant labels so future changes to schema.anyOf ?? schema.oneOf are covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@code/core/src/cli/ai/mcp/run-tool.test.ts`:
- Around line 802-857: The test name suggests coverage for both anyOf and oneOf,
but the current case only exercises anyOf in runAiToolHelp. Update the test in
run-tool.test.ts by either renaming it to reflect anyOf-only behavior or,
preferably, add a separate oneOf assertion that also validates the same
union-variant help output path through runAiToolHelp and
loadStorybookAiMetadata. Keep the existing snapshot-style expectations aligned
with the union variant labels so future changes to schema.anyOf ?? schema.oneOf
are covered.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1a9c79b2-a6e6-4136-8c72-db349f841226
📒 Files selected for processing (3)
code/core/src/cli/ai/mcp/run-tool.test.tscode/core/src/cli/ai/mcp/run-tool.tscode/core/src/cli/ai/mcp/types.ts
LogDetails |
Closes #
What I did
Support showing array schema details instead of just
--collections(array, required)Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
run the
storybook ai --helpcommand and check if the array sche!ma shows details for the array itemsCaution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>Summary by CodeRabbit
New Features
Bug Fixes