fix(core): don't delete the entire working directory when schemas has no path - #3753
Conversation
📝 WalkthroughWalkthrough
ChangesSchema path validation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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 |
@orval/angular
@orval/axios
@orval/core
@orval/effect
@orval/fetch
@orval/hono
@orval/mcp
@orval/mock
orval
@orval/query
@orval/solid-start
@orval/swr
@orval/zod
commit: |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/orval/src/generate-spec.test.ts (1)
1265-1289: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winExercise the original
clean: truescenario.This test confirms path validation, but it never enables
clean: trueor verifies that a generated target/unrelated workspace file is preserved. Add those conditions so the regression test directly covers the deletion bug described by the PR objective.🤖 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 `@packages/orval/src/generate-spec.test.ts` around lines 1265 - 1289, The test in “generateSpec - normalizeOptions pathless schemas object” only verifies validation and does not reproduce the clean-up regression. Extend the temporary workspace setup with an unrelated file and enable clean: true in the output options, then invoke the relevant generation/normalization flow and assert the target or unrelated workspace file remains preserved while the pathless schemas configuration is rejected.
🤖 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 `@packages/orval/src/generate-spec.test.ts`:
- Around line 1265-1289: The test in “generateSpec - normalizeOptions pathless
schemas object” only verifies validation and does not reproduce the clean-up
regression. Extend the temporary workspace setup with an unrelated file and
enable clean: true in the output options, then invoke the relevant
generation/normalization flow and assert the target or unrelated workspace file
remains preserved while the pathless schemas configuration is rejected.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 687d791c-0a7f-46d1-8919-c3a72ebc630c
📒 Files selected for processing (2)
packages/orval/src/generate-spec.test.tspackages/orval/src/utils/options.ts
Closes: #3752
Summary by CodeRabbit