Skip to content

fix: create parent directories for nested clonePath#1652

Open
snecklifter wants to merge 1 commit into
devfile:mainfrom
snecklifter:fix/create-clone-path-parent-dirs
Open

fix: create parent directories for nested clonePath#1652
snecklifter wants to merge 1 commit into
devfile:mainfrom
snecklifter:fix/create-clone-path-parent-dirs

Conversation

@snecklifter

Copy link
Copy Markdown

Summary

  • When a devfile project specifies a nested clonePath (e.g. back/devfile-rest), os.Rename fails because the intermediary parent directories don't exist
  • Adds os.MkdirAll(path.Dir(...)) calls before os.Rename in both the git and zip project setup paths to ensure parent directories are created
  • For flat clonePath values, path.Dir resolves to the already-existing root so MkdirAll is a no-op

Fixes: eclipse-che/che#23877

Test plan

  • Start a workspace with a devfile containing multiple projects with nested clonePath values (e.g. back/devfile-rest, ui/devfile-ui)
  • Verify all projects are cloned into the correct subdirectory structure under /projects
  • Verify single-level clonePath values still work as before

🤖 Generated with Claude Code

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>
@openshift-ci

openshift-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: snecklifter
Once this PR has been reviewed and has the lgtm label, please assign dkwon17 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DevFile] When clone path is set, intermediary non existing folder is not created

1 participant