[ZEPPELIN-6415] Fix FileSystemNotebookRepo folder move() creating parent of source instead of destination#5283
Open
Coen90 wants to merge 1 commit into
Open
[ZEPPELIN-6415] Fix FileSystemNotebookRepo folder move() creating parent of source instead of destination#5283Coen90 wants to merge 1 commit into
Coen90 wants to merge 1 commit into
Conversation
…ent of source instead of destination The folder move() method called tryMkDir on the source folder's parent instead of the destination folder's parent. Since the source folder must already exist for the move to succeed, creating its parent is redundant, while the destination's parent may not exist, causing the move to fail (e.g. moving /A/X to /B/X when /B does not exist). Create the parent of newFolderPath (the destination) before moving, so missing destination parent directories are created. This mirrors the existing behavior in the note move() overload. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR for?
The folder
move(String folderPath, String newFolderPath, AuthenticationInfo subject)method inFileSystemNotebookRepocreates the parent directory of the source folder instead of the destination folder before performing the move.Since the source folder must already exist for the move to succeed, creating its parent is redundant. Meanwhile the destination's parent directory may not exist, causing the subsequent move to fail — e.g. moving
/A/Xto/B/Xwhen/Bdoes not exist fails because the code creates/A(already present) instead of/B.This PR changes the
tryMkDircall to usenewFolderPath(the destination) instead offolderPath(the source), mirroring the existing behavior already present in the notemove()overload.What type of PR is it?
Bug Fix
Todos
What is the Jira issue?
How should this be tested?
FileSystemNotebookRepoTestcover the folder move flow./folder1→/folder2/folder3) and verify the move succeeds and the parent (/folder2) is created.Screenshots (if appropriate)
N/A
Questions: