fix: create parent directories for nested clonePath#1652
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: snecklifter The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @snecklifter. Thanks for your PR. I'm waiting for a devfile member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds ChangesParent Directory Creation Fix with Integration Test
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Thank you @snecklifter LGTM, could you please add some tests in https://github.com/devfile/devworkspace-operator/tree/main/project-clone/test? |
When a devfile project specifies a nested clonePath (e.g. "back/devfile-rest"), the intermediary directories are never created, causing os.Rename to fail when moving the cloned project to its final destination. Add os.MkdirAll calls before os.Rename in both the git and zip project setup paths to ensure parent directories exist. Add an integration test fixture exercising nested clonePath with multiple projects sharing intermediary directories. Fixes: eclipse-che/che#23877 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Chris Brown <chribrow@redhat.com>
847a41d to
437833d
Compare
|
Thanks @dkwon17 — I've added an integration test fixture at |
Summary
clonePath(e.g.back/devfile-rest),os.Renamefails because the intermediary parent directories don't existos.MkdirAll(path.Dir(...))calls beforeos.Renamein both the git and zip project setup paths to ensure parent directories are createdclonePathvalues,path.Dirresolves to the already-existing root soMkdirAllis a no-opFixes: eclipse-che/che#23877
Test plan
clonePathvalues (e.g.back/devfile-rest,ui/devfile-ui)/projectsclonePathvalues still work as before🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests