fix: create parent directories for nested clonePath#1652
Conversation
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. Fixes: eclipse-che/che#23877 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Chris Brown <chribrow@redhat.com>
|
[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. |
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ 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 |
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