Repository navigation
Allow writeFiles to omit resource for inline file trees - #4359
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe ChangesInline
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to Inline file trees appear supported across validation and execution, with no identified issue requiring a fix before merge. 🚥 Pre-merge checks | ✅ 5❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Motivation for the change, related issues
A v1 Blueprint using
writeFileswith an inline{ name, files }tree fails schema validation even though the step can write that tree and the documented example omitsresource. Fixes #2136.Implementation details
filesTreevalues withoutresourcein the v1 type and generated schema and validator.literal:directoryandgit:directoryresources and other steps' resource requirements.The v2 validator change only renames an internal generated schema alias; it does not change v2 validation.
Testing Instructions (or ideally a Blueprint)
npm exec -- nx build playground-blueprintsnpm exec -- nx build docs-sitenpm exec -- nx run playground-blueprints:test:vite --testFiles=src/tests/schema/public-schema.spec.ts(27 passed)npm exec -- nx run playground-blueprints:test:vite --testFiles=src/tests/v1/compile.spec.ts(30 passed)npm exec -- nx typecheck playground-blueprintsnpm exec -- nx lint playground-blueprintsThe unfiltered package suite could not complete in the restricted sandbox because unrelated tests require network and loopback socket access. The targeted runtime test passed with loopback access.
Example Blueprint step:
{ "step": "writeFiles", "writeToPath": "/wordpress/wp-content/plugins/example", "filesTree": { "name": "example", "files": { "plugin.php": "<?php /* Plugin Name: Example */" } } }Summary by CodeRabbit
writeFilesnow accepts inline directory structures without aresourceproperty, while continuing to support explicitliteral:directoryandgit:directoryresources.nameandfilesproperty; nested directories and file contents are supported.