I've discovered that to successfully merge a versioned folder branch into another, both must be at the top-level of the catalogue tree. If one or both are under a sub-folder, then locating the source/target items relative to the source/target versioned folders does not work because the PathService cannot find the items.
Steps to reproduce
First, create two versioned folders with branches main and anotherBranch. Make sure that main already contained some models/items, then add some new models/items to anotherBranch. To verify the merge works generally, first create them at the root level of the catalogue:
Perform a merge from anotherBranch into main. Once completed, this should successfully work and the two branches should be identical.
Now move these versioned folders to a sub-folder in the catalogue tree:
Now merge anotherBranch into main again, but this time the UI says it completed successfully but the new items were not copied from source to target.
Expected behavior
When under sub-folders, the versioned folders should still be identical after a merge.
Additional context
In terms of creation patches, I think the problem is because the path is absolute to the catalogue, not the source/target versioned folder. This is an example of a new item created in a source branch under a sub-folder:
The PathService.findResourceByPathFromRootResource() method will look at this, see it is not relative to the provided source versioned folder, and attempt to use the whole path for item lookup. This will result in using the FolderService to locate the item, but this the wrong level to look at.
I think this path should be truncated during the merge - all sub-folders before vf:Test Versioned Folder$anotherBranch should be disregarded so that the child path can be used correctly.
Description
I've discovered that to successfully merge a versioned folder branch into another, both must be at the top-level of the catalogue tree. If one or both are under a sub-folder, then locating the source/target items relative to the source/target versioned folders does not work because the
PathService
cannot find the items.Steps to reproduce
First, create two versioned folders with branches
main
andanotherBranch
. Make sure thatmain
already contained some models/items, then add some new models/items toanotherBranch
. To verify the merge works generally, first create them at the root level of the catalogue:Perform a merge from
anotherBranch
intomain
. Once completed, this should successfully work and the two branches should be identical.Now move these versioned folders to a sub-folder in the catalogue tree:
Now merge
anotherBranch
intomain
again, but this time the UI says it completed successfully but the new items were not copied from source to target.Expected behavior
When under sub-folders, the versioned folders should still be identical after a merge.
Additional context
In terms of creation patches, I think the problem is because the path is absolute to the catalogue, not the source/target versioned folder. This is an example of a new item created in a source branch under a sub-folder:
The
PathService.findResourceByPathFromRootResource()
method will look at this, see it is not relative to the provided source versioned folder, and attempt to use the whole path for item lookup. This will result in using theFolderService
to locate the item, but this the wrong level to look at.I think this path should be truncated during the merge - all sub-folders before
vf:Test Versioned Folder$anotherBranch
should be disregarded so that the child path can be used correctly.